diff --git a/fuel/app/classes/model/movie.php b/fuel/app/classes/model/movie.php index cdaef34..41ec472 100644 --- a/fuel/app/classes/model/movie.php +++ b/fuel/app/classes/model/movie.php @@ -8,6 +8,7 @@ use Fuel\Core\Cache; use Fuel\Core\CacheNotFoundException; use Fuel\Core\Database_Query_Builder_Select; use Fuel\Core\FuelException; +use Fuel\Core\RequestStatusException; class Model_Movie extends Model_Overwrite { @@ -48,7 +49,7 @@ class Model_Movie extends Model_Overwrite public function getSeason() { - if(!$this->_season) + if(!$this->_season && $this->season_id !== null) $this->_season = Model_Season::find_by_pk($this->season_id); return $this->_season; @@ -58,7 +59,9 @@ class Model_Movie extends Model_Overwrite { if(!$this->_tv_show) { $season = $this->getSeason(); - $this->_tv_show = Model_Tvshow::find_by_pk($season->tv_show_id); + + if($season !== null) + $this->_tv_show = Model_Tvshow::find_by_pk($season->tv_show_id); } return $this->_tv_show; @@ -107,6 +110,7 @@ class Model_Movie extends Model_Overwrite if ($thumb) return $thumb; } catch (CacheNotFoundException $e) { + if($this->type === 'episode') $this->getPicture($this->_season->thumb,$path_cache, $width, $height); else if($this->type === 'movie') @@ -124,10 +128,10 @@ class Model_Movie extends Model_Overwrite $curl = null; - if(!$width && !$height) + if (!$width && !$height) $curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . $path . '?X-Plex-Token=' . $this->_server->token, 'curl'); else - $curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/photo/:/transcode?width='.$width.'&height='.$height.'&minSize=1&url='.$path.'&X-Plex-Token='.$this->_server->token, 'curl'); + $curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/photo/:/transcode?width=' . $width . '&height=' . $height . '&minSize=1&url=' . $path . '&X-Plex-Token=' . $this->_server->token, 'curl'); $curl->execute(); @@ -255,7 +259,8 @@ class Model_Movie extends Model_Overwrite $language = isset($user_settings->language) ? $user_settings->language : false; $request = 'http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : ''); - $request .= '/video/:/transcode/universal/start.m3u8'; + //$request .= '/video/:/transcode/universal/decision?hasMDE=1'; // DASH + $request .= '/video/:/transcode/universal/start.m3u8'; // HLS $request .= '?identifier=[PlexShare]'; $request .= '&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key); $request .= '&mediaIndex=0'; diff --git a/fuel/app/views/home/index.php b/fuel/app/views/home/index.php index 55c3578..3301c45 100755 --- a/fuel/app/views/home/index.php +++ b/fuel/app/views/home/index.php @@ -47,6 +47,7 @@
+
+
+
data-movie-id="id; ?>" @@ -247,12 +248,18 @@ }); /** LOAD IMAGES **/ $('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) { - var movie_id = $(element).data('movie-id'); - $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 160 +'&height='+ 236 +'")'); + /** IF USING CLOUDFLARE TOO MANY REQUEST **/ + setTimeout(function() { + var movie_id = $(element).data('movie-id'); + $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id=' + movie_id + '&width=' + 160 + '&height=' + 236 + '")'); + }, 10 * index); }); $('.PosterCardImg-imageContainer-1Ar4M[data-tvshow-id]').each(function (index, element) { - var tvshow_id = $(element).data('tvshow-id'); - $('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id='+ tvshow_id +'&width='+ 160 +'&height='+ 236 +'")'); + /** IF USING CLOUDFLARE TOO MANY REQUEST **/ + setTimeout(function() { + var tvshow_id = $(element).data('tvshow-id'); + $('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id='+ tvshow_id +'&width='+ 160 +'&height='+ 236 +'")'); + }, 10 * index); }); }); \ No newline at end of file diff --git a/fuel/app/views/movie/index.php b/fuel/app/views/movie/index.php index cac79e5..d2758c3 100644 --- a/fuel/app/views/movie/index.php +++ b/fuel/app/views/movie/index.php @@ -5,7 +5,7 @@
- @@ -73,21 +73,21 @@
- getMetaData()['Media']['@attributes']['videoResolution'] >= 720) : ?> + getMetaData()['Media']['@attributes']) && (int)$movie->getMetaData()['Media']['@attributes']['videoResolution'] >= 720) : ?>
- getMetaData()['Stream']['Audio'][0]['codec'] === 'ac3') : ?> + getMetaData()['Stream']['Audio'][0]) && $movie->getMetaData()['Stream']['Audio'][0]['codec'] === 'ac3') : ?>
- getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?> + getMetaData()['Stream']['Audio'][0]) && preg_match('/7\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
- getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?> + getMetaData()['Stream']['Audio'][0]) && preg_match('/5\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
- getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?> + getMetaData()['Stream']['Audio'][0]) && preg_match('/stereo/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
@@ -213,21 +213,25 @@
Vidéo
+ getMetaData()['Media']['@attributes'])) : ?> getMetaData()['Media']['@attributes']['videoResolution']; ?>p getMetaData()['Stream']['Video'][0]['codec']; ?> +
Audio
+ getMetaData()['Stream']['Audio'][0])) : ?> getMetaData()['Stream']['Audio'][0]['language']) ? $movie->getMetaData()['Stream']['Audio'][0]['language'] : ''; ?> getMetaData()['Stream']['Audio'][0]['displayTitle']) ? $movie->getMetaData()['Stream']['Audio'][0]['displayTitle'] : (isset($movie->getMetaData()['Stream']['Audio'][0]['title']) ? $movie->getMetaData()['Stream']['Audio'][0]['title'] : $movie->getMetaData()['Stream']['Audio'][0]['language']); ?> +
@@ -363,7 +367,7 @@ } }); /** LAUNCH PLAYER **/ - $(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) { + $(document).on('click', '#id-16, .MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) { event.stopPropagation(); var movie_id = $(this).data('id'); $.ajax({ diff --git a/fuel/app/views/movie/list.php b/fuel/app/views/movie/list.php index 7d8fb1e..dcc36db 100644 --- a/fuel/app/views/movie/list.php +++ b/fuel/app/views/movie/list.php @@ -57,6 +57,7 @@ data-qa-id="metadataPosterCard--/library/metadata/1">
+
@@ -330,8 +331,11 @@ }); /** LOAD IMAGES **/ $('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) { - var movie_id = $(element).data('movie-id'); - $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 160 +'&height='+ 236 +'")'); + /** IF USING CLOUDFLARE TOO MANY REQUEST **/ + setTimeout(function(){ + var movie_id = $(element).data('movie-id'); + $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 160 +'&height='+ 236 +'")'); + }, 10 * index); }); }); \ No newline at end of file