From: Vincent Date: Mon, 17 Feb 2020 10:13:33 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=31e9829a55245816f54aad7b316f23d8fbac6a87;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8f44d17..635fba0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,10 @@ - + + + + @@ -1219,12 +1225,12 @@ - + - + diff --git a/scripts/lib/ecomode.php b/scripts/lib/ecomode.php index 3836064..14a8ca5 100644 --- a/scripts/lib/ecomode.php +++ b/scripts/lib/ecomode.php @@ -30,6 +30,11 @@ function nightmode($mode) setState('night', (!!$mode) ? '1' : '0'); } +function getNightMode() +{ + return getState('night') == '1'; +} + function getEcoMode() { $res = getState('ecomode'); diff --git a/scripts/lib/medialibrary.php b/scripts/lib/medialibrary.php index 6f20fb8..e7bfc0b 100644 --- a/scripts/lib/medialibrary.php +++ b/scripts/lib/medialibrary.php @@ -134,15 +134,17 @@ function transcodeOneVideo() /** @var SplFileInfo $item */ $path = $item->getRealPath(); $to = preg_replace('/\.' . $item->getExtension() . '$/', '.x264.' . $item->getExtension(), $path); - if (file_exists($to) && videosHaveSameDuration($path, $to)) { + if (file_exists($to) && filesize($to) > 0 && videosHaveSameDuration($path, $to)) { continue; } set_time_limit(0); ignore_user_abort(true); - wakeupPC('avion'); - sleep(5); + if (!getNightMode()) { + wakeupPC('avion'); + sleep(15); + } $cmd = 'C:\Scripts\convertvideo.bat "' . nasToAvion($item) . '" "' . nasToAvion($to) . '" ' . $item->getExtension() . ' ' . getVideoCodec($path); print_r(sshCommand($cmd, 'avion')); diff --git a/scripts/lib/mediarasp.php b/scripts/lib/mediarasp.php index 5bcb376..fa0c5bc 100644 --- a/scripts/lib/mediarasp.php +++ b/scripts/lib/mediarasp.php @@ -294,7 +294,7 @@ function addSeen($movie) $cacheFile = ROOT . '/cache/seen.json'; if (!count($seen)) { - $seen = json_decode(file_get_contents($cacheFile)); + $seen = json_decode(file_get_contents($cacheFile),true); } $seen[str_replace('/nas/', '/volume1/Share/', $movie)] = true; diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index cb1eb49..6bff835 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -37,10 +37,10 @@ $scenes = [ ['type' => 'ifttt', 'event' => 'coffee_on'], ], 'chambre/deshumidificateur/on' => [ - ['type' => 'domoticz', 'device' => '1062', 'command' => true, 'priority' => true], + ['type' => 'domoticz', 'device' => '1062', 'command' => true], ], 'chambre/deshumidificateur/off' => [ - ['type' => 'domoticz', 'device' => '1062', 'command' => false, 'priority' => true], + ['type' => 'domoticz', 'device' => '1062', 'command' => false], ], 'chambre/raspberry/on' => [ ['type' => 'insteon', 'command' => '0?1138=I=0=0'],