Group TVSHOW & Fix list MOVIES

Groups TV Show by Season
Show all movies fixed
pull/9/head
Chewbaka 6 years ago
parent d0381a0e2d
commit 5d1a7a1422

@ -0,0 +1,27 @@
<?php
use Fuel\Core\Response;
use Fuel\Core\View;
class Controller_Episode extends Controller_Home
{
public function action_index()
{
$episode_id = $this->param('episode_id');
if(!$episode_id)
Response::redirect('/home');
$episode = Model_Movie::find_by_pk($episode_id);
if(!$episode)
Response::redirect('/home');
$episode->getMetaData();
$body = View::forge('episode/index');
$body->set('episode', $episode);
$this->template->body = $body;
}
}

@ -0,0 +1,29 @@
<?php
use Fuel\Core\Controller;
use Fuel\Core\Response;
use Fuel\Core\Session;
use Fuel\Core\View;
use Fuel\Core\Asset;
use Fuel\Core\Input;
use Fuel\Core\Config;
use Fuel\Core\FuelException;
class Controller_Logout extends Controller
{
public function before()
{
parent::before();
$user = Session::get('user');
if(!$user)
Response::redirect('/login');
}
public function action_index()
{
Session::delete('user');
Response::redirect('/login');
}
}

@ -0,0 +1,47 @@
<?php
use Fuel\Core\Session;
use Fuel\Core\View;
class Controller_Settings_Libraries extends Controller_Settings
{
public function action_index()
{
$this->template->js_bottom = ['plex_alert.js', 'server_refresh.js'];
$body = View::forge('settings/libraries');
$user_id = Session::get('user')->id;
$libraries = Model_Library::find(function($query) use($user_id) {
$query
->select('library.*')
->join('server', 'LEFT')
->on('server.id', '=','library.server_id' )
->where('server.user_id', $user_id)
->and_where('server.disable', 0)
;
});
$body->set('libraries', $libraries);
$body->set('user', Session::get('user'));
$this->template->body = $body;
}
public function action_permissions()
{
$this->template->js_bottom = ['plex_alert.js'];
$body = View::forge('settings/libraries/permissions');
$library_id = $this->param('library_id');
$permissions = Model_Permission::find_all();
$body->set('permissions', $permissions);
$body->set('user', Session::get('user'));
$this->template->body = $body;
}
}

@ -0,0 +1,12 @@
<?php
class Model_Permission extends Model_Overwrite
{
protected static $_table_name = 'permission';
protected static $_primary_key = 'id';
protected static $_properties = array(
'id',
'name',
'disable'
);
}

@ -0,0 +1,262 @@
<div class="PrePlayPageHeader-altPageHeader-3bZbS PrePlayPageHeader-pageHeader-2o14F PageHeader-pageHeader-18RSw">
<div class="PageHeaderLeft-pageHeaderLeft-2TxSo"><a
href="/tvshow/<?php echo $episode->getTvShow()->id ; ?>"
role="link"
class="PageHeaderBreadcrumbButton-link-1N0DD Link-link-2XYrU Link-default-32xSO"><?php echo $episode->getTvShow()->title; ?></a><a
href="/season/<?php echo $episode->getSeason()->id; ?>"
role="link"
class="PageHeaderBreadcrumbButton-link-1N0DD Link-link-2XYrU Link-default-32xSO"><?php echo $episode->getSeason()->title; ?></a>
<button aria-haspopup="true" data-qa-id="typeDropdownButton" id="id-233" role="button"
class="PageHeaderBreadcrumbButton-button-1uaPj DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button"><?php echo $episode->title; ?>
<div class="DisclosureArrowButton-disclosureArrow-34Wg3 DisclosureArrow-disclosureArrow-1sBFv DisclosureArrowButton-down-bd2wx DisclosureArrowButton-medium-3-Y37 DisclosureArrow-down-1U7WW DisclosureArrow-up-rjGpc DisclosureArrow-default-3_FCW DisclosureArrow-medium-3VjTd "></div>
</button>
</div>
<div class="PageHeaderRight-pageHeaderRight-2CT0g">
<div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ">
<div class="pageHeaderToolbar-toolbar-1lW-M">
<button id="id-239" data-original-title="Lire" data-toggle="tooltip" 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>
<button id="id-238" data-original-title="Plus..." aria-haspopup="true" data-toggle="tooltip" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO "
type="button"><i class="plex-icon-toolbar-more-560"
aria-hidden="true"></i></button>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
<div class="PrePlayPageHeader-divider-WQRk8 PageHeaderDivider-pageHeaderDivider-DvwUq"></div>
<button id="id-235" data-original-title="Montrer les affiches" data-toggle="tooltip" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO " type="button">
<i class="plex-icon-toolbar-artwork-560" aria-hidden="true"></i></button>
<div class="PrePlayPageHeader-divider-WQRk8 PageHeaderDivider-pageHeaderDivider-DvwUq"></div>
<div><a id="id-236" data-qa-id="toolbarPrevious"
href="#"
role="link" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO ">
<i class="plex-icon-page-prev-560" aria-hidden="true"></i></a>
<a id="id-237" data-qa-id="toolbarNext" href="#" role="link"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO">
<i class="plex-icon-page-next-560" aria-hidden="true"></i></a></div>
</div>
</div>
<div class="PrePlayPageContent-prePlayPageContentContainer-1ckaM PageContent-pageContent-16mK6">
<div class="PrePlayPageContent-prePlayPageContent-1fFCH Scroller-scroller-d5-b- Scroller-vertical-1bgGS ">
<div class="PageContent-innerPageContent-3ktLT">
<div>
<div style="position: fixed; top: 180px;">
<div class="MetadataPosterCard-cardContainer-2gRcQ"
data-qa-id="metadataPosterCard--/library/metadata/28283">
<div class="MetadataPosterCard-card-3bztR " style="width: 260px; height: 146px;">
<div class="PrePlayPosterCard-face-3rQEj MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<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;"
class=""></div>
</div>
<div class=" MetadataPosterCardOverlay-overlay-1uMpL ">
<div class="MetadataPosterCardOverlay-background-2EwyB"></div>
<div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn"
data-qa-id="metadataPosterUnwatchedBadge">
<div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div>
</div>
<button data-id="<?php echo $episode->id; ?>" tabindex="-1"
role="button"
class="MetadataPosterCardOverlay-playCoverButton-I7oU3 MetadataPosterCardOverlay-playButton-1fjhk PlayButton-playButton-3WX8X MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO"
type="button">
<div class="MetadataPosterCardOverlay-playCircle-M67q6 PlayButton-playCircle-3Evfd MetadataPosterCardOverlay-centerCircle-1Mg-s">
<i class="plex-icon-play-560 PlayButton-playIcon-dt3sk"
aria-hidden="true"></i></div>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;">
<div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayPrimaryTitle-primaryTitle-1r9P9" data-qa-id="preplayMainTitle">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><a data-qa-id="metadataTitleLink"
title="<?php echo $episode->getTvShow()->title; ?>"
href="/tvshow/<?php echo $episode->getTvShow()->id; ?>"
role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $episode->getTvShow()->title; ?></a>
</div>
</div>
<div class="PrePlaySecondaryTitle-secondaryTitle-YJRGC PrePlayPrimaryTitle-primaryTitle-1r9P9"
data-qa-id="preplaySecondTitle">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><span><span><a
title="<?php echo $episode->getSeason()->title; ?>"
href="/season/<?php echo $episode->getSeason()->id; ?>"
role="link"
class=" Link-link-2XYrU Link-default-32xSO">S<?php echo $episode->getSeason()->number; ?></a><span
class="DashSeparator-separator-2a3yn">·</span><a
title="<?php echo $episode->title; ?>"
href="#"
role="link"
class=" Link-link-2XYrU Link-default-32xSO">E<?php echo $episode->number; ?></a></span><span
class="DashSeparator-separator-2a3yn">—</span><a
title="<?php echo $episode->title; ?>"
href="#"
role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $episode->title; ?></a></span>
</div>
<div class="PrePlayRatingRightTitle-ratingRightTitle-1d4Yy PrePlayRightTitle-rightTitle-VxiwU">
<span class="PrePlayRatingRightTitle-starRating-31XbA"></span><span
class="PrePlayRatingRightTitle-criticRating-2J_tn"><div
class="CriticRating-container-2t5Lw"><div
class="CriticRating-rating-1Ntfn"><div
class="CriticRating-other-uJc1K CriticRating-ratingImage-1bHp5"
title="Note"></div><?php echo $episode->rating * 10; ?>%
</div></div></span></div>
</div>
<div class="PrePlayTertiaryTitle-tertiaryTitle-1Rc92">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><span
class="PrePlayTertiaryTitleSpacer-tertiaryTitleSpacer-14zhL"><span><?php echo $episode->getDuration(); ?></span>
<span
class="PrePlayDashSeparator-separator-1d01z">·</span>
<!-- Non vu</span><a
href="#"
role="link"
class="PrePlayStatusButton-statusButton-28XJ7 Button-default-36soe Button-button--JvPI Link-link-2XYrU Button-small-3Zwli">TV-PG</a-->
</div>
<div class="PrePlayRightTitle-rightTitle-VxiwU"><?php echo $episode->getReleaseDate(); ?></div>
</div>
</div>
<div class="PrePlayDivider-divider-1qvbj"></div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayDetailsGroup-group-3i0Tj" data-qa-id="preplayDetailsContainer">
<?php if ($episode->metadata['Director']) : ?>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Directed by</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<?php foreach ($episode->metadata['Director'] as $director) : ?>
<?php $director = isset($episode->metadata['Director']['@attributes']) ? $episode->metadata['Director'] : $director; ?>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-default-32xSO">
<?php echo $director['@attributes']['tag']; ?>
</a>,
</span>
<?php if (isset($episode->metadata['Director']['@attributes'])) {
break;
} ?>
<?php endforeach; ?>
</span>
</div>
</div>
<?php endif; ?>
<?php if ($episode->metadata['Writer']) : ?>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Writed by</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<?php foreach ($episode->metadata['Writer'] as $writer) : ?>
<?php $writer = isset($episode->metadata['Writer']['@attributes']) ? $episode->metadata['Writer'] : $writer; ?>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO">
<?php echo $writer['@attributes']['tag']; ?>
</a>,
</span>
<?php if (isset($episode->metadata['Writer']['@attributes'])) {
break;
} ?>
<?php endforeach; ?>
</span>
</div>
</div>
<?php endif; ?>
</div>
<div class="PrePlayDetailsGroup-group-3i0Tj" data-qa-id="preplayDetailsContainer">
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Vidéo</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span data-qa-id="videoStream">
<?php echo strtoupper($episode->metadata['Media']['@attributes']['videoResolution']); ?>
<span class="DashSeparator-separator-2a3yn"></span>
<?php echo strtoupper($episode->metadata['Media']['@attributes']['videoCodec']); ?>
</span>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Audio</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span data-qa-id="audioStream">
Inconnu
<span class="DashSeparator-separator-2a3yn"></span>
MP3 Stéréo
</span></div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Sous-titres</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"><span>Aucun</span></div>
</div>
</div>
<div class="PrePlaySummary-summary-1NL8g">
<div class="CollapsibleText-contentTransition-15VYv" style="overflow: hidden; max-height: 78px;">
<div class="Measure-container-2XznZ"><?php echo $episode->summary; ?>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
</div>
<button aria-haspopup="true" role="button"
class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button">Show more
<div class="CollapsibleText-readMoreArrow-34BdB DisclosureArrowButton-disclosureArrow-34Wg3 DisclosureArrow-disclosureArrow-1sBFv DisclosureArrowButton-down-bd2wx DisclosureArrowButton-medium-3-Y37 DisclosureArrow-down-1U7WW DisclosureArrow-up-rjGpc DisclosureArrow-default-3_FCW DisclosureArrow-medium-3VjTd "></div>
</button>
</div>
</div>
</div>
<div class="PrePlayMetadataListInnerContent-innerContent-2CsIz">
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayCastList-castList-3dQB5"></div>
<div class="PrePlayRelatedList-relatedList-2fY8S"
style="opacity: 0; pointer-events: none;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
<script type="text/javascript">
$(function () {
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
event.stopPropagation();
var movie_id = $(this).data('id');
$.ajax({
url: '/rest/movie/stream',
method: 'GET',
data: {movie_id: movie_id},
dataType: 'html'
}).done(function (view) {
launchPlayer(view);
}).fail(function (data) {
console.error(data);
});
});
$('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) {
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=' + 260 + '&height=' + 146 + '&thumb=true")');
}, (index + 1) * 100);
});
});
</script>

@ -0,0 +1,262 @@
<div class="PrePlayPageHeader-altPageHeader-3bZbS PrePlayPageHeader-pageHeader-2o14F PageHeader-pageHeader-18RSw">
<div class="PageHeaderLeft-pageHeaderLeft-2TxSo"><span
class="PageHeaderBreadcrumbButton-link-1N0DD"><?php echo $movie->title; ?></span>
</div>
<div class="PageHeaderRight-pageHeaderRight-2CT0g">
<div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ">
<div class="pageHeaderToolbar-toolbar-1lW-M">
<button id="id-16" data-original-title="Lire" data-toggle="tooltip" 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>
<button id="id-15" data-original-title="Plus..." aria-haspopup="true" data-toggle="tooltip"
role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-more-560" aria-hidden="true"></i></button>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
<div class="PrePlayPageHeader-divider-WQRk8 PageHeaderDivider-pageHeaderDivider-DvwUq"></div>
<button id="id-14" data-original-title="Montrer les affiches" data-toggle="tooltip" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" type="button">
<i class="plex-icon-toolbar-artwork-560" aria-hidden="true"></i></button>
</div>
</div>
<div class="PrePlayPageContent-prePlayPageContentContainer-1ckaM PageContent-pageContent-16mK6">
<div class="PrePlayPageContent-prePlayPageContent-1fFCH Scroller-scroller-d5-b- Scroller-vertical-1bgGS ">
<div class="PageContent-innerPageContent-3ktLT">
<div>
<div style="position: fixed; top: 180px;">
<div class="MetadataPosterCard-cardContainer-2gRcQ"
data-qa-id="metadataPosterCard--/library/metadata/28283">
<div class="MetadataPosterCard-card-3bztR " style="width: 260px; height: 390px;">
<div class="PrePlayPosterCard-face-3rQEj MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<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>
</div>
<div class=" MetadataPosterCardOverlay-overlay-1uMpL ">
<div class="MetadataPosterCardOverlay-background-2EwyB"></div>
<div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn"
data-qa-id="metadataPosterUnwatchedBadge">
<div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div>
</div>
<button data-id="<?php echo $movie->id; ?>" tabindex="-1"
role="button"
class="MetadataPosterCardOverlay-playCoverButton-I7oU3 MetadataPosterCardOverlay-playButton-1fjhk PlayButton-playButton-3WX8X MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO"
type="button">
<div class="MetadataPosterCardOverlay-playCircle-M67q6 PlayButton-playCircle-3Evfd MetadataPosterCardOverlay-centerCircle-1Mg-s">
<i class="plex-icon-play-560 PlayButton-playIcon-dt3sk"
aria-hidden="true"></i></div>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;">
<div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayPrimaryTitle-primaryTitle-1r9P9">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><a title="<?php echo $movie->title; ?>"
href="#"
role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?></a>
</div>
</div>
<div class="PrePlaySecondaryTitle-secondaryTitle-YJRGC PrePlayPrimaryTitle-primaryTitle-1r9P9"
data-qa-id="preplaySecondTitle">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG">
<span>
<span>
<a title="<?php echo $movie->year; ?>"
href="#!/server/df1de861fbaba243c18ed9275fd42e3248d19336/details?key=%2Flibrary%2Fmetadata%2F28083"
role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->year; ?></a>
</span>
</span>
</div>
<div class="PrePlayRatingRightTitle-ratingRightTitle-1d4Yy PrePlayRightTitle-rightTitle-VxiwU">
<span
class="PrePlayRatingRightTitle-criticRating-2J_tn"><div
class="CriticRating-container-2t5Lw"><div
class="CriticRating-rating-1Ntfn"><div
class="CriticRating-other-uJc1K CriticRating-ratingImage-1bHp5"
title="Note"></div><?php echo $movie->rating * 10; ?>%
</div></div></span></div>
</div>
<div class="PrePlayTertiaryTitle-tertiaryTitle-1Rc92">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG">
<span class="PrePlayTertiaryTitleSpacer-tertiaryTitleSpacer-14zhL">
<span><?php echo $movie->getDuration(); ?></span>
<!-- span class="PrePlayDashSeparator-separator-1d01z">·</span>
NOT WATCHED -->
</span>
</div>
<div class="PrePlayRightTitle-rightTitle-VxiwU">
<span>
<?php foreach ($movie->metadata['Genre'] as $genre) : ?>
<?php $genre = isset($movie->metadata['Genre']['@attributes']) ? $movie->metadata['Genre'] : $genre; ?>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-default-32xSO">
<?php echo $genre['@attributes']['tag']; ?>
</a>,
</span>
<?php if (isset($movie->metadata['Genre']['@attributes'])) {
break;
} ?>
<?php endforeach; ?>
</span>
</div>
</div>
</div>
<div class="PrePlayDivider-divider-1qvbj"></div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayDetailsGroup-group-3i0Tj">
<?php if ($movie->metadata['Director']) : ?>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Directed by</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<?php foreach ($movie->metadata['Director'] as $director) : ?>
<?php $director = isset($movie->metadata['Director']['@attributes']) ? $movie->metadata['Director'] : $director; ?>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO">
<?php echo $director['@attributes']['tag']; ?>
</a>,
</span>
<?php if (isset($movie->metadata['Director']['@attributes'])) {
break;
} ?>
<?php endforeach; ?>
</span>
</div>
</div>
<?php endif; ?>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Writed by</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<?php foreach ($movie->metadata['Writer'] as $writer) : ?>
<?php $writer = isset($movie->metadata['Writer']['@attributes']) ? $movie->metadata['Writer'] : $writer; ?>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO">
<?php echo $writer['@attributes']['tag']; ?>
</a>,
</span>
<?php if (isset($movie->metadata['Writer']['@attributes'])) {
break;
} ?>
<?php endforeach; ?>
</span>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Studio</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<span>
<a href="#" role="link"
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO">
<?php echo $movie->studio; ?>
</a>
</span>
</span>
</div>
</div>
</div>
<div class="PrePlayDetailsGroup-group-3i0Tj">
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Vidéo</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span data-qa-id="videoStream">
SD
<span class="DashSeparator-separator-2a3yn"></span>
MPEG4
</span>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Audio</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
Inconnu
<span class="DashSeparator-separator-2a3yn"></span>
MP3 Stéréo
</span>
</div>
</div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Sous-titres</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"><span>Aucun</span></div>
</div>
</div>
<div class="PrePlaySummary-summary-1NL8g">
<div class="CollapsibleText-contentTransition-15VYv"
style="overflow: hidden; max-height: 78px;">
<div class="Measure-container-2XznZ"><?php echo $movie->summary; ?>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
</div>
<button aria-haspopup="true" role="button"
class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button">Show more
<div class="CollapsibleText-readMoreArrow-34BdB DisclosureArrowButton-disclosureArrow-34Wg3 DisclosureArrow-disclosureArrow-1sBFv DisclosureArrowButton-down-bd2wx DisclosureArrowButton-medium-3-Y37 DisclosureArrow-down-1U7WW DisclosureArrow-up-rjGpc DisclosureArrow-default-3_FCW DisclosureArrow-medium-3VjTd "></div>
</button>
</div>
</div>
</div>
<div class="PrePlayMetadataListInnerContent-innerContent-2CsIz">
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayCastList-castList-3dQB5"></div>
<div class="PrePlayRelatedList-relatedList-2fY8S"
style="opacity: 0; pointer-events: none;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div>
</div>
<div class="Measure-scrollContainer-3vb4J">
<div class="Measure-shrinkContent-32Udi Measure-expandContent-1JQfL"></div>
</div>
</div>
<script type="text/javascript">
$(function () {
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
event.stopPropagation();
var movie_id = $(this).data('id');
$.ajax({
url: '/rest/movie/stream',
method: 'GET',
data: {movie_id: movie_id},
dataType: 'html'
}).done(function (view) {
launchPlayer(view);
}).fail(function (data) {
console.error(data);
});
});
$('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) {
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='+ 260 +'&height='+ 390 +'")');
}, (index + 1) * 100);
});
});
</script>

@ -0,0 +1,35 @@
<div class="settings-container">
<div class="filter-bar"></div>
<div class="devices-container row">
<div class="device-list-container col-sm-12 col-md-12">
<div class="PrePlayList-container-WZ86O HubCell-hubCell-3Ys17">
<div class="PrePlayDescendantList-descendantHubCellHeader-2qK3U HubCellHeader-hubCellHeader-2pvYN">
<div class="HubCellTitle-hubCellTitle-2abIn">SAISONS</div>
</div>
<div class="PrePlayListTopDivider-topDivider-3c8uz PrePlayDivider-divider-1qvbj"></div>
<div>
<div class="" style="height: <?php echo count($permissions) * 40; ?>px;">
<?php foreach ($permissions as $permission) : ?>
<div class="MetadataTableRow-item-11DH-" style="position: relative; height: 40px;">
<div class="MetadataTableRow-overlay-1RiId">
<div class="MetadataTableCell-tableCell-35117" style="flex: 1 1 350px;">
<span class="MetadataTableCell-title-3KMG0">
<div class="MetadataTableTitle-titleContainer-3sPQC">
<span class="MetadataTableTitle-title-2WmEM"><?php echo $permission->name; ?></span>
<span></span>
</div>
</span>
</div>
<div class="MetadataTableCell-tableCell-35117" style="flex: 0 1 150px;">
<span class="MetadataTableCell-title-3KMG0">13 épisodes</span>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="PrePlayListBottomDivider-bottomDivider-3XSnc PrePlayDivider-divider-1qvbj"></div>
</div>
</div>
</div>
</div>

@ -0,0 +1,129 @@
// ACTION UPDATE ALL DATA SERVER AND BROWSING IT
var ajax = 0;
var alert = $('.alert.alert-status');
var alert_status = $('.alert.alert-status .status');
function updateServers(servers) {
$(servers).each(function (index,server) {
ajax += 1;
setTimeout(function () {
alert_status.html('Browsing server ' + server.name);
$.ajax({
method: 'put',
url: '/rest/browse/server.json',
data: {server_id: server.id}
}).done(function (data) {
updateLibraries(server);
ajax -= 1;
});
}, (index + 1) * 1000);
});
}
function updateLibraries(server) {
ajax += 1;
alert_status.html('Getting all libraries on server ' + server.name);
$.ajax({
method: 'get',
url: '/rest/browse/libraries.json',
data: {server_id: server.id}
}).done(function (data) {
updateContentLibraries(server, data.libraries);
ajax -= 1;
});
}
function updateLibrary(server, library) {
ajax += 1;
setTimeout(function () {
alert_status.html('Browsing library ' + library.name + ' on server ' + server.name );
$.ajax({
method: 'get',
url: '/rest/browse/subcontent.json',
data: {server_id: server.id, library_id: library.id}
}).done(function (data) {
if(data.movies !== undefined) {
updateMovies(server, data.movies, library, null);
}
if(data.tvshows !== undefined) {
updateTvShows(server, data.tvshows);
}
ajax -= 1;
});
}, 1000);
}
function updateContentLibraries(server, libaries) {
$(libaries).each(function (index,library) {
ajax += 1;
setTimeout(function () {
alert_status.html('Browsing library ' + library.name + ' on server ' + server.name );
$.ajax({
method: 'get',
url: '/rest/browse/subcontent.json',
data: {server_id: server.id, library_id: library.id}
}).done(function (data) {
if(data.movies !== undefined) {
updateMovies(server, data.movies, library, null);
}
if(data.tvshows !== undefined) {
updateTvShows(server, data.tvshows);
}
ajax -= 1;
});
}, (index + 1) * 1000);
});
}
function updateTvShows(server, tvshows) {
$(tvshows).each(function (index,tvshow) {
ajax += 1;
setTimeout(function () {
alert_status.html('Browsing TV Show ' + tvshow.name + ' on server ' + server.name);
$.ajax({
method: 'get',
url: '/rest/browse/seasons.json',
data: {server_id: server.id, tvshow_id: tvshow.id}
}).done(function (data) {
updateSeasons(server, tvshow, data.seasons);
ajax -= 1;
});
}, (index + 1) * 1000);
});
}
function updateSeasons(server, tvshow, seasons) {
$(seasons).each(function (index,season) {
ajax += 1;
setTimeout(function () {
alert_status.html('Browsing ' + season.name + ' ' + tvshow.name + ' on server ' + server.name);
$.ajax({
method: 'get',
url: '/rest/browse/movies.json',
data: {server_id: server.id, season_id: season.id}
}).done(function (data) {
updateMovies(server, data.movies, null, season);
ajax -= 1;
});
}, (index + 1) * 1000);
});
}
function updateMovies(server, movies, library, season) {
/*$(movies).each(function (index,movie) {
setTimeout(function () {
alert_status.html('Browsing movie ' + movie.name + ' on server ' + server.name);
$.ajax({
method: 'get',
url: '/rest/browse/movies.json',
data: {server_id: server.id, season_id: season.id}
}).done(function (data) {
updateMovies(server, data.movies, null, season);
ajax -= 1;
});
}, (index + 1) * 1000);
});*/
}
function checkAjax() {
var interval = setInterval(function () {
if(ajax === 0) {
clearInterval(interval);
alert_status.html('Browsing servers is finished!');
alert.delay(1000).toggleClass('transition-out');
}
}, 1000);
}
Loading…
Cancel
Save