]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Wed, 4 Nov 2020 08:11:34 +0000 (09:11 +0100)
committerVincent <vincent@enhydra.fr>
Wed, 4 Nov 2020 08:11:34 +0000 (09:11 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/shield.php

index 1425995454c5362c866350999bc8947786f47f70..534e5a2a6eb637f41e3beabeeaf983f85a37b545 100644 (file)
@@ -4,8 +4,6 @@
     <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/harmony.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/harmony.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1603958541180" duration="5032000" />
       <workItem from="1604042543878" duration="11137000" />
       <workItem from="1604152329376" duration="42646000" />
-      <workItem from="1604347943058" duration="9001000" />
-    </task>
-    <task id="LOCAL-00321" summary=".">
-      <created>1590317532388</created>
-      <option name="number" value="00321" />
-      <option name="presentableId" value="LOCAL-00321" />
-      <option name="project" value="LOCAL" />
-      <updated>1590317532388</updated>
+      <workItem from="1604347943058" duration="12037000" />
     </task>
     <task id="LOCAL-00322" summary=".">
       <created>1591437757807</created>
       <option name="project" value="LOCAL" />
       <updated>1604396748171</updated>
     </task>
-    <option name="localTasksCounter" value="370" />
+    <task id="LOCAL-00370" summary=".">
+      <created>1604414629025</created>
+      <option name="number" value="00370" />
+      <option name="presentableId" value="LOCAL-00370" />
+      <option name="project" value="LOCAL" />
+      <updated>1604414629025</updated>
+    </task>
+    <option name="localTasksCounter" value="371" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
     <state x="740" y="229" key="#com.jetbrains.php.refactoring.extractMethod.PhpExtractMethodDialog#function0/0.0.1707.920@0.0.1707.920" timestamp="1604146905948" />
-    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604396727202">
+    <state x="198" y="0" width="737" height="502" key="CommitChangelistDialog2" timestamp="1604414597831">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="132" y="0" width="737" height="502" key="CommitChangelistDialog2/0.0.1707.920@0.0.1707.920" timestamp="1604307637401" />
     <state x="701" y="75" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1602171117745" />
-    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604396727202" />
+    <state x="198" y="0" width="745" height="567" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1604414597831" />
     <state x="635" y="216" key="FileChooserDialogImpl" timestamp="1604227698339">
       <screen x="0" y="0" width="1707" height="920" />
     </state>
index 1e1f37ff4e53296ce7955e296c26e004f42da92e..929e9d6a96455b79d0c4bde83daeb2b7d8a0eac6 100644 (file)
@@ -16,6 +16,7 @@ function cronOneLoop($cronmin)
         cronTraffic($cronmin, false);
         cronVelib($cronmin);
         cronGuest($cronmin);
+        cronShield($cronmin);
     }
     if ($cronmin % 10 == 0) {
         cronSqueezeFavorites($cronmin);
@@ -55,6 +56,11 @@ function cronXPlanet($cronmin)
     `$suncurve;$earth`;
 }
 
+function cronShield($cronmin)
+{
+    shieldConnect(true);
+}
+
 function cronGuest($cronmin)
 {
 
index 5ecbffa7993b51d656476d480a44b8dc17e99faf..c771b32d96e85a119263efbcadf89b315110db56 100644 (file)
@@ -3,22 +3,22 @@ define('SHIELD_HOST', '192.168.13.40');
 
 $shieldConnect = false;
 
-function shieldConnect()
+function shieldConnect($force = false)
 {
     global $shieldConnect;
     $lastConnect = getState('shield_lastconnect', null);
     $limit = time() - 3600;
-    if (!$shieldConnect && ($lastConnect === null || $lastConnect < $limit)) {
-
+    if ($force || (!$shieldConnect && ($lastConnect === null || $lastConnect < $limit))) {
         $shieldConnect = true;
         _adb('connect', SHIELD_HOST);
         $lastConnect = getState('shield_lastconnect', time());
     }
 }
 
-function shieldRunActivity($device=null){
-    $device=getDevice($device);
-    if($device==='salon'){
+function shieldRunActivity($device = null)
+{
+    $device = getDevice($device);
+    if ($device['id'] === 'salon') {
         harmonyActivity('tv');
     }
 }
@@ -162,16 +162,18 @@ function shieldMyCanal($channel = false, $type = 'live', $device = null)
     } else if ($type === 'live') {
         $url = 'https://www.canalplus.com/live/?channel=' . $channel;
     }
+
     setPlaying('mycanal', $device);
+    shieldHome();
     _adb('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.app.common.legacy.DeepLinkActivity');
 }
 
-function shieldKodi($file,$device=null)
+function shieldKodi($file, $device = null)
 {
     shieldRunActivity($device);
     shieldHome();
-    $device=getDevice($device);
-    if($device==='salon'){
+    $device = getDevice($device);
+    if ($device === 'salon') {
         harmonyActivity('tv');
     }
     _adb('shell am start', '-a android.intent.action.VIEW  -d \'"' . shieldNormalizeURL($file) . '"\' -n org.xbmc.kodi/.Splash');