]> _ Git - tortuga-home.git/commitdiff
.
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Mar 2026 10:57:13 +0000 (11:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Mar 2026 10:57:13 +0000 (11:57 +0100)
.idea/workspace.xml
scripts/cron/cron.php
scripts/lib/lib.php
scripts/lib/mediarasp.php [deleted file]
scripts/lib/remoteinfos.php
scripts/lib/shield.php
scripts/shield.php
scripts/syno.php [deleted file]
scripts/tmdb.php [deleted file]
scripts/transcode.php [deleted file]

index 3d3a1449eb2a8957055d9f73b866f51aa4870a40..299110e1119dc24e09e83b5a759fdb524fc014f0 100644 (file)
@@ -6,8 +6,15 @@
   <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$/style/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.css" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/style/style.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.less" 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/lib.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/lib.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/mediarasp.php" beforeDir="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/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/shield.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/shield.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/shield.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/syno.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/tmdb.php" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/transcode.php" beforeDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
       <workItem from="1772370387714" duration="7090000" />
       <workItem from="1773390371781" duration="506000" />
       <workItem from="1774028822942" duration="792000" />
-      <workItem from="1774430967346" duration="4616000" />
+      <workItem from="1774430967346" duration="5035000" />
     </task>
     <task id="LOCAL-00502" summary=".">
       <created>1641726946298</created>
       <option name="project" value="LOCAL" />
       <updated>1687259667913</updated>
     </task>
-    <option name="localTasksCounter" value="637" />
+    <option name="localTasksCounter" value="638" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
       <breakpoints>
         <line-breakpoint enabled="true" type="php">
           <url>file://$PROJECT_DIR$/scripts/cron/cron.php</url>
-          <line>207</line>
+          <line>162</line>
           <option name="timeStamp" value="1" />
         </line-breakpoint>
       </breakpoints>
index 92f1315464520706a94357c9694e1cc4342900b4..493e98fd4fdb189a427cb11a19b7dc6828cec396 100644 (file)
@@ -16,8 +16,6 @@ function cronOneLoop($cronmin) {
     }
     if ($cronmin % 15 == 0) {
         cronPodcasts($cronmin);
-        cronMediaLibrary($cronmin);
-        cronTmdb($cronmin);
     }
 
        if ($cronmin % 5 == 0) {
@@ -26,7 +24,6 @@ function cronOneLoop($cronmin) {
        }
 
        if ($cronmin % 20 == 0) {
-               cronBackyard($cronmin);
                cronSqueezeCheckPlayers($cronmin);
        }
 
@@ -38,19 +35,10 @@ function cronOneLoop($cronmin) {
        cronInterface($cronmin);
 
        cronEcoMode($cronmin);
-       if ($cronmin % 15 == 0) {
-               cronKodi($cronmin);
-       }
        cronHeartbeat($cronmin, true);
        _logSection('End Loop (min:' . $cronmin . ')');
 }
 
-
-function cronBackyard($cronmin)
-{
-    _logSection('Backyard');
-}
-
 function cronShield($cronmin) {
        _logSection('Shield');
        `/usr/local/bin/adb-connect`;
@@ -97,38 +85,6 @@ function cronRooms($cronmin) {
        }
 }
 
-function cronMediaLibrary($cronmin) {
-       global $directories;
-       _logSection('Media Library');
-
-       $media = array();
-       $shareroot = '/volume1/Share';
-
-
-       foreach ($directories as $name => $directory) {
-               $dir = $shareroot . '/Videos/' . $directory['dir'];
-               if ($directory['context'] == 'tvshow' || $name == 'Films') {
-                       continue;
-               }
-               $media[$directory['id']] = array('name' => $name, 'items' => getMediaContents($dir, $directory['context']));
-       }
-
-       connectRedis()->igbset('medialibrary', $media);
-
-       _getTVShows(true);
-       _getMovies(true);
-       _getMediaRecentAdded(true);
-}
-
-
-function cronTmdb($cronmin) {
-       _logSection('TMDB');
-       _getTVShows(true, false);
-       _getMovies(true, false);
-       _getMediaRecentAdded(true);
-       parseMoviesLibrary();
-}
-
 function cronPing($cronmin) {
        _logSection('Pings');
        global $devices;
@@ -165,7 +121,6 @@ function cronWeather($cronmin) {
        getWeather();
 }
 
-
 function cronPodcasts($cronmin) {
        checkSpottyLogin();
        return;
@@ -206,9 +161,4 @@ function cronHeartbeat($cronmin, $devices = false) {
                return;
        }
        restartDeadDevices();
-}
-
-function cronKodi($cronmin) {
-       _logSection('Kodi');
-       kodiSyncPlayedStatus();
 }
\ No newline at end of file
index 9145f6470e23dff51079ecd4d233b42849c67b1b..1982403f0f3786cc0761d29ba0be9335025186e8 100644 (file)
@@ -411,16 +411,6 @@ function getJsonRPCClientInstance($url)
     return $rpcclient;
 }
 
-function getSynologyInstance()
-{
-    global $syno;
-    if (!isset($syno)) {
-        $syno = new Synology_Api('192.168.13.3', 5002, 'https', 1);
-        $syno->connect('Vincent', 'xxxx');
-    }
-    return $syno;
-}
-
 function hasNetwork()
 {
     return true;
diff --git a/scripts/lib/mediarasp.php b/scripts/lib/mediarasp.php
deleted file mode 100644 (file)
index 3a07112..0000000
+++ /dev/null
@@ -1,508 +0,0 @@
-<?php
-
-$mediaraspclient = null;
-
-function _remoteCmd($cmd, $device)
-{
-    if (!remoteCmd($cmd, $device)) {
-        if ($device == 'bureau') {
-            echo 'run ' . $cmd . ' with harmony';
-            harmonyRequest('commands/' . $cmd, 'POST');
-        } else {
-            echo 'ok';
-        }
-    }
-}
-
-function remoteCmd($cmd, $device)
-{
-    $cmd = mb_strtolower($cmd);
-    if (strpos($cmd, 'key_') === 0) {
-        $e = explode('key_', $cmd, 2);
-        $cmd = $e[1];
-    }
-
-    if ($cmd == 'volume-up') {
-        volume(config('VOLUME_STEP'), '+');
-        return true;
-    } elseif ($cmd == 'volume-down') {
-        volume(config('VOLUME_STEP'), '-');
-        return true;
-    }
-
-    if ($cmd == 'light-up') {
-        if ($device == 'salon') {
-            execScene('salon/on');
-        } else if ($device == 'bureau') {
-            execScene('bureau/auto');
-        }
-        return;
-    } else if ($cmd == 'light-down') {
-        if ($device == 'salon') {
-            execScene('salon/cinema');
-        } else if ($device == 'bureau') {
-            execScene('bureau/cinema');
-        }
-        return;
-    }
-
-    $playing = getPlaying($device);
-    $e = explode(':', $playing);
-    $p = $e[0];
-    if ($p == 'squeezebox') {
-        $player = config('SQUEEZEBOX_PLAYER');
-        remoteCmdSqueezebox($cmd, $player);
-        return true;
-    }
-
-    if ((($p === 'netflix' || $p === 'tv' || $p==='amazonprime') && config('TVPLAYER') === 'shield') || config('VIDEOPLAYER') === 'shield') {
-        return shieldRemoteCommand($cmd, $device);
-    } else if ($device == 'bureau') {
-        switch (getCurrentHarmonyActivity()) {
-            case HARMONY_MUSIQUE:
-                return remoteCmdSalonMusique($cmd);
-            case HARMONY_TV:
-                return remoteCmdSalonTV($cmd);
-        }
-        return false;
-    } else {
-        return remoteCmdMedia($cmd, $device, $p);
-    }
-    return false;
-}
-
-function remoteCmdSqueezebox($cmd, $player)
-{
-    $map = ['forward' => ['button', 'jump_fwd'], 'fast-forward' => ['button', 'jump_fwd'], 'fast-rewind' => ['button', 'jump_rew'], 'rewind' => ['button', 'jump_rew'], 'play' => ['pause'], 'pause' => ['pause'], 'stop' => 'stop'];
-    if (isset($map[$cmd])) {
-        squeezeRequest($map[$cmd], $player);
-    }
-}
-
-function remoteCmdSalonTV($cmd)
-{
-    $map = ['play' => 'play',
-        'pause' => 'play',
-        'channel-up' => 'prgm_inc',
-        'channel-down' => 'prgm_dec',
-        'channelup' => 'prgm_inc',
-        'channeldown' => 'prgm_dec',
-        'up' => 'up',
-        'left' => 'left',
-        'right' => 'right',
-        'down' => 'down',
-        'ok' => 'ok',
-        'prev-channel' => 'red',
-        'tv' => 'home',
-        'media' => 'red',
-        //'mute'=>'',
-        'direction-left' => 'left',
-        'direction-right' => 'right',
-        'direction-up' => 'up',
-        'direction-down' => 'down',
-        'select' => 'ok',
-        //'volume-down'=>''  ,
-        //'volume-up'=>'',
-        'blue' => 'blue',
-        'yellow' => 'yellow',
-        'red' => 'red',
-        'green' => 'green',
-        'guide' => 'media',
-        'epg' => 'epg',
-        'info' => 'yellow',
-        'menu' => 'home',
-        'exit' => 'red',
-        'esc' => 'red',
-        'stop' => 'stop',
-        'forward' => 'fwd',
-        'fast-forward' => 'fwd',
-        'record' => 'rec',
-        'fast-rewind' => 'bwd',
-        'rewind' => 'bwd',
-        'next' => 'next',
-        'prev' => 'prev',
-        'numeric_0' => '0',
-        'numeric_1' => '1',
-        'numeric_2' => '2',
-        'numeric_3' => '3',
-        'numeric_4' => '4',
-        'numeric_5' => '5',
-        'numeric_6' => '6',
-        'numeric_7' => '7',
-        'numeric_8' => '8',
-        'numeric_9' => '9',
-    ];
-
-    if (isset($map[$cmd])) {
-        freeboxKey([$map[$cmd]]);
-        return true;
-    }
-    return false;
-}
-
-function remoteCmdMedia($cmd, $device = null, $playing = null)
-{
-    if (null === $device) {
-        $device = config('DEVICE');
-    }
-
-    profile('remote cmd ' . $cmd . ' on ' . $device);
-
-    $map = ['play' => 'pl_pause',
-        'pause' => 'pl_pause',
-        'stop' => 'pl_stop',
-        'exit' => 'pl_stop',
-        'title' => 'm',
-        'rewind' => 'rewind',
-        'forward' => 'forward',
-        'fast-rewind' => 'fast-rewind',
-        'fast-forward' => 'fast-forward',
-        'info' => 'z',
-        'direction-left' => 'down',
-        'direction-right' => 'up',
-        'subtitles-toggle' => 'subtitles-toggle',
-        'subtitles-stream-next' => 'subtitles-stream-next',
-        'subtitles-stream-prev' => 'subtitles-stream-prev',
-        'subtitles-increase-delay' => 'subtitles-increase-delay',
-        'subtitles-increase-delay-long' => 'subtitles-increase-delay-long',
-        'subtitles-decrease-delay' => 'subtitles-decrease-delay',
-        'subtitles-decrease-delay-long' => 'subtitles-decrease-delay-long',
-        'audio-track-next' => 'audio-track-next',
-    ];
-
-
-    if ($device == 'bureau') {
-        $map['volume-up'] = '+';
-        $map['volume-down'] = '-';
-        $map['mute'] = '-';
-    }
-
-    if (!isset($map[$cmd])) {
-        return false;
-    }
-
-    $key = $map[$cmd];
-
-
-    if (null === $playing || $playing == 'mediarasp') {
-        if ($key == 'subtitles-toggle') {
-            sendHotKey('shift+v');
-        } else if ($key == 'subtitles-stream-next') {
-            sendHotKey('v');
-        } else if ($key == 'subtitles-stream-prev') {
-            sendHotKey('alt+v');
-        } else if ($key == 'subtitles-increase-delay') {
-            sendHotKey('h', 5);
-        } else if ($key == 'subtitles-decrease-delay') {
-            sendHotKey('g', 5);
-        } else if ($key == 'subtitles-increase-delay-long') {
-            sendHotKey('h', 40);
-        } else if ($key == 'subtitles-decrease-delay-long') {
-            sendHotKey('g', 40);
-        } else if ($key == 'audio-track-next') {
-            sendHotKey('b');
-        } else if ($key == 'rewind' || $key == 'fast-rewind' || $key == 'forward' || $key == 'fast-forward') {
-            if ($key == 'rewind' || $key == 'forward') {
-                $amount = 15;
-            } else if ($key == 'fast-rewind' || $key == 'fast-forward') {
-                $amount = 300;
-            }
-            if ($key == 'rewind' || $key == 'fast-rewind') {
-                $way = '-';
-            } else if ($key == 'forward' || $key == 'fast-forward') {
-                $way = '+';
-            }
-            $res = VLCCmd(['command' => 'seek', 'val' => $way . $amount . 's'], $device);
-        } else {
-            $params = ['command' => $key];
-            $res = VLCCmd($params, $device);
-        }
-        echo $res;
-    }
-
-    return true;
-}
-
-function sendHotKey($key, $times = 1, $device = null)
-{
-    $keys = str_repeat(' key ' . $key, $times);
-    return sshCommand('DISPLAY=:0 xdotool getactivewindow' . $keys, $device, true, false);
-}
-
-function moveVLC($fullscreen = true, $device = null)
-{
-    if ($fullscreen) {
-        $e = '0,0,800,480';
-    } else {
-        $e = '163,128,414,224';
-    }
-    return sshCommand('DISPLAY=:0 wmctrl -r "VLC" -e 0,' . $e . ';DISPLAY=:0 wmctrl -i -r "VLC" -b add,above;DISPLAY=:0 /usr/local/bin/removeallborders', $device, true, false);
-}
-
-function remoteCmdSalonMusique($cmd)
-{
-    switch ($cmd) {
-        case 'PLAY':
-        case 'PAUSE':
-
-            break;
-    }
-    return false;
-}
-
-function mediaRaspPlayMovie($movie, $device = null)
-{
-    setPlaying('mediarasp:' . $movie, $device);
-
-    profile('mediaRaspPlayMovie ' . $movie, __FILE__, __LINE__);
-
-    $m = explode('.', $movie);
-    $ext = array_pop($m);
-    $x264 = false;
-    if ($m[count($m) - 1] == 'x264') {
-        array_pop($m);
-        $x264 = true;
-    }
-    $base = implode('.', $m);
-
-    addSeen($movie);
-    $res = VLCPlay($movie, $device);
-
-    setPlaying('mediarasp:' . $movie, $device);
-    return $res;
-}
-
-function addSeen($movie)
-{
-    $redis = connectRedis();
-
-    try {
-        $seen = $redis->igbget('mediaseen');
-    } catch (Exception $e) {
-        $seen = [];
-    }
-
-    if (!is_array($seen)) {
-        $seen = [];
-    }
-
-    $cacheFile = ROOT . '/cache/seen.json';
-    if (!count($seen)) {
-        $seen = json_decode(file_get_contents($cacheFile), true);
-    }
-
-    $seen[str_replace('/nas/', '/volume1/Share/', $movie)] = true;
-    $redis->igbset('mediaseen', $seen);
-
-    file_put_contents($cacheFile, json_encode($seen));
-}
-
-function mediaRaspCommons($device)
-{
-    global $squeezeboxPlayers;
-    if ($device == 'salon') {
-        stopSqueezebox('Salon');
-    } else if ($device == 'bureau') {
-        if (getState('bureauPlaying', '0') === '0') {
-            execScene('bureau/media/play');
-        }
-        stopSqueezebox($squeezeboxPlayers['Bureau']);
-        if (!isAlive('bureau')) {
-            sleep(60);
-        }
-    } else if ($device == 'sdb') {
-        execScene('sdb/ampli/on');
-    }
-}
-
-function mediaRaspPlayStream($url, $device = null)
-{
-    setPlaying('mediarasp:' . $url, $device);
-    mediaRaspCommons($device);
-    $res = VLCPlay($url, $device);
-    setPlaying('mediarasp:' . $url, $device);
-    mediaRaspCommons($device);
-    return $res;
-}
-
-function mediaRaspPlayCast($castURL, $device = null)
-{
-    if (null === $device) {
-        $device = config('DEVICE');
-    }
-    if ($device === 'bureau') {
-        $height = 720;
-    } else if ($device === 'salon') {
-        $height = 1080;
-    } else {
-        $height = 640;
-    }
-
-    setPlaying('mediarasp:cast:' . $castURL);
-    mediaRaspCommons($device);
-    $dest = downloadYoutubeDL($castURL, $height, true, 'mkv');
-    getYoutubeDLMeta($castURL);
-    $res = VLCPlay($dest, $device);
-    setPlaying('mediarasp:cast:' . $castURL);
-    return $res;
-}
-
-function getYoutubeDLCastURL($url, $height = 1080)
-{
-    $h = '';
-    if ($height != 0) {
-        $h = '[height<=' . $height . ']';
-    }
-    $cmd = "/usr/local/bin/youtube-dl -f 'best$h' --get-url '$url'";
-    $res = `$cmd`;
-    echo $res;
-    return trim($res);
-}
-
-function getYoutubeDLPath($url, $h = 0, $ext = 'mkv')
-{
-    $hash = $url;
-    if ($h != 0) {
-        $hash .= '--' . $h . '++';
-    }
-    $hash = sha1($hash);
-    return "/nas/Videos/YoutubeDL/" . $hash . '.' . $ext;
-}
-
-function downloadYoutubeDL($url, $height = 1080, $cast = true, $ext = 'mkv')
-{
-    $dest = getYoutubeDLPath($url, $height, $ext);
-    $wip = $dest . '.wip';
-    if (!file_exists($dest)) {
-        if (!file_exists($wip)) {
-            $convert = 'https://' . $_SERVER['HTTP_HOST'] . '/scripts/youtubedl-download.php';
-            try {
-                httpRequest($convert, 'get', ['url' => $url, 'h' => $height, 'ext' => $ext], null, $cast ? 1 : 0);
-            } catch (Exception $e) {
-
-            }
-            if (!$cast) {
-                return $dest;
-            }
-        }
-        if ($cast) {
-            return getYoutubeDLCastURL($url, $height);
-        }
-    } else {
-        return $dest;
-    }
-}
-
-function getYoutubeDLMeta($url, $isHash = false)
-{
-    if (!$isHash) {
-        $hash = sha1($url);
-    } else {
-        $hash = $url;
-    }
-    $meta = connectRedis()->igbget('youtubedl.' . $hash);
-
-    if ($meta === false && !$isHash) {
-        $locale = 'en_US.UTF8';
-        setlocale(LC_ALL, $locale);
-        putenv('LC_ALL=' . $locale);
-        $res = `LC_ALL=$locale;/usr/local/bin/youtube-dl --no-warnings -e --get-thumbnail --get-duration $url`;
-        $lines = explode("\n", $res, 3);
-
-        // Duration
-        $d = explode(':', trim($lines[2]));
-        $d = array_reverse($d);
-        $duration = 0;
-        $m = 1;
-        foreach ($d as $item) {
-            $duration += $item * $m;
-            $m *= 60;
-        }
-
-        $meta = ['title' => trim($lines[0]), 'thumbnail' => trim($lines[1]), 'duration' => $duration];
-        connectRedis()->igbset('youtubedl.' . $hash, $meta);
-    }
-    return $meta;
-}
-
-function cleanUpSubtitle($srtcontent)
-{
-    // Convert to UTF-8
-    $srtenc = mb_detect_encoding($srtcontent, 'UTF-8, ISO-8859-1');
-    if ($srtenc !== 'UTF-8') {
-        $srtcontent = mb_convert_encoding($srtcontent, 'UTF-8', $srtenc);
-
-    }
-    // Remove tags
-    $srtcontent = preg_replace('/\{\\\\[^}]+\}/m', '', $srtcontent);
-
-    // Fix oe
-    $srtcontent = str_replace('\9c', 'oe', $srtcontent);
-
-
-    return $srtcontent;
-}
-
-/**
- * @return \GuzzleHttp\Client
- */
-function getMediaRaspClient()
-{
-    global $mediaraspclient;
-
-    if ($mediaraspclient == null) {
-        $mediaraspclient = getHttpClient();
-    }
-    return $mediaraspclient;
-}
-
-function getDevice($device = null)
-{
-    global $devices;
-    if (is_array($device) && isset($device['host'])) {
-        return $device;
-    }
-    if (null === $device) {
-        $device = config('DEVICE');
-    }
-    return $devices[$device];
-}
-
-function VLCCmd($params, $device = null, $timeout = 5)
-{
-    $d = getDevice($device);
-    if (isset($params['query'])) {
-        $query = $params['query'];
-        unset($params['query']);
-    } else {
-        $query = 'requests/status.xml';
-    }
-    $url = 'http://' . $d['host'] . ':8754/' . $query;
-    $client = getMediaRaspClient();
-    try {
-        $response = $client->get($url, ['query' => $params, 'timeout' => $timeout, 'auth' => ['', 'atacama']]);
-        return $response->getBody();
-    } catch (Exception $e) {
-        echo $d['host'] . print_r($params) . ':' . $e->getMessage();
-        return false;
-    }
-}
-
-function VLCPlay($fileorstream, $device = null, $timeout = 5)
-{
-    $device = getDevice($device);
-    if (config('VIDEOPLAYER') === 'shield') {
-        return shieldKodi($fileorstream);
-    } else {
-        VLCCmd(['command' => 'pl_empty'], $device, $timeout);
-        if (file_exists($fileorstream)) {
-            $fileorstream = 'file://' . $fileorstream;
-        }
-        echo $fileorstream;
-        if ($device === 'bureau') {
-            sshCommand('/usr/local/bin/soundtohdmi', $device, true, true);
-        }
-        return VLCCmd(['command' => 'in_play', 'input' => $fileorstream], $device, $timeout);
-    }
-}
-
index e0906127075a31a07440c67b7c5cf4e9b326dc4e..a50a57bc8b4bcbc0b43376c1c913c364ce19eb2d 100644 (file)
@@ -6,7 +6,7 @@ function remoteInfos()
     $p = $e[0];
 
     if (config('TVPLAYER') === 'shield') {
-        $visualApps = ['arte', 'francetv', 'mycanal', 'youtube', 'dailymotion', 'vimeo', 'kodi', 'vlc'];
+        $visualApps = ['arte', 'francetv', 'mycanal', 'youtube', 'dailymotion', 'vimeo'];
         if (in_array(shieldGetCurrentApp(), $visualApps)) {
             if ($p === 'squeezebox') {
                 setPlaying('shield');
@@ -18,36 +18,7 @@ function remoteInfos()
         $res = squeezeboxRemoteInfos();
     } else {
         if (config('TVPLAYER') === 'shield') {
-            if (shieldGetCurrentApp() === 'kodi') {
-                $res = ['type' => 'shieldmedia', 'can_seek' => true];
-                while (true) {
-                    try {
-                        $req = httpRequest('http://' . getDevice()['shield'] . ':8754/jsonrpc?Base=1', 'post', '[{"jsonrpc":"2.0","method":"Player.GetProperties","params":[1,["playlistid","speed","position","totaltime","time","percentage","shuffled","repeat","canrepeat","canshuffle","canseek","partymode"]],"id":1},{"jsonrpc":"2.0","method":"Player.GetItem","params":[1,["title","thumbnail","file","artist","genre","year","rating","album","track","duration","playcount","dateadded","episode","artistid","albumid","tvshowid","fanart"]],"id":2}]', ['kodi', 'atacama'], 10, true, ['X-Requested-With' => 'XMLHttpRequest', 'Content-type' => 'application/json']);
-                        break;
-                    } catch (Exception $e) {
-
-                    }
-                    sleep(2);
-                }
-                $p = json_decode($req->getBody(), true);
-                $res['duration'] = '';
-                $res['time'] = '';
-                $res['title'] = '';
-                $res['artwork'] = '';
-                $res['status'] = json_encode($p);
-                if (isset($p[0]['result'])) {
-                    $r = $p[0]['result'];
-                    $res['can_seek'] = $r['canseek'];
-                    $res['duration'] = 3600 * $r['totaltime']['hours'] + 60 * $r['totaltime']['minutes'] + $r['totaltime']['seconds'];
-                    $res['time'] = 3600 * $r['time']['hours'] + 60 * $r['time']['minutes'] + $r['time']['seconds'];
-                }
-                if (isset($p[1]['result']['item']['file'])) {
-                    $res = array_merge($res, getTitleAndArtwork($p[1]['result']['item']['file']));
-                }
-            } else {
                 $res = ['type' => 'shield', 'can_seek' => false];
-            }
-
         } else {
             if (($p === 'netflix' || $p === 'tv' || $p==='amazonprime') && config('TVPLAYER') === 'shield') {
                 $res = ['type' => 'shield', 'can_seek' => false];
@@ -84,9 +55,6 @@ function remoteInfos()
 function remoteProgress($progress)
 {
     if (config('TVPLAYER') === 'shield') {
-        if (shieldGetCurrentApp() === 'kodi') {
-            $p = json_decode(httpRequest('http://' . getDevice()['shield'] . ':8754/jsonrpc', 'post', '[{"jsonrpc":"2.0","method":"Player.Seek","params":[1,' . (round($progress * 100)) . '],"id":3}]', ['kodi', 'atacama'], 10, true, ['X-Requested-With' => 'XMLHttpRequest', 'Content-type' => 'application/json'])->getBody(), true);
-        }
         return;
     }
 
index f713491d7221c88f54f18f89e5509582f8f57868..f92ccbb61cbbd6fb60f80f28a031102e24914a61 100644 (file)
@@ -250,14 +250,6 @@ function shieldMyCanal($channel = false, $type = 'live', $device = null)
     return shieldCommand('shell am start', '-a android.intent.action.VIEW -f 0x10808000 -d ' . $url . ' com.canal.android.canal/com.canal.mycanal.legacy.DeepLinkActivity', $device);
 }
 
-function shieldKodi($file, $device = null)
-{
-    $url = shieldNormalizeURL($file);
-    profile('shield kodi ' . $file . '//' . $url, __FILE__, __LINE__);
-    shieldRunActivity($device);
-    shieldHome($device);
-    shieldCommand('shell am start', '-a android.intent.action.VIEW  -d \'"' . $url . '"\' -n org.xbmc.kodi/.Splash', $device);
-}
 
 function shielOqee($channel, $device = null)
 {
@@ -309,8 +301,7 @@ function shieldGetAppId($id = null)
 
 function shieldGetApps()
 {
-    return ['kodi' => 'org.xbmc.kodi',
-        'vlc' => 'org.videolan.vlc',
+    return [
         'netflix' => 'com.netflix.ninja',
         'mycanal' => 'com.canal.android.canal',
         'arte' => 'tv.arte.plus7',
@@ -335,7 +326,7 @@ function shieldGetApps()
 
 function shieldPlayingVideo($device = null)
 {
-    $videoApps = ['kodi', 'vlc', 'mycanal', 'amazonprime', 'netflix', 'arte', 'francetv', 'gamecast', 'twitch', 'youtube', 'dailymotion', 'vimeo', 'steamlink', 'plex'];
+    $videoApps = ['mycanal', 'amazonprime', 'netflix', 'arte', 'francetv', 'gamecast', 'twitch', 'youtube', 'dailymotion', 'vimeo', 'steamlink', 'plex'];
     return in_array(shieldGetCurrentApp($device), $videoApps);
 }
 
index 651aa59ea0aabe2511c4aab20465c6b43bd0dd6c..b2609f930915a33c36d67664fa0b98d7907d3482 100644 (file)
@@ -20,8 +20,6 @@ if (isset($_GET['key'])) {
     shieldFindIntents($_GET['intents'], $device);
 } else if (isset($_GET['vlc'])) {
     shieldVLC($_GET['vlc'], $device);
-} else if (isset($_GET['kodi'])) {
-    shieldKodi($_GET['kodi'], $device);
 } else if (isset($_GET['mycanal'])) {
     $e = explode(':', $_GET['mycanal']);
     echo shieldMyCanal($e[1], $e[0], $device);
diff --git a/scripts/syno.php b/scripts/syno.php
deleted file mode 100644 (file)
index bb80f29..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-require_once 'import.php';
-
-$syno = getSynologyInstance();
-print_r($syno->getAvailableApi());
-exit;
\ No newline at end of file
diff --git a/scripts/tmdb.php b/scripts/tmdb.php
deleted file mode 100644 (file)
index 24e8dcc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-ob_start();
-require_once 'import.php';
-set_time_limit(120);
-kodiGetTVShowAllStatus(true);
-kodiGetAllKodiToTmdb(true);
-_getTVShows(true, false);
-_getMovies(true, false);
-_getMediaRecentAdded(true);
-parseMoviesLibrary();
-connectRedis()->del(['shortcuts.' . getCurrentConfig()]);
-ob_end_clean();
-header('Location: /#/section/home');
\ No newline at end of file
diff --git a/scripts/transcode.php b/scripts/transcode.php
deleted file mode 100644 (file)
index 1f958ed..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-require_once 'import.php';
-
-transcodeOneVideo();
\ No newline at end of file