add icon before cover, tooltip

pull/9/head
Chewbaka69 6 years ago
parent 4f2ddc8f22
commit d271b963ef

@ -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';

@ -47,6 +47,7 @@
<div class="MetadataPosterCard-card-3bztR "
style="width: 127px; height: 191px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<i class="plex-icon-shows-560 MetadataPosterCardIcon-placeholderIcon-2P76z" aria-hidden="true" style="font-size: 32px; line-height: 191px;"></i>
<div class="PosterCardImg-imageContainer-1Ar4M"
data-movie-id="<?php echo $episode->id; ?>">
<div style="background-image: url(); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;"
@ -178,6 +179,7 @@
<div class="MetadataPosterCard-card-3bztR "
style="width: 127px; height: 191px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<i class="plex-icon-shows-560 MetadataPosterCardIcon-placeholderIcon-2P76z" aria-hidden="true" style="font-size: 32px; line-height: 191px;"></i>
<div class="PosterCardImg-imageContainer-1Ar4M"
data-movie-id="<?php echo $movie->id; ?>">
<div style="background-image: url(); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;"

@ -57,6 +57,7 @@
data-qa-id="metadataPosterCard--/library/metadata/1">
<div class="MetadataPosterCard-card-3bztR " style="width: 126px; height: 189px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<i class="plex-icon-shows-560 MetadataPosterCardIcon-placeholderIcon-2P76z" aria-hidden="true" style="font-size: 32px; line-height: 189px;"></i>
<div class="PosterCardImg-imageContainer-1Ar4M"
<?php if(get_class($movie) === Model_Movie::class) : ?>
data-movie-id="<?php echo $movie->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);
});
});
</script>

@ -5,7 +5,7 @@
<div class="PageHeaderRight-pageHeaderRight-2CT0g">
<div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ">
<div class="pageHeaderToolbar-toolbar-1lW-M">
<button id="id-16" title="Play" data-toggle="tooltip" data-placement="bottom" role="button"
<button id="id-16" title="Play" data-toggle="tooltip" data-placement="bottom" data-id="<?php echo $movie->id; ?>" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-play-560" aria-hidden="true"></i>
</button>
@ -73,21 +73,21 @@
</button>
</div>
<?php endif; ?>
<?php if((int)$movie->getMetaData()['Media']['@attributes']['videoResolution'] >= 720) : ?>
<?php if(isset($movie->getMetaData()['Media']['@attributes']) && (int)$movie->getMetaData()['Media']['@attributes']['videoResolution'] >= 720) : ?>
<div class="col-sm-4 text-center" style="font-size: 35px;"><i class="glyphicon video-hd"></i></div>
<?php else: ?>
<div class="col-sm-4 text-center" style="font-size: 35px;"><i class="glyphicon video-sd"></i></div>
<?php endif; ?>
<?php if($movie->getMetaData()['Stream']['Audio'][0]['codec'] === 'ac3') : ?>
<?php if(isset($movie->getMetaData()['Stream']['Audio'][0]) && $movie->getMetaData()['Stream']['Audio'][0]['codec'] === 'ac3') : ?>
<div class="col-sm-4 text-center" title="Dolby Digital" data-placement="bottom" data-toggle="tooltip" style="font-size: 35px;"><i class="glyphicon sound-dolby"></i></div>
<?php endif; ?>
<?php if(preg_match('/7\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<?php if(isset($movie->getMetaData()['Stream']['Audio'][0]) && preg_match('/7\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<div class="col-sm-4 text-center" style="font-size: 35px;"><i class="glyphicon sound-7-1"></i></div>
<?php elseif (preg_match('/5\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<?php elseif (isset($movie->getMetaData()['Stream']['Audio'][0]) && preg_match('/5\.1(\([a-z]*\))?/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<div class="col-sm-4 text-center" style="font-size: 35px;"><i class="glyphicon sound-5-1"></i></div>
<?php elseif (preg_match('/stereo/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<?php elseif (isset($movie->getMetaData()['Stream']['Audio'][0]) && preg_match('/stereo/',$movie->getMetaData()['Stream']['Audio'][0]['audioChannelLayout'])) : ?>
<div class="col-sm-4 text-center" title="Stereo" data-placement="bottom" data-toggle="tooltip" style="font-size: 35px;"><i class="glyphicon sound-stereo"></i></div>
<?php endif; ?>
</div>
@ -213,21 +213,25 @@
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Vidéo</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<?php if (isset($movie->getMetaData()['Media']['@attributes'])) : ?>
<span data-qa-id="videoStream">
<?php echo $movie->getMetaData()['Media']['@attributes']['videoResolution']; ?>p
<span class="DashSeparator-separator-2a3yn"></span>
<?php echo $movie->getMetaData()['Stream']['Video'][0]['codec']; ?>
</span>
<?php endif; ?>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Audio</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<?php if (isset($movie->getMetaData()['Stream']['Audio'][0])) : ?>
<span>
<?php echo isset($movie->getMetaData()['Stream']['Audio'][0]['language']) ? $movie->getMetaData()['Stream']['Audio'][0]['language'] : ''; ?>
<span class="DashSeparator-separator-2a3yn"></span>
<?php echo isset($movie->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']); ?>
</span>
<?php endif; ?>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
@ -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({

@ -57,6 +57,7 @@
data-qa-id="metadataPosterCard--/library/metadata/1">
<div class="MetadataPosterCard-card-3bztR " style="width: 126px; height: 189px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<i class="plex-icon-shows-560 MetadataPosterCardIcon-placeholderIcon-2P76z" aria-hidden="true" style="font-size: 30px; line-height: 189px;"></i>
<div class="PosterCardImg-imageContainer-1Ar4M" data-movie-id="<?php echo $movie->id; ?>">
<div style="background-image: url(); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;"
class=""></div>
@ -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);
});
});
</script>
Loading…
Cancel
Save