<component name="ChangeListManager">
<list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/remoteinfos.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/scripts/lib/tmdb.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/tmdb.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tools/pop/pop.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/pop.py" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/tools/pop/startpopdaemon" beforeDir="false" afterPath="$PROJECT_DIR$/tools/pop/startpopdaemon" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<workItem from="1590912219927" duration="2795000" />
<workItem from="1591437119712" duration="23000" />
<workItem from="1591437163856" duration="1334000" />
- <workItem from="1591438704520" duration="1634000" />
- </task>
- <task id="LOCAL-00274" summary=".">
- <created>1578556780231</created>
- <option name="number" value="00274" />
- <option name="presentableId" value="LOCAL-00274" />
- <option name="project" value="LOCAL" />
- <updated>1578556780231</updated>
+ <workItem from="1591438704520" duration="2066000" />
+ <workItem from="1591456322960" duration="915000" />
+ <workItem from="1591458634078" duration="2877000" />
</task>
<task id="LOCAL-00275" summary=".">
<created>1578559851311</created>
<option name="project" value="LOCAL" />
<updated>1591437757808</updated>
</task>
- <option name="localTasksCounter" value="323" />
+ <task id="LOCAL-00323" summary=".">
+ <created>1591440466804</created>
+ <option name="number" value="00323" />
+ <option name="presentableId" value="LOCAL-00323" />
+ <option name="project" value="LOCAL" />
+ <updated>1591440466805</updated>
+ </task>
+ <option name="localTasksCounter" value="324" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1585852940968" />
- <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1591437749116">
+ <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1591440409900">
<screen x="0" y="0" width="2560" height="1040" />
</state>
- <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1591437749116" />
+ <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1591440409900" />
<state x="1060" y="275" key="FileChooserDialogImpl" timestamp="1590912263817">
<screen x="0" y="0" width="2560" height="1040" />
</state>
<screen x="0" y="0" width="2560" height="1040" />
</state>
<state x="1456" y="240" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1586418523328" />
- <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1587628717476">
+ <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1591459411916">
<screen x="0" y="0" width="2560" height="1040" />
</state>
- <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1587628717476" />
+ <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1591459411916" />
<state x="943" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1584289936754">
<screen x="0" y="0" width="2560" height="1040" />
</state>
function cronOneLoop($cronmin)
{
set_time_limit(0);
+
+ echo '------------------------------------' . "\n";
+ _logSection('One Loop // ' . $cronmin);
cronRooms($cronmin);
cronInsteon($cronmin);
cronWeather($cronmin);
if ($cronmin % 5 == 0) {
cronTraffic($cronmin, false);
cronVelib($cronmin);
- //cronBackyard($cronmin);
cronGuest($cronmin);
}
if ($cronmin % 10 == 0) {
cronInterface($cronmin);
if ($cronmin % 15 == 0) {
cronXPlanet($cronmin);
- cronPodcasts($cronmin);
cronFlowerPower($cronmin);
+ cronPodcasts($cronmin);
}
if ($cronmin == 0) {
cronEcoMode($cronmin);
cronTranscode($cronmin);
}
cronHeartbeat($cronmin);
+ _logSection('End Loop');
}
function cronXPlanet($cronmin)
{
+ _logSection('XPlanet');
$path = ROOT . '/tools/xplanet/';
$suncurve = $path . 'xplanet-suncurve';
$earth = $path . 'xplanet-earth';
function cronGuest($cronmin)
{
+
+ _logSection('Guest');
setState('guest', hasGuest() ? '1' : '0');
}
function cronInsteon($cronmin)
{
+ _logSection('Insteon');
insteonCommand('knock');
}
function cronEcoMode($cronmin)
{
+ _logSection('Ecomode');
$ecomode = (int)getEcoMode();
$scenes = [0 => 'off', 1 => 'on', 2 => 'super'];
execScene('ecomode/' . $scenes[$ecomode]);
function cronTranscode($cronmin)
{
+ _logSection('Transcode');
httpRequest('https://salon.home.tortuga.enhydra.fr/scripts/transcode.php', 'get', [], null, 10, true);
}
+function _logSection($t)
+{
+ echo '------' . $t . ' :: ' . date('Y-m-d H:i:s') . "\n";
+}
+
function cronRooms($cronmin)
{
+ _logSection('Rooms');
if ($cronmin % 5 == 0 && getState('bureauAutoMode') == '1') {
updateBureauAuto();
}
checkPlanetarium();
}
-function cronBackyard($cronmin)
-{
- domoticzSwitch(679, isDay()); // Projecteurs cour
-}
-
function cronFlowerPower($cronmin)
{
+ _logSection('Flower Power');
updateFlowerPower();
}
function cronMediaLibrary($cronmin)
{
global $directories;
+ _logSection('Media Library');
$media = array();
$shareroot = '/volume1/Share';
function cronTmdb($cronmin)
{
+ _logSection('TMDB');
_getTVShows(true, false);
_getMovies(true, false);
_getMediaRecentAdded(true);
function cronPing($cronmin)
{
+ _logSection('Pings');
global $devices;
- setState('vincenthere', ping('192.168.13.31') ? '1' : '0');
- setState('hasnetwork', ping('1.1.1.1', 443) ? '1' : '0');
+ setState('vincenthere', ping('192.168.13.31', 5) ? '1' : '0');
+ setState('hasnetwork', ping('1.1.1.1', 3, 443) ? '1' : '0');
foreach ($devices as $name => $device) {
$result = ping($device['host'], 3, 22) ? '1' : '0';
setState('device_' . $name . '_awake', $result);
function cronSqueezeFavorites($cronmin)
{
+ _logSection('Squeeze Favorites');
$favorites = getSqueezeFavorites();
if ($favorites !== false && count($favorites) > 0) {
connectRedis()->igbset('squeezebox_favorites', $favorites);
function cronWeather($cronmin)
{
+ _logSection('Weather');
$place = 2608449;
$apikey = 'fM7z3yrWwnUuXuAPPYIM5EqTl2iBAGB6';
function cronVelib($cronmin)
{
-
+ _logSection('Velib');
$cache = ROOT . '/cache/velib.json';
$hour = date('G');
function cronTraffic($cronmin, $force = false)
{
-
+ _logSection('Traffic');
$cache = ROOT . '/cache/traffic.json';
$hour = date('G');
function cronPodcasts($cronmin)
{
+ _logSection('Podcasts');
checkSpottyLogin();
$podcasts = getSqueezeFavorites(0, 'podcasts');
if ($podcasts !== false && count($podcasts) > 0) {
function cronInterface($cronmin)
{
+ _logSection('Interface');
if ((getState('ecomode') == '0' && $cronmin % 3 == 0) || $cronmin % 10 == 0) {
$devices = ['salon', 'bureau', 'entree', 'cuisine', 'litvincent', 'litjerome', 'sdb', 'chambre', 'bureausun', 'wc'];
foreach ($devices as $device) {
function cronHarmony($cronmin)
{
+ _logSection('Harmony');
$currentActivity = getCurrentHarmonyActivity();
if ($currentActivity == 'tv') {
function cronHeartbeat($cronmin)
{
+ _logSection('Heartbeat');
if ($cronmin % 5 != 0) {
return;
}
$res['time'] = '';
$res['title'] = '';
$res['artwork'] = '';
- $res['status']='';
+ $res['status'] = '';
$d = getDevice();
$playlist = simplexml_load_string(VLCCmd(['query' => 'requests/playlist.xml'], $d));
$library = new moviesLibrary($directories);
$movie = $library->getMovieByID($id);
$res['title'] = $movie['title'];
- $res['artwork'] = 'https://image.tmdb.org/t/p/w500' . $movie['backdrop_path'];
+ $res['artwork'] = cacheMedia('https://image.tmdb.org/t/p/w500' . $movie['backdrop_path']);
}
} else {
$f = new SplFileInfo($file);
if (count($matches) > 0) {
$res['title'] .= '<br>S' . $matches[1] . ' E' . $matches[2];
}
- $res['artwork'] = 'https://image.tmdb.org/t/p/w500' . $tvshow['backdrop_path'];
+ $res['artwork'] = cacheMedia('https://image.tmdb.org/t/p/w500' . $tvshow['backdrop_path']);
}
}
}
}
$res['can_seek'] = isset($status['can_seek']);
$res['title'] = $remoteMeta['title'];
- $res['artwork'] = str_replace('http://', 'https://', $remoteMeta['artwork_url']);
+ $res['artwork'] = cacheMedia($remoteMeta['artwork_url']);
return $res;
}
{
global $videoExt;
$subname = $prefix . 'tvshow-' . $tvShow['id'];
- $res['shortcuts'][] = ['label' => $tvShow['data']['name'], 'type' => 'sub', 'sub' => $subname, 'poster' => cacheMedia('https://image.tmdb.org/t/p/w500' . $tvShow['data']['poster_path'])];
+ $res['shortcuts'][] = ['label' => $tvShow['data']['name'], 'type' => 'sub', 'sub' => $subname, 'poster' => $this->_poster($tvShow['data']['poster_path'])];
$res['subs']['sub-' . $subname] = ['size' => 'poster'];
$res['subs']['sub-' . $subname][] = ['label' => $tvShow['data']['name'], 'type' => 'back'];
}
return $lastModified;
}
+
+ public function _poster($path)
+ {
+ if ($path === '') {
+ return '';
+ } else {
+ return cacheMedia('https://image.tmdb.org/t/p/w500' . $path);
+ }
+ }
}
class moviesLibrary extends mediaLibrary
public function shortcut($movie, $prefix, &$res)
{
$path = $this->_path($movie['path']);
- $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'srt' => hasSRT($path), 'path' => $path, 'poster' => cacheMedia('https://image.tmdb.org/t/p/w500' . $movie['data']['poster_path'])];
+ $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'srt' => hasSRT($path), 'path' => $path, 'poster' => $this->_poster($movie['data']['poster_path'])];
}
+
public function _orderMovies($a, $b)
{
return mb_strcasecmp($a['data']['title'], $b['data']['title']);
while True:
try:
- if p.waitForNotifications(30.0):
+ if p.waitForNotifications(0.2):
# handleNotification() was called
continue