]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sun, 1 Mar 2020 12:28:21 +0000 (13:28 +0100)
committerVincent <vincent@enhydra.fr>
Sun, 1 Mar 2020 12:28:21 +0000 (13:28 +0100)
.idea/workspace.xml
config/music.php
scripts/lib/lib.php
scripts/lib/scenes.php
scripts/lib/squeezebox.php
scripts/squeeze.php

index 6912b86cac9e97cd08a62a35ae81acb7b9bc5776..519cd5ea475a206fc728b97ac36f56be31d086ba 100644 (file)
@@ -3,10 +3,11 @@
   <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$/config/chambre.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/chambre.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/music.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/music.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/scripts/lib/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.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/weatherstation.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/weatherstation.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/squeeze.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/squeeze.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1582201880333" duration="3283000" />
       <workItem from="1582660044500" duration="814000" />
       <workItem from="1582796298540" duration="1959000" />
-      <workItem from="1582798438958" duration="112000" />
-    </task>
-    <task id="LOCAL-00258" summary=".">
-      <created>1577380602449</created>
-      <option name="number" value="00258" />
-      <option name="presentableId" value="LOCAL-00258" />
-      <option name="project" value="LOCAL" />
-      <updated>1577380602449</updated>
+      <workItem from="1582798438958" duration="2008000" />
+      <workItem from="1583062665588" duration="7000" />
+      <workItem from="1583062693000" duration="2011000" />
     </task>
     <task id="LOCAL-00259" summary=".">
       <created>1577381108669</created>
       <option name="project" value="LOCAL" />
       <updated>1582220578115</updated>
     </task>
-    <option name="localTasksCounter" value="307" />
+    <task id="LOCAL-00307" summary=".">
+      <created>1582798632124</created>
+      <option name="number" value="00307" />
+      <option name="presentableId" value="LOCAL-00307" />
+      <option name="project" value="LOCAL" />
+      <updated>1582798632124</updated>
+    </task>
+    <option name="localTasksCounter" value="308" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="1019" y="324" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1040@0.0.2560.1040" timestamp="1581415995312" />
-    <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1580459136096">
+    <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1583062669525">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="720" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577298128269" />
-    <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1580459136096" />
-    <state x="701" y="127" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1582220569877">
-      <screen x="0" y="0" width="1920" height="1160" />
+    <state x="960" y="247" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1583062669525" />
+    <state x="935" y="114" width="1170" height="972" key="CommitChangelistDialog2" timestamp="1583065678363">
+      <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="701" y="114" key="CommitChangelistDialog2/0.0.1920.1040@0.0.1920.1040" timestamp="1577381105204" />
     <state x="701" y="127" width="1170" height="972" key="CommitChangelistDialog2/0.0.1920.1160@0.0.1920.1160" timestamp="1582220569877" />
-    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1582104424372" />
+    <state x="935" y="114" key="CommitChangelistDialog2/0.0.2560.1040@0.0.2560.1040" timestamp="1583065678363" />
     <state x="92" y="92" width="2376" height="856" key="DiffContextDialog" timestamp="1580377344165">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     </state>
     <state x="836" y="443" key="NewPhpFileDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577363498855" />
     <state x="1114" y="443" key="NewPhpFileDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1578038647334" />
-    <state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1580377827629">
+    <state x="872" y="242" key="Vcs.Push.Dialog.v2" timestamp="1582798634411">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
-    <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1580377827629" />
-    <state x="976" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1582798439144">
+    <state x="872" y="242" key="Vcs.Push.Dialog.v2/0.0.2560.1040@0.0.2560.1040" timestamp="1582798634411" />
+    <state x="976" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1583063301397">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1577380394903" />
     <state x="732" y="383" key="com.intellij.ide.util.TipDialog/0.0.1920.1160@0.0.1920.1160" timestamp="1582201881167" />
-    <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1582798439144" />
-    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1582796777847">
+    <state x="976" y="343" key="com.intellij.ide.util.TipDialog/0.0.2560.1040@0.0.2560.1040" timestamp="1583063301397" />
+    <state x="977" y="257" width="607" height="536" key="find.popup" timestamp="1583064009120">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
     <state x="732" y="257" width="607" height="536" key="find.popup/0.0.1920.1040@0.0.1920.1040" timestamp="1577380471547" />
     <state x="733" y="287" width="607" height="598" key="find.popup/0.0.1920.1160@0.0.1920.1160" timestamp="1582125776502" />
-    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1582796777847" />
+    <state x="977" y="257" width="607" height="536" key="find.popup/0.0.2560.1040@0.0.2560.1040" timestamp="1583064009120" />
     <state x="936" y="240" key="run.anything.popup" timestamp="1578386519646">
       <screen x="0" y="0" width="2560" height="1040" />
     </state>
index 512f04d50be727dec44eb3fbf7a07e674e7e8ea7..03c2dd5c5bca95ba8ea55d6d1168fddff7bafc2b 100644 (file)
@@ -41,14 +41,17 @@ function squeezeSubitems($s, $key, $label, &$shortcuts)
             continue;
         } else {
             $e = explode('.', $subitem['id']);
-            array_shift($e);
+            $base = array_shift($e);
             $id = $subitem['id'];
             $type = 'squeeze';
             $commands = ['favorites playlist play item_id:' . $id, 'playlist repeat 2', 'playlist shuffle 1'];
-            if ($s['name'] == 'Ambiances') {
+            if ($s['name'] == 'Ambiances' || $base == 2) {
                 $type .= '_ambiance';
                 array_unshift($commands, 'sync -');
             }
+            if ($base == 1) {
+                $type .= '_spotify';
+            }
             $a = array('type' => $type, 'commands' => $commands, 'label' => $subitem['name']);
 
             $allmusics[$subitem['name']] = $a;
index a68538e353518bfe198375e02d19823d73cf6821..2575b07017e5c16a9bab7d1b25fe21c092468b03 100644 (file)
@@ -221,11 +221,11 @@ function shortcut($s, $hash)
         } else if (isset($s['tab']) && $s['tab']) {
             $attrs['target'] = '_blank';
         }
-    } else if ($s['type'] == 'squeeze') {
-        $attrs['href'] = 'scripts/squeeze.php?player=' . config('SQUEEZEBOX_PLAYER') . '&name=' . $s['label'];
+    } else if ($s['type'] == 'squeeze' || $s['type'] == 'squeeze_spotify') {
+        $attrs['href'] = 'scripts/squeeze.php?player=' . config('SQUEEZEBOX_PLAYER') . '&name=' . $s['label'] . '&type=' . $s['type'];
         $attrs['class'] = 'ajax music';
     } else if ($s['type'] == 'squeeze_ambiance') {
-        $attrs['href'] = 'scripts/squeeze.php?player=' . config('SQUEEZEBOX_AMBIANCE_PLAYER') . '&name=' . $s['label'];
+        $attrs['href'] = 'scripts/squeeze.php?player=' . config('SQUEEZEBOX_AMBIANCE_PLAYER') . '&name=' . $s['label'] . '&type=' . $s['type'];
         $attrs['class'] = 'ajax';
         $attrs['data-squeeze-volume'] = 60;
         $attrs['data-squeeze-player'] = config('SQUEEZEBOX_AMBIANCE_PLAYER');
index eb011a813929574c5955151868c71f2a871cf3e8..53305d7f099959bad5646ac2697bf1284967e4a7 100644 (file)
@@ -713,7 +713,7 @@ function wcOn($vmc = true)
     }
 }
 
-function planetarium($on)
+function planetarium($on)0
 {
     setState('planetarium', $on ? '1' : '0');
     checkPlanetarium(false);
index 4b1932e85f227c3bd8908995bfe9169ad1256c91..28987b450f8db6d07bd757cca026d1d44175fd26 100644 (file)
@@ -212,7 +212,7 @@ function getSqueezeFavorites($root = 0, $app = 'favorites', $level = 0)
     return $res;
 }
 
-function checkSpottyLogin()
+function checkSpottyLogin($force = false)
 {
     $spottybase = '/plugins/Spotty/settings/';
     $hascredentials = httpRequest(SQUEEZEBOX_SERVER . $spottybase . 'basic.html?_dc=' . time(), 'get', [], null, 10, false);
@@ -220,16 +220,20 @@ function checkSpottyLogin()
     $accounts = [
         //SQUEEZEBOX_SPOTIFY_USERNAME => SQUEEZEBOX_SPOTIFY_PASSWORD,
         'v12l' => 'Lr8ka&7cs@fc%lW7',
-        //'jrme75009' => 'tortuga5009',
+        'jrme75009' => 'tortuga5009',
     ];
 
-    $loggedIn = $hascredentials->getStatusCode() !== 302;
-    if ($loggedIn) {
-        $resp = $hascredentials->getBody();
-        foreach ($accounts as $user => $password) {
-            if (!stristr($resp, $user)) {
-                $loggedIn = false;
-                break;
+    if ($force) {
+        $loggedIn = false;
+    } else {
+        $loggedIn = $hascredentials->getStatusCode() !== 302;
+        if ($loggedIn) {
+            $resp = $hascredentials->getBody();
+            foreach ($accounts as $user => $password) {
+                if (!stristr($resp, $user)) {
+                    $loggedIn = false;
+                    break;
+                }
             }
         }
     }
index 897941e5b44251516ee886e1c20bd8cd8ed66c1e..5629c10d1cf24b11768aa0668a1da1783fa4d5a3 100644 (file)
@@ -22,6 +22,10 @@ if (!in_array('stop', $requests) || isset($_GET['name'])) {
     }
 }
 
+if (isset($_GET['type']) && $_GET['type'] == 'squeeze_spotify') {
+    checkSpottyLogin(true);
+}
+
 if (isset($_GET['name'])) {
     echo $_GET['name'];
     squeezePlayByName($_GET['name'], $_GET['player']);