]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sat, 14 Sep 2019 17:05:08 +0000 (19:05 +0200)
committerVincent <vincent@enhydra.fr>
Sat, 14 Sep 2019 17:05:08 +0000 (19:05 +0200)
.idea/workspace.xml
manifest.php
scripts/share.php

index a0aef0c5e5885ca206aeb8cc505c5cdfa65226df..e5362d303936fa352f4f151fe018c10c305c13f6 100644 (file)
@@ -3,7 +3,8 @@
   <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/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/manifest.php" beforeDir="false" afterPath="$PROJECT_DIR$/manifest.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/share.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/share.php" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
       <workItem from="1567626187111" duration="1366000" />
       <workItem from="1567667112123" duration="599000" />
       <workItem from="1567671316880" duration="567000" />
-      <workItem from="1567931729831" duration="2306000" />
-    </task>
-    <task id="LOCAL-00179" summary=".">
-      <created>1551305163964</created>
-      <option name="number" value="00179" />
-      <option name="presentableId" value="LOCAL-00179" />
-      <option name="project" value="LOCAL" />
-      <updated>1551305163965</updated>
+      <workItem from="1567931729831" duration="4114000" />
+      <workItem from="1568479123874" duration="780000" />
+      <workItem from="1568479919445" duration="717000" />
     </task>
     <task id="LOCAL-00180" summary=".">
       <created>1551342569092</created>
       <option name="project" value="LOCAL" />
       <updated>1567940163895</updated>
     </task>
-    <option name="localTasksCounter" value="228" />
+    <task id="LOCAL-00228" summary=".">
+      <created>1567958159737</created>
+      <option name="number" value="00228" />
+      <option name="presentableId" value="LOCAL-00228" />
+      <option name="project" value="LOCAL" />
+      <updated>1567958159737</updated>
+    </task>
+    <option name="localTasksCounter" value="229" />
     <servers />
   </component>
   <component name="TodoView">
index 25d72cdc33371c7e1bd85e4a646976086be65107..fbd1eb7ab5a51c534a57432ad9f23b672bdc5b2d 100644 (file)
@@ -12,7 +12,7 @@ $manifest = [
     'scope' => '/',
     'icons' => [],
     'share_target' => [
-        'action' => '/scripts/share.php',
+        'action' => 'https://' . $_SERVER['HTTP_HOST'] . '/scripts/share.php',
         'method' => 'POST',
         'enctype' => 'application/x-www-form-urlencoded',
         'params' => [
index 56a807266ff07029ef20c879f1ba7309180c971b..2ad2b083199fc0c81dc1298ef3a8f24514666fb5 100644 (file)
@@ -2,7 +2,6 @@
 require_once "import.php";
 shareIntent($_REQUEST['text']);
 
-
 function shareIntent($content, $device = null)
 {
     $hasScreen = ['bureau', 'salon', 'sdb', 'litvincent', 'litjerome'];
@@ -13,17 +12,23 @@ function shareIntent($content, $device = null)
     if (strpos($content, 'http') === 0) {
         $u = parse_url($content);
         if ($u['host'] == 'open.spotify.com') {
+            if ($device == 'salon') {
+                harmonyActivity('musique-radio');
+            }
             $p = explode('/', trim($u['path'], '/'));
             $spotify = 'spotify:' . implode(':', $p);
-            $commands = ['playlist clear', 'playlist play ' . $spotify, 'playlist repeat 2', 'playlist shuffle 0'];
+            $commands = ['playlist clear', 'playlist play ' . $spotify, 'playlist repeat 0'];
             foreach ($commands as $command) {
-                squeezeRequest($command);
+                squeezeRequest($command, config('SQUEEZEBOX_PLAYER'));
             }
-            setPlaying('squeezebox');
+            setPlaying('squeezebox', $device);
+            $sleep = 1;
         } else if (in_array($device, $hasScreen)) {
+            $sleep = 5;
             mediaRaspPlayCast($content, $device);
         }
-        sleep(5);
+        sleep($sleep);
+
         header('Location: /#/section/remote');
         exit;
     }