From 679fe37bc297c1f73c07091a4d0a7e75d1740170 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 23 Aug 2019 11:10:35 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 23 +++++++++++------------ scripts/cron/cron.php | 5 ----- scripts/lib/tmdb.php | 4 ++-- scripts/sections.php | 9 ++++++++- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f5e4083..397d972 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,10 +3,9 @@ - + - - + diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index 21b93d4..21f4d51 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -2,11 +2,6 @@ require_once __DIR__ . "/../import.php"; -if (isset($_SERVER) && isset($_SERVER['HTTP_HOST'])) { - exit; - // cronOneLoop(0); -} - function cronOneLoop($cronmin) { set_time_limit(0); diff --git a/scripts/lib/tmdb.php b/scripts/lib/tmdb.php index 784b872..5be9dc9 100644 --- a/scripts/lib/tmdb.php +++ b/scripts/lib/tmdb.php @@ -238,7 +238,7 @@ class tvShowLibrary extends mediaLibrary if ($exists) { $path = $this->_path($exists); - $res['subs']['sub-' . $subname][] = ['label' => $es, 'type' => 'media', 'seen' => $this->_seen($path), 'path' => $path]; + $res['subs']['sub-' . $subname][] = ['label' => $es, 'type' => 'media', 'srt' => hasSRT($path), 'seen' => $this->_seen($path), 'path' => $path]; } else { $res['subs']['sub-' . $subname][] = ['label' => $es, 'type' => 'missing']; } @@ -443,7 +443,7 @@ class moviesLibrary extends mediaLibrary public function shortcut($movie, $prefix, &$res) { $path = $this->_path($movie['path']); - $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'path' => $path, 'poster' => cacheMedia('https://image.tmdb.org/t/p/w500' . $movie['data']['poster_path'])]; + $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'srt' => hasSRT($path), 'path' => $path, 'poster' => cacheMedia('https://image.tmdb.org/t/p/w500' . $movie['data']['poster_path'])]; } public function _orderMovies($a, $b) diff --git a/scripts/sections.php b/scripts/sections.php index 1a7746f..99f76ff 100644 --- a/scripts/sections.php +++ b/scripts/sections.php @@ -3,4 +3,11 @@ define('DISPLAYINTERFACE', false); require_once "import.php"; header('Content-type: application/json'); -echo connectRedis()->igbget('shortcuts.' . getCurrentConfig()); \ No newline at end of file +$key = 'shortcuts.' . getCurrentConfig(); +if (isset($_GET['force'])) { + connectRedis()->del($key); + require_once "cron/cron.php"; + cronMediaLibrary(0); + file_get_contents('https://' . getCurrentConfig() . '.home.tortuga.enhydra.fr'); +} +echo connectRedis()->igbget($key); \ No newline at end of file -- 2.39.5