Add admin, reforge view, fix error load servers, fix throwing error

pull/9/head
Chewbaka69 6 years ago
parent faac5bb05a
commit b44472a203

185
composer.lock generated

@ -1,24 +1,23 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "25cbf2308918f775e251cffcf914c557", "content-hash": "85fd9d3cc030402a776db7f7553ced3f",
"content-hash": "a9efe46743688d5b1f2f64de7f780195",
"packages": [ "packages": [
{ {
"name": "composer/installers", "name": "composer/installers",
"version": "v1.0.24", "version": "v1.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/installers.git", "url": "https://github.com/composer/installers.git",
"reference": "1cf7cc4b89d5e8549bbb7d6ab1de75da13d27988" "reference": "049797d727261bf27f2690430d935067710049c2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/1cf7cc4b89d5e8549bbb7d6ab1de75da13d27988", "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
"reference": "1cf7cc4b89d5e8549bbb7d6ab1de75da13d27988", "reference": "049797d727261bf27f2690430d935067710049c2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -30,7 +29,7 @@
}, },
"require-dev": { "require-dev": {
"composer/composer": "1.0.*@dev", "composer/composer": "1.0.*@dev",
"phpunit/phpunit": "4.1.*" "phpunit/phpunit": "^4.8.36"
}, },
"type": "composer-plugin", "type": "composer-plugin",
"extra": { "extra": {
@ -60,71 +59,92 @@
"keywords": [ "keywords": [
"Craft", "Craft",
"Dolibarr", "Dolibarr",
"Eliasis",
"Hurad", "Hurad",
"ImageCMS", "ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo", "MODX Evo",
"Mautic", "Mautic",
"Maya",
"OXID", "OXID",
"Plentymarkets",
"Porto",
"RadPHP",
"SMF", "SMF",
"Thelia", "Thelia",
"WolfCMS", "WolfCMS",
"agl", "agl",
"aimeos", "aimeos",
"annotatecms", "annotatecms",
"attogram",
"bitrix", "bitrix",
"cakephp", "cakephp",
"chef", "chef",
"cockpit",
"codeigniter", "codeigniter",
"concrete5", "concrete5",
"croogo", "croogo",
"dokuwiki", "dokuwiki",
"drupal", "drupal",
"eZ Platform",
"elgg", "elgg",
"expressionengine",
"fuelphp", "fuelphp",
"grav", "grav",
"installer", "installer",
"itop",
"joomla", "joomla",
"kohana", "kohana",
"laravel", "laravel",
"lavalite",
"lithium", "lithium",
"magento", "magento",
"majima",
"mako", "mako",
"mediawiki", "mediawiki",
"modulework", "modulework",
"modx",
"moodle", "moodle",
"osclass",
"phpbb", "phpbb",
"piwik", "piwik",
"ppi", "ppi",
"puppet", "puppet",
"pxcms",
"reindex",
"roundcube", "roundcube",
"shopware", "shopware",
"silverstripe", "silverstripe",
"sydes",
"symfony", "symfony",
"typo3", "typo3",
"wordpress", "wordpress",
"yawik",
"zend", "zend",
"zikula" "zikula"
], ],
"time": "2016-04-05 11:42:46" "time": "2017-12-29T09:13:20+00:00"
}, },
{ {
"name": "fuel/auth", "name": "fuel/auth",
"version": "dev-1.8/master", "version": "1.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/auth.git", "url": "https://github.com/fuel/auth.git",
"reference": "a645dbe2f80b6b4cecb069b57ea70150b6e53929" "reference": "b19a63e27903760d41a8641b8a42b1ddaaa646f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/auth/zipball/a645dbe2f80b6b4cecb069b57ea70150b6e53929", "url": "https://api.github.com/repos/fuel/auth/zipball/b19a63e27903760d41a8641b8a42b1ddaaa646f2",
"reference": "a645dbe2f80b6b4cecb069b57ea70150b6e53929", "reference": "b19a63e27903760d41a8641b8a42b1ddaaa646f2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -136,30 +156,27 @@
], ],
"description": "FuelPHP 1.x Auth Package", "description": "FuelPHP 1.x Auth Package",
"homepage": "https://github.com/fuel/auth", "homepage": "https://github.com/fuel/auth",
"support": { "time": "2018-04-18T14:45:14+00:00"
"source": "https://github.com/fuel/auth/tree/1.8/develop",
"issues": "https://github.com/fuel/auth/issues"
},
"time": "2016-01-23 12:30:25"
}, },
{ {
"name": "fuel/core", "name": "fuel/core",
"version": "dev-1.8/master", "version": "1.8.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/core.git", "url": "https://github.com/fuel/core.git",
"reference": "26f6432a9f41659280c70ba47c16170adf1e7611" "reference": "c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/core/zipball/26f6432a9f41659280c70ba47c16170adf1e7611", "url": "https://api.github.com/repos/fuel/core/zipball/c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7",
"reference": "26f6432a9f41659280c70ba47c16170adf1e7611", "reference": "c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -171,30 +188,27 @@
], ],
"description": "FuelPHP 1.x Core", "description": "FuelPHP 1.x Core",
"homepage": "https://github.com/fuel/core", "homepage": "https://github.com/fuel/core",
"support": { "time": "2016-07-21T08:45:05+00:00"
"source": "https://github.com/fuel/core/tree/1.8/master",
"issues": "https://github.com/fuel/core/issues"
},
"time": "2016-04-09 16:28:31"
}, },
{ {
"name": "fuel/email", "name": "fuel/email",
"version": "dev-1.8/master", "version": "1.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/email.git", "url": "https://github.com/fuel/email.git",
"reference": "79133b3951068bbcff9a9c7b77f9f27a777ebdbd" "reference": "a12df7db925c81f3ace52cdec3dfd925193c8e4b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/email/zipball/79133b3951068bbcff9a9c7b77f9f27a777ebdbd", "url": "https://api.github.com/repos/fuel/email/zipball/a12df7db925c81f3ace52cdec3dfd925193c8e4b",
"reference": "79133b3951068bbcff9a9c7b77f9f27a777ebdbd", "reference": "a12df7db925c81f3ace52cdec3dfd925193c8e4b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -206,30 +220,27 @@
], ],
"description": "FuelPHP 1.x Email Package", "description": "FuelPHP 1.x Email Package",
"homepage": "https://github.com/fuel/email", "homepage": "https://github.com/fuel/email",
"support": { "time": "2018-04-18T14:49:14+00:00"
"source": "https://github.com/fuel/email/tree/1.8/develop",
"issues": "https://github.com/fuel/email/issues"
},
"time": "2016-01-23 12:31:34"
}, },
{ {
"name": "fuel/oil", "name": "fuel/oil",
"version": "dev-1.8/master", "version": "1.8.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/oil.git", "url": "https://github.com/fuel/oil.git",
"reference": "b29b80f29f090b9ad12b931da6e979587de6ced1" "reference": "548d0fc1c07793e21128ecd4ebf5badc36908865"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/oil/zipball/b29b80f29f090b9ad12b931da6e979587de6ced1", "url": "https://api.github.com/repos/fuel/oil/zipball/548d0fc1c07793e21128ecd4ebf5badc36908865",
"reference": "b29b80f29f090b9ad12b931da6e979587de6ced1", "reference": "548d0fc1c07793e21128ecd4ebf5badc36908865",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -241,30 +252,27 @@
], ],
"description": "FuelPHP 1.x Oil Package", "description": "FuelPHP 1.x Oil Package",
"homepage": "https://github.com/fuel/oil", "homepage": "https://github.com/fuel/oil",
"support": { "time": "2018-05-03T20:59:29+00:00"
"source": "https://github.com/fuel/oil/tree/1.8/develop",
"issues": "https://github.com/fuel/oil/issues"
},
"time": "2016-01-23 12:32:54"
}, },
{ {
"name": "fuel/orm", "name": "fuel/orm",
"version": "dev-1.8/master", "version": "1.8.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/orm.git", "url": "https://github.com/fuel/orm.git",
"reference": "2c1da635127c9fbedc9c76132fc904188892c365" "reference": "372a5ffbbef797c4532eaf0283c9483309809206"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/orm/zipball/2c1da635127c9fbedc9c76132fc904188892c365", "url": "https://api.github.com/repos/fuel/orm/zipball/372a5ffbbef797c4532eaf0283c9483309809206",
"reference": "2c1da635127c9fbedc9c76132fc904188892c365", "reference": "372a5ffbbef797c4532eaf0283c9483309809206",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -276,30 +284,27 @@
], ],
"description": "FuelPHP 1.x ORM Package", "description": "FuelPHP 1.x ORM Package",
"homepage": "https://github.com/fuel/orm", "homepage": "https://github.com/fuel/orm",
"support": { "time": "2018-04-22T10:09:22+00:00"
"source": "https://github.com/fuel/orm/tree/1.8/develop",
"issues": "https://github.com/fuel/orm/issues"
},
"time": "2016-02-07 12:09:12"
}, },
{ {
"name": "fuel/parser", "name": "fuel/parser",
"version": "dev-1.8/master", "version": "1.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/parser.git", "url": "https://github.com/fuel/parser.git",
"reference": "bec50ec304e696d72dba7f13494828532c6e18df" "reference": "c8725e112ef59f70f73ddff754a9fe762229fa88"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/parser/zipball/bec50ec304e696d72dba7f13494828532c6e18df", "url": "https://api.github.com/repos/fuel/parser/zipball/c8725e112ef59f70f73ddff754a9fe762229fa88",
"reference": "bec50ec304e696d72dba7f13494828532c6e18df", "reference": "c8725e112ef59f70f73ddff754a9fe762229fa88",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -311,11 +316,7 @@
], ],
"description": "FuelPHP 1.x Parser Package", "description": "FuelPHP 1.x Parser Package",
"homepage": "https://github.com/fuel/parser", "homepage": "https://github.com/fuel/parser",
"support": { "time": "2018-04-18T14:52:18+00:00"
"source": "https://github.com/fuel/parser/tree/1.8/develop",
"issues": "https://github.com/fuel/parser/issues"
},
"time": "2016-03-12 12:08:41"
}, },
{ {
"name": "fuelphp/upload", "name": "fuelphp/upload",
@ -365,7 +366,7 @@
"file uploads", "file uploads",
"upload" "upload"
], ],
"time": "2015-11-04 17:19:56" "time": "2015-11-04T17:19:56+00:00"
}, },
{ {
"name": "michelf/php-markdown", "name": "michelf/php-markdown",
@ -416,7 +417,7 @@
"keywords": [ "keywords": [
"markdown" "markdown"
], ],
"time": "2013-11-29 17:09:24" "time": "2013-11-29T17:09:24+00:00"
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
@ -478,7 +479,7 @@
"logging", "logging",
"psr-3" "psr-3"
], ],
"time": "2013-04-23 10:09:48" "time": "2013-04-23T10:09:48+00:00"
}, },
{ {
"name": "phpseclib/phpseclib", "name": "phpseclib/phpseclib",
@ -566,26 +567,34 @@
"x.509", "x.509",
"x509" "x509"
], ],
"time": "2015-08-04 04:48:03" "time": "2015-08-04T04:48:03+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.0", "version": "1.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": "" "shasum": ""
}, },
"require": {
"php": ">=5.3.0"
},
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Psr\\Log\\": "" "Psr\\Log\\": "Psr/Log/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -599,33 +608,35 @@
} }
], ],
"description": "Common interface for logging libraries", "description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [ "keywords": [
"log", "log",
"psr", "psr",
"psr-3" "psr-3"
], ],
"time": "2012-12-21 11:40:51" "time": "2016-10-10T12:19:37+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "fuel/docs", "name": "fuel/docs",
"version": "dev-1.8/master", "version": "1.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fuel/docs.git", "url": "https://github.com/fuel/docs.git",
"reference": "d16972d39cef5f936779fca83bb19037cc2a3140" "reference": "819d65d744ef29cacec96649a6f39be28c854038"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fuel/docs/zipball/d16972d39cef5f936779fca83bb19037cc2a3140", "url": "https://api.github.com/repos/fuel/docs/zipball/819d65d744ef29cacec96649a6f39be28c854038",
"reference": "d16972d39cef5f936779fca83bb19037cc2a3140", "reference": "819d65d744ef29cacec96649a6f39be28c854038",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/installers": "~1.0" "composer/installers": "~1.0"
}, },
"type": "fuel-package", "type": "fuel-package",
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
@ -637,28 +648,16 @@
], ],
"description": "FuelPHP 1.x Documenataion", "description": "FuelPHP 1.x Documenataion",
"homepage": "https://github.com/fuel/docs", "homepage": "https://github.com/fuel/docs",
"support": { "time": "2018-04-17T16:29:24+00:00"
"source": "https://github.com/fuel/docs/tree/1.8/master",
"issues": "https://github.com/fuel/docs/issues"
},
"time": "2016-04-09 11:48:09"
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": { "stability-flags": [],
"fuel/core": 20,
"fuel/auth": 20,
"fuel/email": 20,
"fuel/oil": 20,
"fuel/orm": 20,
"fuel/parser": 20,
"fuel/docs": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=5.3.3" "php": ">=5.6.33"
}, },
"platform-dev": [] "platform-dev": []
} }

Binary file not shown.

@ -1,22 +1,60 @@
<?php <?php
use Fuel\Core\Controller_Template;
use Fuel\Core\Response; use Fuel\Core\Response;
use Fuel\Core\Session;
use Fuel\Core\View; use Fuel\Core\View;
class Controller_Admin extends Controller_Home class Controller_Admin extends Controller_Template
{ {
public $template = 'admin/body';
public function before() public function before()
{ {
parent::before(); parent::before();
$user = Session::get('user'); $user = Session::get('user');
if(!$user->admin) if(!$user)
Response::redirect('/login'); Response::redirect('/login');
if(!$user->admin)
Response::redirect('/home');
$this->template->user = Session::get('user');
$this->template->js_bottom = [];
} }
public function action_index() public function action_index()
{ {
Response::forge(View::forge('admin/index')); $body = View::forge('admin/index');
$this->template->body = $body;
}
public function action_servers()
{
$this->template->js_bottom = ['plex_alert.js', 'server_refresh.js'];
$body = View::forge('admin/servers');
$servers = Model_Server::find_all();
$body->set('servers', $servers);
$this->template->body = $body;
}
public function action_users()
{
$this->template->js_bottom = ['plex_alert.js'];
$body = View::forge('admin/users');
$users = Model_User::find_all();
$body->set('users', $users);
$this->template->body = $body;
} }
} }

@ -0,0 +1,36 @@
<?php
use Fuel\Core\Session;
use Fuel\Core\View;
class Controller_Admin_Libraries extends Controller_Admin
{
public function action_index()
{
$this->template->js_bottom = ['plex_alert.js', 'server_refresh.js'];
$body = View::forge('admin/libraries');
$libraries = Model_Library::find_all();
$body->set('libraries', $libraries);
$this->template->body = $body;
}
public function action_permissions()
{
$this->template->js_bottom = ['plex_alert.js'];
$body = View::forge('admin/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;
}
}

@ -12,23 +12,25 @@ class Controller_Home extends Controller_Template
public function before() public function before()
{ {
parent::before(); parent::before();
$user = Session::get('user'); $user = Session::get('user');
$sessionServer = Session::get('server'); $sessionServer = Session::get('server');
$sessionLibraries = Session::get('libraries');
if(!$user) if(!$user)
Response::redirect('/login'); Response::redirect('/login');
$server = $sessionServer ? Model_Server::find_by_pk($sessionServer->id) : Model_Server::find_all()[0]; $server = $sessionServer ? Model_Server::find_by_pk($sessionServer->id) : Model_Server::find_one_by('user_id', $user->id);
if(!$server) if(!$server)
Response::redirect('/login'); Response::redirect('/login');
$libraries = $sessionLibraries ?: $server->getLibraries(); //var_dump($sessionLibraries);die();
$libraries = $server->getLibraries();
$this->template->user = Session::get('user'); $this->template->user = Session::get('user');
$this->template->server = $server; $this->template->MenuServer = $server;
$this->template->libraries = $libraries; $this->template->MenuLibraries = $libraries;
$this->template->js_bottom = ['clappr.min.js', 'player.js']; $this->template->js_bottom = ['clappr.min.js', 'player.js'];
} }
@ -39,21 +41,21 @@ class Controller_Home extends Controller_Template
$server_id = $this->param('server_id'); $server_id = $this->param('server_id');
if($server_id) { if($server_id !== NULL) {
$server = Model_Server::find_by_pk($server_id); $server = Model_Server::find_by_pk($server_id);
if($server) if($server)
$this->template->server = $server; $this->template->MenuServer = $server;
} }
$this->template->libraries = $this->template->server->getLibraries(); Session::delete('server');
Session::set('server', $this->template->MenuServer);
Session::set('server', $this->template->server); $this->template->MenuLibraries = $this->template->MenuServer->getLibraries();
Session::set('libraries', $this->template->libraries);
$episodes = Model_Movie::getThirtyLastedTvShows($this->template->server); $episodes = Model_Movie::getThirtyLastedTvShows($this->template->MenuServer);
$movies = Model_Movie::getThirtyLastedMovies($this->template->server); $movies = Model_Movie::getThirtyLastedMovies($this->template->MenuServer);
$body->set('episodes', $episodes); $body->set('episodes', $episodes);
$body->set('movies', $movies); $body->set('movies', $movies);

@ -22,9 +22,17 @@ class Controller_Library extends Controller_Home
$content = null; $content = null;
if($library->type === 'movie') { if($library->type === 'movie') {
$content = Model_Movie::find_by('library_id', $library->id); $content = Model_Movie::find_by(function ($query) use ($library_id){
$query->where('library_id', $library_id)
->order_by('title', 'ASC')
;
});
} else if($library->type === 'show') { } else if($library->type === 'show') {
$content = Model_Tvshow::find_by('library_id', $library->id); $content = Model_Tvshow::find_by(function ($query) use ($library_id){
$query->where('library_id', $library_id)
->order_by('title', 'ASC')
;
});
} }
$body->set('movies', $content); $body->set('movies', $content);

@ -35,6 +35,9 @@ class Controller_Login extends Controller
if (Input::method() === 'POST') { if (Input::method() === 'POST') {
if($user = Model_User::Login($login, $password)) { if($user = Model_User::Login($login, $password)) {
$user->lastlogin = time();
$user->save();
Session::set('user', $user); Session::set('user', $user);
Response::redirect('/home'); Response::redirect('/home');
} }

@ -3,11 +3,6 @@
use Fuel\Core\Controller; use Fuel\Core\Controller;
use Fuel\Core\Response; use Fuel\Core\Response;
use Fuel\Core\Session; 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 class Controller_Logout extends Controller
{ {

@ -26,25 +26,32 @@ class Controller_Rest_Browse extends Controller_Rest
} }
if(!$server) if(!$server)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
$this->response($server); $this->response($server);
} }
public function get_library() public function get_library()
{ {
$library = Model_Library::find_one_by(function($query) { $library_id = Input::get('library_id');
$library = Model_Library::find_one_by(function($query) use ($library_id) {
$query $query
->select('library.*', 'server.id as server_id', 'server.name as server_name') ->select_array([
'library.*',
['server.id', 'server_id'],
['server.name', 'server_name']
])
->join('server', 'LEFT') ->join('server', 'LEFT')
->on('server.id', '=','library.server_id' ) ->on('server.id', '=','library.server_id' )
->where('server.user_id', Session::get('user')->id) ->where('server.user_id', Session::get('user')->id)
->and_where('library.id', $library_id)
->and_where('server.disable', 0) ->and_where('server.disable', 0)
; ;
}); });
if(!$library) if(!$library)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
$this->response($library); $this->response($library);
} }
@ -58,22 +65,25 @@ class Controller_Rest_Browse extends Controller_Rest
) )
)); ));
$this->response($servers); return $this->response($servers);
} }
public function put_server() public function put_server()
{ {
$server_id = Input::put('server_id'); try {
$server_id = Input::put('server_id');
$server = Model_Server::find_by('id', $server_id); $server = Model_Server::find_by('id', $server_id);
if (!$server)
return $this->response(array('error' => true, 'message' => 'No server found!'));
if(!$server) Model_Server::BrowseServeur($server);
$this->response(array('error' => true, 'message' => 'No server found!'));
Model_Server::BrowseServeur($server); return $this->response(['error' => false, 'message' => 'Servers informations update!']);
} catch (Exception $e) {
$this->response(['error' => false, 'message' => 'Servers informations update!']); return $this->response(['error' => true, 'message' => $e->getMessage()]);
}
} }
public function get_libraries() public function get_libraries()
@ -83,12 +93,12 @@ class Controller_Rest_Browse extends Controller_Rest
$server = Model_Server::find_by_pk($server_id); $server = Model_Server::find_by_pk($server_id);
if(!$server) if(!$server)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
$libraries = Model_Library::BrowseLibraries($server); $libraries = Model_Library::BrowseLibraries($server);
if(!$libraries) if(!$libraries)
$this->response(array('error' => true, 'message' => 'No library found!')); return $this->response(array('error' => true, 'message' => 'No library found!'));
$this->response(['error' => false, 'libraries' => $libraries]); $this->response(['error' => false, 'libraries' => $libraries]);
} }
@ -102,10 +112,10 @@ class Controller_Rest_Browse extends Controller_Rest
$library = Model_Library::find_by_pk($library_id); $library = Model_Library::find_by_pk($library_id);
if(!$server) if(!$server)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
if(!$library) if(!$library)
$this->response(array('error' => true, 'message' => 'No library found!')); return $this->response(array('error' => true, 'message' => 'No library found!'));
return Model_Library::getSectionsContent($server, $library); return Model_Library::getSectionsContent($server, $library);
} }
@ -119,15 +129,15 @@ class Controller_Rest_Browse extends Controller_Rest
$tvshow = Model_Tvshow::find_by_pk($tvshow_id); $tvshow = Model_Tvshow::find_by_pk($tvshow_id);
if(!$server) if(!$server)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
if(!$tvshow) if(!$tvshow)
$this->response(array('error' => true, 'message' => 'No tvshow found!')); return $this->response(array('error' => true, 'message' => 'No tvshow found!'));
$seasons = Model_Tvshow::getTvShowSeasons($server,$tvshow); $seasons = Model_Tvshow::getTvShowSeasons($server,$tvshow);
if(!$seasons) if(!$seasons)
$this->response(array('error' => true, 'message' => 'No season found!')); return $this->response(array('error' => true, 'message' => 'No season found!'));
$this->response(['error' => false, 'seasons' => $seasons]); $this->response(['error' => false, 'seasons' => $seasons]);
} }
@ -141,15 +151,15 @@ class Controller_Rest_Browse extends Controller_Rest
$season = Model_Season::find_by_pk($season_id); $season = Model_Season::find_by_pk($season_id);
if(!$server) if(!$server)
$this->response(array('error' => true, 'message' => 'No server found!')); return $this->response(array('error' => true, 'message' => 'No server found!'));
if(!$season) if(!$season)
$this->response(array('error' => true, 'message' => 'No season found!')); return $this->response(array('error' => true, 'message' => 'No season found!'));
$movies = Model_Season::getMovies($server,$season); $movies = Model_Season::getMovies($server,$season);
if(!$movies) if(!$movies)
$this->response(array('error' => true, 'message' => 'No movie found!')); return $this->response(array('error' => true, 'message' => 'No movie found!'));
$this->response(array_merge(['error' => false], $movies)); $this->response(array_merge(['error' => false], $movies));
} }

@ -8,6 +8,7 @@ use Fuel\Core\FuelException;
use Fuel\Core\Input; use Fuel\Core\Input;
use Fuel\Core\Request; use Fuel\Core\Request;
use Fuel\Core\Str; use Fuel\Core\Str;
use function PHPSTORM_META\type;
class Controller_Rest_Install extends Controller_Rest class Controller_Rest_Install extends Controller_Rest
{ {
@ -92,6 +93,7 @@ class Controller_Rest_Install extends Controller_Rest
'password' => array('constraint' => 255, 'type' => 'varchar'), 'password' => array('constraint' => 255, 'type' => 'varchar'),
'admin' => array('constraint' => 1, 'type' => 'int', 'default' => 0), 'admin' => array('constraint' => 1, 'type' => 'int', 'default' => 0),
'lastlogin' => array('constraint' => 11, 'type' => 'int'), 'lastlogin' => array('constraint' => 11, 'type' => 'int'),
'parent_id' => array('constraint' => 36, 'type' => 'varchar', 'default' => null, 'null' => true),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
@ -187,7 +189,7 @@ class Controller_Rest_Install extends Controller_Rest
'plex_key' => array('constraint' => 36, 'type' => 'varchar'), 'plex_key' => array('constraint' => 36, 'type' => 'varchar'),
'number' => array('constraint' => 11, 'type' => 'int'), 'number' => array('constraint' => 11, 'type' => 'int'),
'title' => array('constraint' => 255, 'type' => 'varchar'), 'title' => array('constraint' => 255, 'type' => 'varchar'),
'thumb' => array('constraint' => 255, 'type' => 'varchar'), 'thumb' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true), 'art' => array('constraint' => 255, 'type' => 'varchar', 'null' => true),
'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'leafCount' => array('constraint' => 11, 'type' => 'int', 'null' => true),
'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true), 'addedAt' => array('constraint' => 11, 'type' => 'int', 'null' => true),
@ -304,12 +306,32 @@ class Controller_Rest_Install extends Controller_Rest
'id' => array('constraint' => 36, 'type' => 'varchar'), 'id' => array('constraint' => 36, 'type' => 'varchar'),
'file_id' => array('constraint' => 11, 'type' => 'int'), 'file_id' => array('constraint' => 11, 'type' => 'int'),
'user_id' => array('constraint' => 36, 'type' => 'varchar'), 'user_id' => array('constraint' => 36, 'type' => 'varchar'),
'watching_time' => array('constraint' => 11, 'type' => 'int'),
'ended' => array('constraint' => 1, 'type' => 'int', 'default' => 0),
'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0) 'disable' => array('constraint' => 1, 'type' => 'int', 'default' => 0)
), ),
array('id'), false, 'InnoDB', 'utf8_unicode_ci' array('id'), false, 'InnoDB', 'utf8_unicode_ci'
); );
$logs .= 'User Watching table create!'."\r\n"; $logs .= 'User Watching table create!'."\r\n";
$logs .= 'Creation table user settings'."\r\n";
/**
* CREATE TABLE USER'S WATCHING
*/
DBUtil::create_table(
'user_settings',
array(
'id' => array('constraint' => 36, 'type' => 'varchar'),
'language' => array('constraint' => 36, 'type' => 'varchar'),
'refresh' => array('constraint' => 11, 'type' => 'int'),
'trailer' => array('constraint' => 11, 'type' => 'int', 'default' => 0),
'subtitle' => array('constraint' => 11, 'type' => 'int'),
'quality' => array('constraint' => 11, 'type' => 'int', 'default' => -1)
),
array('id'), false, 'InnoDB', 'utf8_unicode_ci'
);
$logs .= 'User Watching table create!'."\r\n";
$logs .= 'Create Foreign key'."\r\n"; $logs .= 'Create Foreign key'."\r\n";
/** /**
* FOREIGN KEY * FOREIGN KEY
@ -434,6 +456,16 @@ class Controller_Rest_Install extends Controller_Rest
'on_update' => 'NO ACTION', 'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION', 'on_delete' => 'NO ACTION',
)); ));
DBUtil::add_foreign_key('user', array(
'constraint' => 'constraintUserUser',
'key' => 'parent_id',
'reference' => array(
'table' => 'user',
'column' => 'id',
),
'on_update' => 'NO ACTION',
'on_delete' => 'NO ACTION',
));
$logs .= 'Foreign key create!'."\r\n"; $logs .= 'Foreign key create!'."\r\n";

@ -30,7 +30,7 @@ class Controller_Rest_Settings extends Controller_Rest
if(!$result) if(!$result)
throw new FuelException('Can not connect to your server!'); throw new FuelException('Can not connect to your server!');
$server = $server_id === null ? Model_Server::forge() : Model_Server::find_by_pk($server_id); $server = ($server_id === '' ? Model_Server::forge() : Model_Server::find_by_pk($server_id));
$server->set([ $server->set([
'user_id' => Session::get('user')->id, 'user_id' => Session::get('user')->id,
'url' => $url, 'url' => $url,
@ -66,6 +66,34 @@ class Controller_Rest_Settings extends Controller_Rest
} }
} }
public function put_library()
{
try {
$library = Input::put('library_id');
$library = Model_Library::find_one_by(function($query) use($library) {
$query
->join('server', 'LEFT')
->on('server.id', '=','library.server_id' )
->where('server.user_id', Session::get('user')->id)
->and_where('library.id', $library)
->and_where('library.disable', 1)
->and_where('server.disable', 0)
;
});
if(!$library)
throw new FuelException('No disable library found!');
$library->set(['disable' => 0]);
$library->save();
return $this->response(array('error' => false));
} catch (FuelException $e) {
return $this->response(array('error' => true, 'message' => $e->getMessage() ?: 'Wrong parameters'), 400);
}
}
public function delete_library() public function delete_library()
{ {
try { try {

@ -1,6 +1,8 @@
<?php <?php
use Fuel\Core\FuelException;
class Model_Library extends Model_Overwrite class Model_Library extends Model_Overwrite
{ {
protected static $_table_name = 'library'; protected static $_table_name = 'library';
@ -49,67 +51,66 @@ class Model_Library extends Model_Overwrite
* List all libraries and register it in database * List all libraries and register it in database
* @param $server * @param $server
* @return bool | array * @return bool | array
* @throws Exception * @throws FuelException
* @throws HttpNotFoundException
* @throws \FuelException
*/ */
public static function BrowseLibraries($server) public static function BrowseLibraries($server)
{ {
$libraries_id_array = []; try {
$libraries_id_array = [];
$curl = Request::forge('http://' . $server->url . ($server->port? ':' . $server->port : '') . '/library/sections?X-Plex-Token=' . $server->token, 'curl'); $curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . '/library/sections?X-Plex-Token=' . $server->token, 'curl');
$curl->execute(); $curl->execute();
if($curl->response()->status !== 200) if ($curl->response()->status !== 200)
return false; return false;
$list_libraries = Format::forge($curl->response()->body, 'xml')->to_array(); $list_libraries = Format::forge($curl->response()->body, 'xml')->to_array();
if(!isset($list_libraries['Directory'])) if (!isset($list_libraries['Directory']))
return false; return false;
$list_libraries = $list_libraries['Directory']; $list_libraries = $list_libraries['Directory'];
foreach ($list_libraries as $index => $library) { foreach ($list_libraries as $index => $library) {
$library = !isset($list_libraries['@attributes']) ? $library : $list_libraries; $library = !isset($list_libraries['@attributes']) ? $library : $list_libraries;
$new_library = Model_Library::find_by_pk($library['@attributes']['uuid']) ?: Model_Library::forge(); $new_library = Model_Library::find_by_pk($library['@attributes']['uuid']) ?: Model_Library::forge();
if(isset($new_library->disable) && $new_library->disable) if ((isset($new_library->disable) && $new_library->disable) || ($library['@attributes']['type'] !== 'show' && $library['@attributes']['type'] !== 'movie'))
continue; continue;
$libraries_id_array[] = ['id' => $library['@attributes']['uuid'], 'name' => $library['@attributes']['title']]; $libraries_id_array[] = ['id' => $library['@attributes']['uuid'], 'name' => $library['@attributes']['title']];
$new_library->set(array( $new_library->set(array(
'id' => $library['@attributes']['uuid'], 'id' => $library['@attributes']['uuid'],
'plex_key' => $library['@attributes']['key'], 'plex_key' => $library['@attributes']['key'],
'server_id' => $server->id, 'server_id' => $server->id,
'name' => $library['@attributes']['title'], 'name' => $library['@attributes']['title'],
'type' => $library['@attributes']['type'], 'type' => $library['@attributes']['type'],
'updatedAt' => $library['@attributes']['updatedAt'], 'updatedAt' => $library['@attributes']['updatedAt'],
'createdAt' => $library['@attributes']['createdAt'], 'createdAt' => $library['@attributes']['createdAt'],
'scannedAt' => $library['@attributes']['scannedAt'] 'scannedAt' => $library['@attributes']['scannedAt']
)); ));
$new_library->save(); $new_library->save();
//self::getSectionsContent($server, $new_library); //self::getSectionsContent($server, $new_library);
if(isset($list_libraries['@attributes'])) if (isset($list_libraries['@attributes']))
break; break;
} }
return $libraries_id_array; return $libraries_id_array;
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
}
} }
/** /**
* @param $server * @param $server
* @param $library * @param $library
* @return bool * @return bool
* @throws Exception
* @throws FuelException * @throws FuelException
* @throws HttpNotFoundException
* @throws \FuelException
*/ */
public static function getSectionsContent($server, $library) public static function getSectionsContent($server, $library)
{ {

@ -157,6 +157,10 @@ class Model_Movie extends Model_Overwrite
} }
} }
/**
* @return array|mixed
* @throws FuelException
*/
public function getMetaData() public function getMetaData()
{ {
try { try {
@ -183,8 +187,26 @@ class Model_Movie extends Model_Overwrite
//ROLES //ROLES
$this->metadata['Role'] = isset($array['Video']['Role']) ? $array['Video']['Role'] : null; $this->metadata['Role'] = isset($array['Video']['Role']) ? $array['Video']['Role'] : null;
$this->metadata['Stream'] = [];
$this->metadata['Stream']['Video'] = [];
$this->metadata['Stream']['Audio'] = [];
$this->metadata['Stream']['SubTitle'] = [];
if(isset($array['Video']['Media']['Part']['Stream'])) {
foreach ($array['Video']['Media']['Part']['Stream'] as $stream) {
if($stream['@attributes']['streamType'] === '1')
$this->metadata['Stream']['Video'][] = $stream['@attributes'];
else if($stream['@attributes']['streamType'] === '2')
$this->metadata['Stream']['Audio'][] = $stream['@attributes'];
else if($stream['@attributes']['streamType'] === '3')
$this->metadata['Stream']['SubTitle'][] = $stream['@attributes'];
}
}
Cache::set($this->id . '.metadata', $this->metadata); Cache::set($this->id . '.metadata', $this->metadata);
return $this->metadata; return $this->metadata;
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
} }
} }
@ -208,7 +230,7 @@ class Model_Movie extends Model_Overwrite
return ($hours > 0 ? $hours . ' h ' : '') . $minutes . ' min'; return ($hours > 0 ? $hours . ' h ' : '') . $minutes . ' min';
} }
public function getDuractionMovie() public function getDurationMovie()
{ {
$init = $this->duration; $init = $this->duration;
@ -225,7 +247,7 @@ class Model_Movie extends Model_Overwrite
if (!$this->_server) if (!$this->_server)
$this->getServer(); $this->getServer();
$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl'); $curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start.m3u8?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl');
//$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&videoResolution=576x320&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl'); //$curl = Request::forge('http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/start?identifier=[PlexShare]&path=http%3A%2F%2F127.0.0.1%3A32400' . urlencode($this->plex_key) . '&mediaIndex=0&partIndex=0&protocol=hls&offset=0&fastSeek=1&directStream=0&directPlay=1&videoQuality=100&videoResolution=576x320&maxVideoBitrate=2294&subtitleSize=100&audioBoost=100&X-Plex-Platform=Chrome&X-Plex-Token=' . $this->_server->token, 'curl');
$curl->execute(); $curl->execute();
@ -245,8 +267,8 @@ class Model_Movie extends Model_Overwrite
$this->_session = $split[1]; $this->_session = $split[1];
return 'http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/session/' . $this->_session . '/base/index.m3u8'; return 'http://' . $this->_server->url . ($this->_server->port ? ':' . $this->_server->port : '') . '/video/:/transcode/universal/session/' . $this->_session . '/base/index.m3u8';
}catch (Exception $exception) { } catch (Exception $exception) {
throw new FuelException('TOKEN MAYBE OUTDATED',$exception->getCode()); throw new FuelException('Cannot connect to the server.<br/>The token must be outdated!',$exception->getCode());
} }
} }
@ -298,9 +320,9 @@ class Model_Movie extends Model_Overwrite
'summary' => $XMLmovie['@attributes']['summary'], 'summary' => $XMLmovie['@attributes']['summary'],
'rating' => isset($XMLmovie['@attributes']['rating']) ? $XMLmovie['@attributes']['rating'] : null, 'rating' => isset($XMLmovie['@attributes']['rating']) ? $XMLmovie['@attributes']['rating'] : null,
'year' => isset($XMLmovie['@attributes']['year']) ? $XMLmovie['@attributes']['year'] : null, 'year' => isset($XMLmovie['@attributes']['year']) ? $XMLmovie['@attributes']['year'] : null,
'thumb' => $XMLmovie['@attributes']['thumb'], 'thumb' => isset($XMLmovie['@attributes']['thumb']) ? $XMLmovie['@attributes']['thumb'] : null,
'art' => isset($XMLmovie['@attributes']['art']) ? $XMLmovie['@attributes']['art'] : null, 'art' => isset($XMLmovie['@attributes']['art']) ? $XMLmovie['@attributes']['art'] : null,
'duration' => $XMLmovie['@attributes']['duration'], 'duration' => isset($XMLmovie['@attributes']['duration']) ? $XMLmovie['@attributes']['duration'] : null,
'originallyAvailableAt' => isset($XMLmovie['@attributes']['originallyAvailableAt']) ? $XMLmovie['@attributes']['originallyAvailableAt'] : null, 'originallyAvailableAt' => isset($XMLmovie['@attributes']['originallyAvailableAt']) ? $XMLmovie['@attributes']['originallyAvailableAt'] : null,
'addedAt' => $XMLmovie['@attributes']['addedAt'], 'addedAt' => $XMLmovie['@attributes']['addedAt'],
'updatedAt' => $XMLmovie['@attributes']['updatedAt'] 'updatedAt' => $XMLmovie['@attributes']['updatedAt']

@ -1,5 +1,7 @@
<?php <?php
use Fuel\Core\FuelException;
class Model_Season extends Model_Overwrite class Model_Season extends Model_Overwrite
{ {
protected static $_table_name = 'season'; protected static $_table_name = 'season';
@ -102,69 +104,79 @@ class Model_Season extends Model_Overwrite
* @param $server * @param $server
* @param $seasons * @param $seasons
* @param $tvshow * @param $tvshow
* @return bool * @return array
* @throws Exception
* @throws FuelException * @throws FuelException
* @throws HttpNotFoundException
* @throws \FuelException
*/ */
public static function BrowseSeason($server, $seasons, $tvshow) public static function BrowseSeason($server, $seasons, $tvshow)
{ {
$season_id_array = []; try {
$season_id_array = [];
foreach ($seasons as $XMLseason) {
$XMLseason = !isset($seasons['@attributes']) ? $XMLseason : $seasons; foreach ($seasons as $XMLseason) {
$XMLseason = !isset($seasons['@attributes']) ? $XMLseason : $seasons;
// Not browsing array ALL EPISODES
if($seasons[0] === $XMLseason) // Not browsing array ALL EPISODES
continue; if (isset($seasons[0]) && $seasons[0] === $XMLseason)
continue;
$tvshow_id = $tvshow->id;
$tvshow_id = $tvshow->id;
$season = Model_Season::find(function ($query) use ($XMLseason, $tvshow_id){
/** @var Database_Query_Builder_Select $query */ $season = Model_Season::find(function ($query) use ($XMLseason, $tvshow_id) {
return $query /** @var Database_Query_Builder_Select $query */
->select('*') return $query
->where('plex_key', $XMLseason['@attributes']['key']) ->select('*')
->and_where('tv_show_id', $tvshow_id) ->where('plex_key', $XMLseason['@attributes']['key'])
; ->and_where('tv_show_id', $tvshow_id);
})[0] ?: Model_Season::forge(); })[0] ?: Model_Season::forge();
$season->set([ $season->set([
'tv_show_id' => $tvshow->id, 'tv_show_id' => $tvshow->id,
'plex_key' => $XMLseason['@attributes']['key'], 'plex_key' => $XMLseason['@attributes']['key'],
'number' => $XMLseason['@attributes']['index'], 'number' => $XMLseason['@attributes']['index'],
'title' => $XMLseason['@attributes']['title'], 'title' => $XMLseason['@attributes']['title'],
'thumb' => $XMLseason['@attributes']['thumb'], 'thumb' => isset($XMLseason['@attributes']['thumb']) ? $XMLseason['@attributes']['thumb'] : null,
'art' => isset($XMLseason['@attributes']['art']) ? $XMLseason['@attributes']['art'] : null, 'art' => isset($XMLseason['@attributes']['art']) ? $XMLseason['@attributes']['art'] : null,
'leafCount' => $XMLseason['@attributes']['leafCount'], 'leafCount' => isset($XMLseason['@attributes']['leafCount']) ? $XMLseason['@attributes']['leafCount'] : null,
'addedAt' => $XMLseason['@attributes']['addedAt'], 'addedAt' => $XMLseason['@attributes']['addedAt'],
'updatedAt' => $XMLseason['@attributes']['updatedAt'] 'updatedAt' => isset($XMLseason['@attributes']['updatedAt']) ? $XMLseason['@attributes']['updatedAt'] : null
]); ]);
$season->save(); $season->save();
$season_id_array[] = ['id' => $season->id, 'name' => $season->title]; $season_id_array[] = ['id' => $season->id, 'name' => $season->title];
if(isset($seasons['@attributes'])) if (isset($seasons['@attributes']))
break; break;
}
return $season_id_array;
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
} }
return $season_id_array;
} }
/**
* @param $server
* @param $season
* @return array|bool
* @throws FuelException
*/
public static function getMovies($server, $season) public static function getMovies($server, $season)
{ {
$curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . $season->plex_key . '?X-Plex-Token=' . $server->token, 'curl'); try {
$curl->execute(); $curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . $season->plex_key . '?X-Plex-Token=' . $server->token, 'curl');
$curl->execute();
if ($curl->response()->status !== 200) if ($curl->response()->status !== 200)
return false; return false;
$movies = Format::forge($curl->response()->body, 'xml')->to_array(); $movies = Format::forge($curl->response()->body, 'xml')->to_array();
if(isset($movies['Video'])) if (isset($movies['Video']))
return ['movies' => Model_Movie::BrowseMovies($server, $movies['Video'], null, $season)]; return ['movies' => Model_Movie::BrowseMovies($server, $movies['Video'], null, $season)];
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
}
} }
public function getEpisodes() public function getEpisodes()

@ -53,38 +53,42 @@ class Model_Server extends Model_Overwrite
*/ */
public static function BrowseServeur($_servers = null) public static function BrowseServeur($_servers = null)
{ {
$servers = $_servers ?: Model_Server::find(); $servers = $_servers ?: Model_Server::find_all();
foreach ($servers as $server) { foreach ($servers as $server) {
if($server->disable) try{
continue; if($server->disable)
continue;
$curl = Request::forge('http://' . $server->url . ($server->port? ':' . $server->port : '') . '/?X-Plex-Token=' . $server->token, 'curl'); $curl = Request::forge('http://' . $server->url . ($server->port? ':' . $server->port : '') . '/?X-Plex-Token=' . $server->token, 'curl');
$curl->execute(); $curl->execute();
$dataServer = Format::forge($curl->response()->body, 'xml')->to_array(); $dataServer = Format::forge($curl->response()->body, 'xml')->to_array();
if (!isset($dataServer['@attributes'])) { if (!isset($dataServer['@attributes'])) {
$server->set('online', 0); $server->set(['online' => 0]);
$server->save(); $server->save();
} }
$dataServer = $dataServer['@attributes'];
$server->set(['lastcheck' => time()]); $dataServer = $dataServer['@attributes'];
($server->name !== $dataServer['friendlyName']) ? $server->set(['name' => $dataServer['friendlyName']]) : null; $server->set(['lastcheck' => time()]);
($server->name !== $dataServer['platform']) ? $server->set(['plateforme' => $dataServer['platform']]) : null;
($server->name !== $dataServer['platformVersion']) ? $server->set(['platformVersion' => $dataServer['platformVersion']]) : null;
($server->name !== $dataServer['updatedAt']) ? $server->set(['updatedAt' => $dataServer['updatedAt']]) : null;
($server->name !== $dataServer['version']) ? $server->set(['version' => $dataServer['version']]) : null;
$server->set(['online' => 1]); ($server->name !== $dataServer['friendlyName']) ? $server->set(['name' => $dataServer['friendlyName']]) : null;
($server->plateforme !== $dataServer['platform']) ? $server->set(['plateforme' => $dataServer['platform']]) : null;
($server->platformVersion !== $dataServer['platformVersion']) ? $server->set(['platformVersion' => $dataServer['platformVersion']]) : null;
($server->updatedAt !== $dataServer['updatedAt']) ? $server->set(['updatedAt' => $dataServer['updatedAt']]) : null;
($server->version !== $dataServer['version']) ? $server->set(['version' => $dataServer['version']]) : null;
$server->save(); $server->set(['online' => 1]);
//Model_Library::BrowseLibraries($server); $server->save();
}catch (Exception $exception) {
$server->set(['online' => 0]);
$server->save();
throw new FuelException($exception->getMessage(),$exception->getCode());
}
} }
} }

@ -1,6 +1,7 @@
<?php <?php
use Fuel\Core\CacheNotFoundException; use Fuel\Core\CacheNotFoundException;
use Fuel\Core\FuelException;
class Model_Tvshow extends Model_Overwrite class Model_Tvshow extends Model_Overwrite
{ {
@ -132,78 +133,96 @@ class Model_Tvshow extends Model_Overwrite
* @param $library * @param $library
* @return bool | array * @return bool | array
* @throws Exception * @throws Exception
* @throws HttpNotFoundException * @throws FuelException
* @throws \FuelException
*/ */
public static function BrowseTvShow($server, $subsections, $library) public static function BrowseTvShow($server, $subsections, $library)
{ {
try {
$tvshows_id_array = []; $tvshows_id_array = [];
foreach ($subsections as $subsection) { foreach ($subsections as $subsection) {
$subsection = !isset($subsections['@attributes']) ? $subsection : $subsections; $subsection = !isset($subsections['@attributes']) ? $subsection : $subsections;
$library_id = $library->id; $library_id = $library->id;
$tvshow = Model_Tvshow::find(function ($query) use ($subsection, $library_id){ $tvshow = Model_Tvshow::find(function ($query) use ($subsection, $library_id) {
/** @var Database_Query_Builder_Select $query */ /** @var Database_Query_Builder_Select $query */
return $query return $query
->select('*') ->select('*')
->where('plex_key', $subsection['@attributes']['key']) ->where('plex_key', $subsection['@attributes']['key'])
->and_where('library_id', $library_id) ->and_where('library_id', $library_id);
; })[0] ?: Model_Tvshow::forge();
})[0] ?: Model_Tvshow::forge();
$tvshow->set([
$tvshow->set([ 'library_id' => $library->id,
'library_id' => $library->id, 'plex_key' => $subsection['@attributes']['key'],
'plex_key' => $subsection['@attributes']['key'], 'studio' => isset($subsection['@attributes']['studio']) ? $subsection['@attributes']['studio'] : null,
'studio' => isset($subsection['@attributes']['studio']) ? $subsection['@attributes']['studio'] : null, 'title' => $subsection['@attributes']['title'],
'title' => $subsection['@attributes']['title'], 'contentRating' => isset($subsection['@attributes']['contentRating']) ? $subsection['@attributes']['contentRating'] : null,
'contentRating' => isset($subsection['@attributes']['contentRating']) ? $subsection['@attributes']['contentRating'] : null, 'summary' => isset($subsection['@attributes']['summary']) ? $subsection['@attributes']['summary'] : null,
'summary' => isset($subsection['@attributes']['summary']) ? $subsection['@attributes']['summary'] : null, 'rating' => isset($subsection['@attributes']['rating']) ? $subsection['@attributes']['rating'] : null,
'rating' => isset($subsection['@attributes']['rating']) ? $subsection['@attributes']['rating'] : null, 'year' => isset($subsection['@attributes']['year']) ? $subsection['@attributes']['year'] : null,
'year' => isset($subsection['@attributes']['year']) ? $subsection['@attributes']['year'] : null, 'thumb' => isset($subsection['@attributes']['thumb']) ? $subsection['@attributes']['thumb'] : null,
'thumb' => isset($subsection['@attributes']['thumb']) ? $subsection['@attributes']['thumb'] : null, 'art' => isset($subsection['@attributes']['art']) ? $subsection['@attributes']['art'] : null,
'art' => isset($subsection['@attributes']['art']) ? $subsection['@attributes']['art'] : null, 'banner' => isset($subsection['@attributes']['banner']) ? $subsection['@attributes']['banner'] : null,
'banner' => isset($subsection['@attributes']['banner']) ? $subsection['@attributes']['banner'] : null, 'theme' => isset($subsection['@attributes']['theme']) ? $subsection['@attributes']['theme'] : null,
'theme' => isset($subsection['@attributes']['theme']) ? $subsection['@attributes']['theme'] : null, 'originallyAvailableAt' => isset($subsection['@attributes']['originallyAvailableAt']) ? $subsection['@attributes']['originallyAvailableAt'] : null,
'originallyAvailableAt' => isset($subsection['@attributes']['originallyAvailableAt']) ? $subsection['@attributes']['originallyAvailableAt'] : null, 'leafCount' => isset($subsection['@attributes']['leafCount']) ? $subsection['@attributes']['leafCount'] : null,
'leafCount' => $subsection['@attributes']['leafCount'], 'addedAt' => $subsection['@attributes']['addedAt'],
'addedAt' => $subsection['@attributes']['addedAt'], 'updatedAt' => isset($subsection['@attributes']['updatedAt']) ? $subsection['@attributes']['updatedAt'] : null
'updatedAt' => $subsection['@attributes']['updatedAt'] ]);
]);
$tvshow->save();
$tvshow->save();
$tvshows_id_array[] = ['id' => $tvshow->id, 'name' => $tvshow->title];
$tvshows_id_array[] = ['id' => $tvshow->id, 'name' => $tvshow->title];
//self::getTvShowSeasons($server, $tvshow);
//self::getTvShowSeasons($server, $tvshow);
if (isset($subsections['@attributes']))
if(isset($subsections['@attributes'])) break;
break; }
return $tvshows_id_array;
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
} }
return $tvshows_id_array;
} }
/**
* @param $server
* @param $tvshow
* @return array|bool
* @throws FuelException
*/
public static function getTvShowSeasons($server, $tvshow) public static function getTvShowSeasons($server, $tvshow)
{ {
$curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . $tvshow->plex_key . '?X-Plex-Token=' . $server->token, 'curl'); try {
$curl->execute(); $curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . $tvshow->plex_key . '?X-Plex-Token=' . $server->token, 'curl');
$curl->execute();
if ($curl->response()->status !== 200) if ($curl->response()->status !== 200)
return false; return false;
$seasons = Format::forge($curl->response()->body, 'xml')->to_array(); $seasons = Format::forge($curl->response()->body, 'xml')->to_array();
if(isset($seasons['Directory'])) if (isset($seasons['Directory']))
return Model_Season::BrowseSeason($server, $seasons['Directory'], $tvshow); return Model_Season::BrowseSeason($server, $seasons['Directory'], $tvshow);
} catch (Exception $exception) {
throw new FuelException($exception->getMessage(),$exception->getCode());
}
} }
public function getSeasons() public function getSeasons()
{ {
if(!$this->_seasons) if(!$this->_seasons) {
$this->_seasons = Model_Season::find_by('tv_show_id', $this->id); $id = $this->id;
$this->_seasons = Model_Season::find_by(function ($query) use ($id) {
$query
->where('tv_show_id', $id)
->order_by('number', 'ASC')
;
});
}
return $this->_seasons; return $this->_seasons;
} }

@ -38,10 +38,11 @@ class Model_User extends Model_Overwrite
{ {
$result = self::find_one_by(function ($query) use ($login,$password){ $result = self::find_one_by(function ($query) use ($login,$password){
return $query return $query
->where('user.password', $password) ->where('password', $password)
->and_where('parent_id', null)
->and_where_open() ->and_where_open()
->where('user.email', $login) ->where('email', $login)
->or_where('user.username', $login) ->or_where('username', $login)
->and_where_close() ->and_where_close()
; ;
}); });
@ -51,4 +52,22 @@ class Model_User extends Model_Overwrite
else else
return false; return false;
} }
public function getLastLogin()
{
$dateString = date('Y/m/d H:i:s', time());
$now = new DateTime($dateString);
$dateString = date('Y-m-d H:i:s', $this->lastlogin);
$time = new DateTime($dateString);
$diff = date_diff($now, $time);
$days = $diff->days . 'd ';
$hours = $diff->h . 'h ';
$minutes = $diff->i . 'min ';
$seconds = $diff->s . 's';
return $days.$hours.$minutes.$seconds;
}
} }

@ -43,7 +43,7 @@ return array(
*/ */
// 'index_file' => false, // 'index_file' => false,
// 'profiling' => false, 'profiling' => true,
/** /**
* Default location for the file cache * Default location for the file cache
@ -188,7 +188,7 @@ return array(
/** /**
* Cookie settings * Cookie settings
*/ */
// 'cookie' => array( 'cookie' => array(
// Number of seconds before the cookie expires // Number of seconds before the cookie expires
// 'expiration' => 0, // 'expiration' => 0,
// Restrict the path that the cookie is available to // Restrict the path that the cookie is available to
@ -196,10 +196,10 @@ return array(
// Restrict the domain that the cookie is available to // Restrict the domain that the cookie is available to
// 'domain' => null, // 'domain' => null,
// Only transmit cookies over secure connections // Only transmit cookies over secure connections
// 'secure' => false, // 'secure' => true,
// Only transmit cookies over HTTP, disabling Javascript access // Only transmit cookies over HTTP, disabling Javascript access
// 'http_only' => false, // 'http_only' => true,
// ), ),
/** /**
* Validation settings * Validation settings

@ -44,7 +44,7 @@ return array(
'cookie_path' => '/', 'cookie_path' => '/',
// cookie http_only flag (optional, default = use the cookie class default) // cookie http_only flag (optional, default = use the cookie class default)
'cookie_http_only' => true, 'cookie_http_only' => null,
// whether or not to encrypt the session cookie (optional, default is true) // whether or not to encrypt the session cookie (optional, default is true)
'encrypt_cookie' => true, 'encrypt_cookie' => true,
@ -85,19 +85,19 @@ return array(
// special configuration settings for cookie based sessions // special configuration settings for cookie based sessions
'cookie' => array( 'cookie' => array(
'cookie_name' => 'plexshare_ccn', // name of the session cookie for cookie based sessions 'cookie_name' => 'plexshare_cid', // name of the session cookie for cookie based sessions
), ),
// specific configuration settings for file based sessions // specific configuration settings for file based sessions
'file' => array( 'file' => array(
'cookie_name' => 'plexshare_fcn', // name of the session cookie for file based sessions 'cookie_name' => 'plexshare_fid', // name of the session cookie for file based sessions
'path' => '/tmp', // path where the session files should be stored 'path' => '/tmp', // path where the session files should be stored
'gc_probability' => 5, // probability % (between 0 and 100) for garbage collection 'gc_probability' => 5, // probability % (between 0 and 100) for garbage collection
), ),
// specific configuration settings for memcached based sessions // specific configuration settings for memcached based sessions
'memcached' => array( 'memcached' => array(
'cookie_name' => 'plexshare_mcn', // name of the session cookie for memcached based sessions 'cookie_name' => 'plexshare_mid', // name of the session cookie for memcached based sessions
'servers' => array( // array of servers and portnumbers that run the memcached service 'servers' => array( // array of servers and portnumbers that run the memcached service
'default' => array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 'default' => array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
), ),
@ -105,7 +105,7 @@ return array(
// specific configuration settings for database based sessions // specific configuration settings for database based sessions
'db' => array( 'db' => array(
'cookie_name' => 'plexshare_dcn', // name of the session cookie for database based sessions 'cookie_name' => 'plexshare_did', // name of the session cookie for database based sessions
'database' => null, // name of the database name (as configured in config/db.php) 'database' => null, // name of the database name (as configured in config/db.php)
'table' => 'sessions', // name of the sessions table 'table' => 'sessions', // name of the sessions table
'gc_probability' => 5, // probability % (between 0 and 100) for garbage collection 'gc_probability' => 5, // probability % (between 0 and 100) for garbage collection
@ -113,7 +113,7 @@ return array(
// specific configuration settings for redis based sessions // specific configuration settings for redis based sessions
'redis' => array( 'redis' => array(
'cookie_name' => 'plexshare_rcn', // name of the session cookie for redis based sessions 'cookie_name' => 'plexshare_rid', // name of the session cookie for redis based sessions
'database' => 'default', // name of the redis database to use (as configured in config/db.php) 'database' => 'default', // name of the redis database to use (as configured in config/db.php)
), ),
); );

@ -0,0 +1,133 @@
<?php
namespace Fuel\Tasks;
use Exception;
use Fuel\Core\FuelException;
use Model_Library;
use Model_Season;
use Model_Server;
use Model_Tvshow;
use function time;
use Fuel\Core\Request;
use function var_dump;
class Server
{
public function run($message = 'Hello!')
{
echo $message;
}
public function ping()
{
$servers = Model_Server::find();
foreach ($servers as $server) {
try {
$curl = Request::forge('http://' . $server->url . ($server->port ? ':' . $server->port : '') . '?X-Plex-Token=' . $server->token, 'curl');
$curl->execute();
if ($curl->response()->status !== 200)
throw new FuelException('No session found!');
$server->set([
'lastcheck' => time(),
'online' => 1
]);
$server->save();
} catch (Exception $exception) {
$server->set([
'lastcheck' => time(),
'online' => 0
]);
$server->save();
}
}
}
public function browseServers()
{
$time = ini_get('max_execution_time');
$servers = Model_Server::find_all();
if($time > 0 && $time < ($servers * 5 * 60)) {
ini_set('max_execution_time', 5 * $servers);
}
foreach ($servers as $server) {
try {
Model_Server::BrowseServeur([$server]);
} catch (Exception $exception) {
echo 'Server: ' . $server->name . ' ERROR: ' . $exception->getMessage() . "\n\r";
}
try {
$this->browseLibraries($server);
} catch (Exception $exception) {
}
}
}
private function browseLibraries($server)
{
Model_Library::BrowseLibraries($server);
$this->browseSubContent($server);
}
private function browseSubContent($server)
{
$libraries = Model_Library::find_by('server_id',$server->id);
foreach ($libraries as $library) {
Model_Library::getSectionsContent($server, $library);
}
$this->browseSeasons($server);
}
private function browseSeasons($server)
{
$server_id = $server->id;
$tv_shows = Model_Tvshow::find(function ($query) use ($server_id) {
$query
->select('tvshow.*')
->join('library')
->on('tvshow.library_id', '=', 'library.id')
->where('library.server_id', $server_id)
;
});
foreach ($tv_shows as $tv_show) {
Model_Tvshow::getTvShowSeasons($server,$tv_show);
}
$this->browseMovies($server);
}
private function browseMovies($server)
{
$server_id = $server->id;
$seasons = Model_Season::find(function ($query) use ($server_id) {
$query
->select('season.*')
->join('tvshow')
->on('season.tv_show_id', '=', 'tvshow.id')
->join('library')
->on('tvshow.library_id', '=', 'library.id')
->where('library.server_id', $server_id)
;
});
foreach ($seasons as $season) {
Model_Season::getMovies($server,$season);
}
}
}

@ -0,0 +1,51 @@
<head>
<title>PlexShare :: Administration</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<?php
echo \Asset::css(['normalize.css', 'plex.css', 'settings.css']);
echo \Asset::js('jquery.min.js');
?>
<link rel="shortcut icon"
href="//assets.plex.tv/deploys/desktop/env-eb2798cc3c7d9533df5b563963d5c394/3.34.1-b51c37a/favicon.ico">
</head>
<body>
<div id="plex" class="application">
<?php echo \View::forge('layout/nav_bar_header', ['user' => $user]); ?>
<div class="background-container">
<div data-reactroot="" class="FullPage-container-17Y0c">
<div>
<div>
<div style="background-image: url('//assets.plex.tv/deploys/desktop/env-eb2798cc3c7d9533df5b563963d5c394/3.41.1-304f788/common/img/backgrounds/preset-dark.64cc1c942221cd2c153244bd8ecfb67a.png'); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;"
class=""></div>
</div>
<div style="position: absolute; width: 100%; height: 100%; background: rgba(0, 0, 0, 0) url('//assets.plex.tv/deploys/desktop/env-eb2798cc3c7d9533df5b563963d5c394/3.41.1-304f788/common/img/backgrounds/noise.8b05ce45d0df59343e206bc9ae78d85d.png') repeat scroll 0% 0%; z-index: 2;"></div>
</div></div>
</div>
<div id="content" class="scroll-container dark-scrollbar">
<div class="container">
<ul class="nav nav-header pull-right">
<li class="web-nav-item"><a class="web-btn btn-gray" href="/admin">General</a></li>
<li class="server-nav-item "><a class="server-btn btn-gray" href="/admin/servers">All Servers<span class="badge">0</span></a></li>
<li class="users-nav-item "><a class="users-btn btn-gray" href="/admin/libraries">All Libraries<span class="badge">0</span></a></li>
<li class="devices-nav-item "><a class="devices-btn btn-gray" href="/admin/users">Users</a></li>
</ul>
<h2>Administration</h2>
<?php echo $body; ?>
</div>
</div>
<div>
</div>
</div>
<?php
echo \Asset::js(isset($js_bottom) ? $js_bottom : null);
echo \Asset::js(['bootstrap.min.js']);
?>
<script>
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip({ container: 'body'});
});
</script>
</body>
</html>

@ -0,0 +1,83 @@
<div class="settings-container">
<div class="web-settings-container show-advanced">
<div class="filter-bar"></div>
<div class="row">
<div class="col-sm-4 col-md-3">
<ul class="settings-nav nav nav-cards">
<li><a class="card btn-gray selected" href="#general-web-group">General</a></li>
<li><a class="card btn-gray" href="#quality-web-group">Sub Account</a></li>
<li><a class="card btn-gray" href="#player-web-group">Player</a></li>
</ul>
</div>
<div class="col-sm-8 col-md-9">
<form id="web-settings-form">
<div id="general-web-group" class="settings-group active">
<h4 class="version-title"> Version 0.1A </h4>
<div class="form-group">
<label for="language">Language</label>
<select id="language">
<option value="en" selected=""> English</option>
<option value="fr"> Français</option>
</select>
<p class="help-block">
Aidez-nous à traduire cette application dans votre langue <a href="https://transifex.com/plex-1/plex-web" target="_blank">ici</a>.
</p>
</div>
<div class="form-group">
<label class="control-label" for="input_FriendlyName_c">
Second refresh
</label>
<input id="input_FriendlyName_c" class="form-control" name="refresh" value="" placeholder="ex: 800" type="text">
<p class="help-block">Number in second, you want to check new content on server.</p>
</div>
</div>
<div id="player-web-group" class="settings-group"><h4 class="settings-header-first ">Audio &amp;
sous-titres</h4>
<div class="form-group advanced-setting"><label for="audioBoost">Augmenter le volume du son
multi-canal</label> <select id="audioBoost" data-type="int">
<option value="100" selected="">Aucun</option>
<option value="150">Petite</option>
<option value="200">Grande</option>
<option value="250">Énorme</option>
</select>
<p class="help-block">Augmente le volume si le son est converti de multi-canal à
stéréo.</p></div>
<div class="form-group"><label for="subtitleSize">Taille des sous-titres</label> <select
id="subtitleSize" data-type="int">
<option value="50">Minuscule</option>
<option value="75">Petite</option>
<option value="100" selected="">Normale</option>
<option value="125">Grande</option>
<option value="200">Énorme</option>
</select></div>
<div class="form-group advanced-setting"><label for="subtitlesBurnLevel">Incruster les
sous-titres</label> <select id="subtitlesBurnLevel">
<option value="auto" selected="">Automatique</option>
<option value="avoid">Seulement le format des images</option>
<option value="always">Toujours</option>
</select>
<p class="help-block">Détermine si le serveur doit incruster les sous-titres lors de
l'encodage, en fonction du format des sous-titres. Eviter l'incrustation des
sous-titres améliore les performances du serveur, mais n'est possible qu'avec le
lecteur HTML5.</p></div>
<h4 class="settings-header">Bonus</h4>
<div class="form-group"><label for="extrasPrefixCount">Bandes annonces de Cinema avant le
film</label> <select id="extrasPrefixCount" data-type="int">
<option value="0" selected="">Aucun</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></div>
</div>
<div class="form-footer">
<button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading disabled">
<div class="loading loading-sm"></div>
<span class="btn-label">Enregistrer les modifications</span></button>
<span class="form-message"></span></div>
</form>
</div>
</div>
</div>
</div>

@ -0,0 +1,172 @@
<div class="settings-container">
<div class="filter-bar">
<div class="filter-bar-right">
<button class="toggle-advanced-btn btn btn-sm btn-default refresh">Refresh Libraries &nbsp;<i class="glyphicon refresh"></i></button>
</div>
<span id="primary-server-dropdown" class="dropdown">
<a class="dropdown-toggle" href="#primary-server-dropdown" data-toggle="dropdown">
<span class="dropdown-friendly-name">HF-Server</span> <i class="caret-icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a data-id="df1de861fbaba243c18ed9275fd42e3248d19336" href="#">
<span class="dropdown-truncated-label">Chewbaka</span>
</a>
</li>
<li>
<a data-id="11f086036e179128e7b077495e238d1c922d605c" href="#">
<span class="dropdown-truncated-label">HF-Server</span>
<i class="dropdown-selected-icon glyphicon ok-2"></i>
</a>
</li>
</ul>
</span>
</div>
<div class="devices-container row">
<div class="device-list-container col-sm-12 col-md-12">
<ul class="list card-tile-list">
<?php if($libraries) : ?>
<?php foreach ($libraries as $library) : ?>
<li class="card-tile-list-item card-3-col-item">
<div class="card card-device <?php echo $library->disable ? 'disabled' : ''; ?>">
<div class="card-actions">
<a href="/settings/libraries/premissions/<?php echo $library->id; ?>">
<button class="permissions-library-btn card-action-btn" data-library-id="<?php echo $library->id; ?>"
data-toggle="tooltip" data-original-title="Permissions">
<i class="glyphicon unlock"></i>
</button>
</a>
<button class="refresh-library-btn card-action-btn btn-info" data-library-id="<?php echo $library->id; ?>"
data-toggle="tooltip" data-original-title="Refresh">
<i class="glyphicon refresh"></i>
</button>
<?php if($library->disable) : ?>
<button class="enable-library-btn card-action-btn btn-success" data-library-id="<?php echo $library->id; ?>"
data-toggle="tooltip" data-original-title="Enable">
<i class="glyphicon ok-2"></i>
</button>
<?php else: ?>
<button class="disable-library-btn card-action-btn btn-danger" data-library-id="<?php echo $library->id; ?>"
data-toggle="tooltip" data-original-title="Disable">
<i class="glyphicon ban"></i>
</button>
<?php endif; ?>
<button class="remove-library-btn card-action-btn btn-danger" data-library-id="<?php echo $library->id; ?>"
data-toggle="tooltip" data-original-title="Delete">
<i class="glyphicon remove-2"></i>
</button>
</div>
<h4 class="name">
<?php echo $library->name; ?>
<span class="glyphicon <?php echo $library->disable ? 'ban text-danger' : 'ok-2 text-success'; ?>" data-toggle="tooltip" data-original-title="<?php echo $library->disable ? 'Disabled' : 'Enabled'; ?>"></span>
</h4>
<div class="card-details">
<div class="pull-right">
<div class="last-seen text-muted"><i class="plex-icon-watch-later-560"></i> <?php echo $library->getLastUpdate(); ?></div>
<span class="sync-info hidden">
<span class="glyphicon circle-arrow-down sync-icon"></span>
<span class="sync-count">123</span> / <span class="sync-size">456</span>
</span>
</div>
<span class="version text-muted"><?php echo $library->type; ?></span>
<div class="device-info-container">
<div class="product"><?php echo $library->getServer()->name; ?></div>
<div class="device text-muted"></div>
<div class="platform-info text-muted">
<span class="platform">Linux</span>
<span class="platform-version">Debian 8</span>
</div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('.filter-bar .add').on('click', function () {
$.ajax({
method: 'get',
url: '/rest/settings/add_server.json'
}).done(function (data) {
$('body').append(data);
setTimeout(function(){
$('.media-server-modal').removeClass('out').addClass('in');
},100);
});
});
$(document).on('click', '.media-server-modal button.close', function () {
$('.media-server-modal').removeClass('in').addClass('out').delay(500).queue(function(){ $(this).remove()});
});
$(document).on('click', '#add-plex button', function () {
var url = $('#add-plex #url').val();
var port = $('#add-plex #port').val();
var token = $('#add-plex #token').val();
$.ajax({
method: 'post',
url: '/rest/settings/server.json',
data: {url: url, port: port, token: token}
}).done(function (data) {
show_alert('success', 'Server save succesfully!');
$('.media-server-modal button.close').click();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
setTimeout(function(){location.reload()}, 200);
});
});
// LIBRARY BUTTON ACTION
$('button.refresh-library-btn').on('click', function () {
var library_id = $(this).data('library-id');
ajax += 1;
checkAjax();
$.ajax({
method: 'get',
url: '/rest/browse/library.json',
data: {library_id: library_id}
}).done(function (library) {
var server = {};
server.id = library.server_id;
server.name = library.server_name;
updateLibrary(server, library);
ajax -= 1;
alert.toggleClass('transition-out');
alert_status.html('Start browsing your library');
});
});
$('button.disable-library-btn').on('click', function () {
var button = this;
var library_id = $(this).data('library-id');
$.ajax({
method: 'delete',
url: '/rest/settings/library.json',
data: {library_id: library_id}
}).done(function (data) {
show_alert('success', 'Library disable succesfully!');
$(button).closest('.card.card-device').addClass('disabled');
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
});
});
// REFRESH ALL LIBRARIES
$('.filter-bar .refresh').on('click', function () {
ajax += 1;
checkAjax();
$.ajax({
method: 'get',
url: '/rest/browse/my_servers.json'
}).done(function (data) {
updateServers(data);
ajax -= 1;
alert.toggleClass('transition-out');
alert_status.html('Browse all your server is GOOD!');
});
});
});
</script>

@ -0,0 +1,164 @@
<div class="settings-container">
<div class="filter-bar">
<button class="toggle-advanced-btn btn btn-sm Button-primary-2LQVw pull-left add"
data-placement="top" data-toggle="tooltip" data-original-title="Add server"><i class="glyphicon circle-plus"></i></button>
<button class="toggle-advanced-btn btn btn-sm btn-default pull-right refresh">Refresh Servers &nbsp;<i class="glyphicon refresh"></i></button>
</div>
<div class="devices-container row">
<div class="device-list-container col-sm-12 col-md-12">
<ul class="list card-tile-list">
<?php if($servers) : ?>
<?php foreach ($servers as $server) : ?>
<li class="card-tile-list-item card-2-col-item">
<div class="card card-device">
<img class="card-poster device-icon" src="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEwIDExMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiNlNWEwMGQiIGQ9Im0wIDBoMTEwdjExMGgtMTEweiIvPjxwYXRoIGQ9Im0zMCA2MGMxNi41NjkgMCAzMC0xMy40MzEgMzAtMzAgMC0xNi41NjktMTMuNDMxLTMwLTMwLTMwLTE2LjU2OSAwLTMwIDEzLjQzMS0zMCAzMCAwIDE2LjU2OSAxMy40MzEgMzAgMzAgMzBtLS41NzEtNDguNzJsMTIuMTQ5IDE4Ljc0OS0xMi4xNSAxOC43NWgtNS41MDQtNS41MDR2LS4wMDRsMTIuMTQ3LTE4Ljc0Ni0xMi4xNDctMTguNzQ2di0uMDAyaDExLjAxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSAyNSkiIGZpbGw9IiMxZjFmMWYiLz48L2c+PC9zdmc+">
<div class="card-actions">
<button class="refresh-server-btn card-action-btn btn-info" data-server-id="<?php echo $server->id; ?>"
data-placement="top" data-toggle="tooltip" data-original-title="Refresh">
<i class="glyphicon refresh"></i>
</button>
<button class="edit-server-btn card-action-btn" data-server-id="<?php echo $server->id; ?>"
data-placement="top" data-toggle="tooltip" data-original-title="Edit">
<i class="glyphicon pencil"></i>
</button>
<button class="disable-server-btn card-action-btn btn-danger" data-server-id="<?php echo $server->id; ?>"
data-placement="top" data-toggle="tooltip" data-original-title="Disable">
<i class="glyphicon ban"></i>
</button>
<button class="remove-server-btn card-action-btn btn-danger" data-server-id="<?php echo $server->id; ?>"
data-placement="top" data-toggle="tooltip" data-original-title="Delete">
<i class="glyphicon remove-2"></i>
</button>
</div>
<h4 class="name"><?php echo $server->name; ?> <span data-placement="top" data-toggle="tooltip" data-original-title="<?php echo $server->online ? 'online' : 'offline' ; ?>" class="glyphicon <?php echo $server->online ? 'server text-success' : 'server-ban text-danger' ; ?>"></span></h4>
<div class="card-details">
<div class="pull-right">
<div class="last-seen text-muted"><i class="plex-icon-watch-later-560"></i> <?php echo $server->getLastCheck(); ?></div>
<span class="sync-info hidden">
<span class="glyphicon circle-arrow-down sync-icon"></span>
<span class="sync-count">123</span> / <span class="sync-size">456</span>
</span>
</div>
<span class="version text-muted"><?php echo $server->version; ?></span>
<div class="device-info-container">
<div class="product">Plex Media Server</div>
<div class="device text-muted"></div>
<div class="platform-info text-muted">
<span class="platform"><?php echo $server->plateforme; ?></span>
<span class="platform-version"><?php echo $server->platformVersion; ?></span>
</div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('.filter-bar .add').on('click', function () {
$.ajax({
method: 'get',
url: '/rest/settings/modal_server.json'
}).done(function (data) {
$('body').append(data);
setTimeout(function(){
$('.media-server-modal').removeClass('out').addClass('in');
},100);
});
});
$(document).on('click', '.media-server-modal button.close', function () {
$('.media-server-modal').removeClass('in').addClass('out').delay(500).queue(function(){ $(this).remove()});
});
// ADD OR EDIT SERVER
$(document).on('click', '#add-plex button', function () {
var server_id = $('#add-plex #server_id').val();
var url = $('#add-plex #url').val();
var port = $('#add-plex #port').val();
var token = $('#add-plex #token').val();
$.ajax({
method: 'post',
url: '/rest/settings/server.json',
data: {server_id: server_id, url: url, port: port, token: token}
}).done(function (data) {
show_alert('success', 'Server save succesfully!');
$('.media-server-modal button.close').click();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
setTimeout(function(){location.reload()}, 200);
});
});
// SERVER BUTTON ACTION
$('button.refresh-server-btn').on('click', function () {
var server_id = $(this).data('server-id');
ajax += 1;
checkAjax();
$.ajax({
method: 'get',
url: '/rest/browse/server.json',
data: {server_id: server_id}
}).done(function (data) {
updateServers(data);
ajax -= 1;
alert.toggleClass('transition-out');
alert_status.html('Browse all your server is GOOD!');
});
});
$('button.edit-server-btn').on('click', function () {
var server_id = $(this).data('server-id');
$.ajax({
method: 'get',
url: '/rest/settings/modal_server.json'
}).done(function (modal) {
$.ajax({
method: 'get',
url: '/rest/browse/server.json',
data: {server_id: server_id}
}).done(function (server) {
$('body').append(modal);
setTimeout(function(){
$('#add-plex #server_id').val(server[0].id);
$('#add-plex #url').val(server[0].url);
$('#add-plex #port').val(server[0].port);
$('#add-plex #token').val(server[0].token);
$('.media-server-modal').removeClass('out').addClass('in');
},100);
});
});
});
$('button.disable-server-btn').on('click', function () {
var button = this;
var server_id = $(this).data('server-id');
$.ajax({
method: 'delete',
url: '/rest/settings/server.json',
data: {server_id: server_id}
}).done(function (data) {
show_alert('success', 'Server disable succesfully!');
$(button).closest('li').get(0).remove();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
});
});
// REFRESH ALL SERVER
$('.filter-bar .refresh').on('click', function () {
ajax += 1;
checkAjax();
$.ajax({
method: 'get',
url: '/rest/browse/my_servers.json'
}).done(function (data) {
updateServers(data);
ajax -= 1;
alert.toggleClass('transition-out');
alert_status.html('Browse all your server is GOOD!');
});
});
});
</script>

@ -0,0 +1,125 @@
<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">
<ul class="list card-tile-list">
<?php if($users) : ?>
<?php foreach ($users as $user) : ?>
<li class="card-tile-list-item card-3-col-item">
<div class="card card-device <?php echo $user->disable ? 'disabled' : ''; ?>">
<div class="card-actions">
<a href="/settings/users/premissions/<?php echo $user->id; ?>">
<button class="permissions-user-btn card-action-btn" data-library-id="<?php echo $user->id; ?>"
data-toggle="tooltip" data-original-title="Permissions">
<i class="glyphicon unlock"></i>
</button>
</a>
<?php if($user->disable) : ?>
<button class="enable-user-btn card-action-btn btn-success" data-library-id="<?php echo $user->id; ?>"
data-toggle="tooltip" data-original-title="Enable">
<i class="glyphicon ok-2"></i>
</button>
<?php else: ?>
<button class="disable-user-btn card-action-btn btn-danger" data-library-id="<?php echo $user->id; ?>"
data-toggle="tooltip" data-original-title="Disable">
<i class="glyphicon ban"></i>
</button>
<?php endif; ?>
<button class="remove-user-btn card-action-btn btn-danger" data-library-id="<?php echo $user->id; ?>"
data-toggle="tooltip" data-original-title="Delete">
<i class="glyphicon remove-2"></i>
</button>
</div>
<h4 class="name">
<?php echo $user->username; ?>
<span class="glyphicon <?php echo $user->disable ? 'ban text-danger' : 'ok-2 text-success'; ?>" data-toggle="tooltip" data-original-title="<?php echo $user->disable ? 'Disabled' : 'Enabled'; ?>"></span>
</h4>
<div class="card-details">
<div class="pull-right">
<div class="last-seen text-muted" data-toggle="tooltip" data-original-title="Last login">
<i class="plex-icon-watch-later-560"></i> <?php echo $user->getLastLogin(); ?>
</div>
</div>
<span class="version text-muted"><?php echo $user->email; ?></span>
<div class="device-info-container">
<div class="product"><?php echo $user->admin ? 'Admin' : 'User'; ?></div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
$('.filter-bar .add').on('click', function () {
$.ajax({
method: 'get',
url: '/rest/settings/add_server.json'
}).done(function (data) {
$('body').append(data);
setTimeout(function(){
$('.media-server-modal').removeClass('out').addClass('in');
},100);
});
});
$(document).on('click', '.media-server-modal button.close', function () {
$('.media-server-modal').removeClass('in').addClass('out').delay(500).queue(function(){ $(this).remove()});
});
$(document).on('click', '#add-plex button', function () {
var url = $('#add-plex #url').val();
var port = $('#add-plex #port').val();
var token = $('#add-plex #token').val();
$.ajax({
method: 'post',
url: '/rest/settings/server.json',
data: {url: url, port: port, token: token}
}).done(function (data) {
show_alert('success', 'Server save succesfully!');
$('.media-server-modal button.close').click();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
setTimeout(function(){location.reload()}, 200);
});
});
// LIBRARY BUTTON ACTION
$('button.refresh-library-btn').on('click', function () {
var library_id = $(this).data('library-id');
ajax += 1;
checkAjax();
$.ajax({
method: 'get',
url: '/rest/browse/library.json',
data: {library_id: library_id}
}).done(function (library) {
var server = {};
server.id = library.server_id;
server.name = library.server_name;
updateLibrary(server, library);
ajax -= 1;
alert.toggleClass('transition-out');
alert_status.html('Start browsing your library');
});
});
$('button.disable-library-btn').on('click', function () {
var button = this;
var library_id = $(this).data('library-id');
$.ajax({
method: 'delete',
url: '/rest/settings/library.json',
data: {library_id: library_id}
}).done(function (data) {
show_alert('success', 'Library disable succesfully!');
$(button).closest('.card.card-device').addClass('disabled');
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
});
});
});
</script>

@ -15,14 +15,15 @@
<div class="PageHeaderRight-pageHeaderRight-2CT0g"> <div class="PageHeaderRight-pageHeaderRight-2CT0g">
<div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ"> <div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ">
<div class="pageHeaderToolbar-toolbar-1lW-M"> <div class="pageHeaderToolbar-toolbar-1lW-M">
<button id="id-239" data-original-title="Lire" data-toggle="tooltip" role="button" <button id="id-16" data-original-title="Lire" data-toggle="tooltip" data-placement="bottom" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO " class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-play-560" type="button"><i class="plex-icon-toolbar-play-560" aria-hidden="true"></i>
aria-hidden="true"></i></button> </button>
<button id="id-238" data-original-title="Plus..." aria-haspopup="true" data-toggle="tooltip" role="button" <button id="id-15" data-original-title="Plus..." aria-haspopup="true" data-placement="bottom" data-toggle="tooltip"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO " role="button"
type="button"><i class="plex-icon-toolbar-more-560" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
aria-hidden="true"></i></button> type="button"><i class="plex-icon-toolbar-more-560" aria-hidden="true"></i>
</button>
</div> </div>
<div class="Measure-scrollContainer-3vb4J"> <div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div> <div class="Measure-expandContent-1JQfL"></div>
@ -213,7 +214,7 @@
<button aria-haspopup="true" role="button" <button aria-haspopup="true" role="button"
class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO" class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button">Show more 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> <div class="CollapsibleText-readMoreArrow-34BdB 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> </button>
</div> </div>
</div> </div>
@ -238,6 +239,18 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(window).on('load', function() { $(window).on('load', function() {
/** READ MORE **/
$(document).on('click', '.CollapsibleText-readMore-1bRJm', function (event) {
var summary = $(document).find('.CollapsibleText-contentTransition-15VYv');
if(summary.css('max-height') === '78px') {
$(this).find('div').removeClass('DisclosureArrow-down-1U7WW').addClass('DisclosureArrow-up-1U7WW');
summary.css('max-height', '10000px');
} else {
$(this).find('div').removeClass('DisclosureArrow-up-1U7WW').addClass('DisclosureArrow-down-1U7WW');
summary.css('max-height', '78px');
}
});
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) { $(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
event.stopPropagation(); event.stopPropagation();
var movie_id = $(this).data('id'); var movie_id = $(this).data('id');

@ -1,3 +1,13 @@
<div class="PageHeader-pageHeader-18RSw">
<div class="PageHeaderLeft-pageHeaderLeft-2TxSo"><span>Découvrir<span
class="PageHeaderSeparator-pageHeaderSeparator-221fi DashSeparator-separator-2a3yn">—</span></span>
<button aria-haspopup="true" data-qa-id="directoriesMenuButton" id="id-1976" role="button"
class="PageHeaderBreadcrumbButton-button-1uaPj DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 DisclosureArrowButton-isSelected-oswRN Link-link-2XYrU Link-default-32xSO Link-isSelected-3GpAs"
type="button">Toutes les bibliothèques
<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 DisclosureArrow-isSelected-VMAVr"></div>
</button>
</div>
</div>
<div class="PageContent-pageContent-16mK6 Scroller-scroller-d5-b- Scroller-vertical-1bgGS "> <div class="PageContent-pageContent-16mK6 Scroller-scroller-d5-b- Scroller-vertical-1bgGS ">
<div class="DashboardPage-dashboardPageContent-2rN8X PageContent-innerPageContent-3ktLT"> <div class="DashboardPage-dashboardPageContent-2rN8X PageContent-innerPageContent-3ktLT">
<div style="opacity: 1; pointer-events: auto;"> <div style="opacity: 1; pointer-events: auto;">
@ -23,102 +33,104 @@
</div> </div>
<div style="height: 275px; overflow: hidden;"> <div style="height: 275px; overflow: hidden;">
<div class="Measure-container-2XznZ"> <div class="Measure-container-2XznZ">
<div id="tv_show_list" class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET "> <div id="tv_show_list"
class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET ">
<div class=" " style="width: 4540px; height: 275px;"> <div class=" " style="width: 4540px; height: 275px;">
<?php if($episodes) : ?> <?php if ($episodes) : ?>
<?php <?php
$translate = -150; $translate = -150;
foreach ($episodes as $episode) : foreach ($episodes as $episode) :
?> ?>
<div class=" virtualized-cell-3KPHx " <div class=" virtualized-cell-3KPHx "
style="position: absolute; width: 127px; height: 260px; transform: translate3d(<?php echo $translate += 152; ?>px, 10px, 0px);"> style="position: absolute; width: 127px; height: 260px; transform: translate3d(<?php echo $translate += 152; ?>px, 10px, 0px);">
<div class="MetadataPosterCard-cardContainer-2gRcQ"> <div class="MetadataPosterCard-cardContainer-2gRcQ">
<div class="MetadataPosterCard-card-3bztR " <div class="MetadataPosterCard-card-3bztR "
style="width: 127px; height: 191px;"> style="width: 127px; height: 191px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG "> <div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<div class="PosterCardImg-imageContainer-1Ar4M" data-movie-id="<?php echo $episode->id; ?>"> <div class="PosterCardImg-imageContainer-1Ar4M"
<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;" data-movie-id="<?php echo $episode->id; ?>">
class=""></div> <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;"
</div> class=""></div>
<div class=" MetadataPosterCardOverlay-overlay-1uMpL "> </div>
<div class="MetadataPosterCardOverlay-background-2EwyB"></div> <div class=" MetadataPosterCardOverlay-overlay-1uMpL ">
<div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn"> <div class="MetadataPosterCardOverlay-background-2EwyB"></div>
<div class="MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"><?php echo $episode->count > 1 ? $episode->count : ''; ?></div> <div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn">
<div class="MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"><?php echo $episode->count > 1 ? $episode->count : ''; ?></div>
</div>
<?php if ($episode->count > 1) : ?>
<a href="/season/<?php echo $episode->getSeason()->id; ?>"
<?php else: ?>
<a href="/episode/<?php echo $episode->id; ?>"
<?php endif; ?>
role="link"
class="MetadataPosterCardOverlay-link-1Swhl Link-link-2XYrU Link-default-32xSO">
<button data-id="<?php echo $episode->count <= 1 ? $episode->id : ''; ?>"
tabindex="-1"
role="button"
class="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>
</a>
<button id="id-3281" tabindex="-1"
aria-label="More Actions"
aria-haspopup="true"
data-qa-id="metadataPosterMoreButton"
role="button"
class="MetadataPosterCardOverlay-moreButton-3FK-K MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO"
type="button">
<i class="plex-icon-more-560"
aria-hidden="true"></i>
</button>
<button aria-label="Select 1-800-799-7233"
id="id-3282" tabindex="-1" role="button"
class="MetadataPosterCardOverlay-selectButton-3rwSV SelectButton-selectButton-3Kbjm MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<div class="MetadataPosterCardOverlay-selectCircle-3ql8S SelectButton-selectCircle-3tdvG">
<i class="plex-icon-selected-560 SelectButton-selectedIcon-3-SAL"
aria-hidden="true"></i></div>
</button>
</div> </div>
<?php if($episode->count > 1) : ?>
<a href="/season/<?php echo $episode->getSeason()->id; ?>"
<?php else: ?>
<a href="/episode/<?php echo $episode->id; ?>"
<?php endif; ?>
role="link"
class="MetadataPosterCardOverlay-link-1Swhl Link-link-2XYrU Link-default-32xSO">
<button data-id="<?php echo $episode->count <= 1 ? $episode->id : ''; ?>"
tabindex="-1"
role="button"
class="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>
</a>
<button id="id-3281" tabindex="-1"
aria-label="More Actions"
aria-haspopup="true"
data-qa-id="metadataPosterMoreButton"
role="button"
class="MetadataPosterCardOverlay-moreButton-3FK-K MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO"
type="button">
<i class="plex-icon-more-560"
aria-hidden="true"></i>
</button>
<button aria-label="Select 1-800-799-7233"
id="id-3282" tabindex="-1" role="button"
class="MetadataPosterCardOverlay-selectButton-3rwSV SelectButton-selectButton-3Kbjm MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<div class="MetadataPosterCardOverlay-selectCircle-3ql8S SelectButton-selectCircle-3tdvG">
<i class="plex-icon-selected-560 SelectButton-selectedIcon-3-SAL"
aria-hidden="true"></i></div>
</button>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="MetadataPosterCell-titleContainer-24DI6">
<div class="MetadataPosterCell-titleContainer-24DI6"> <a title="<?php echo $episode->getTvShow()->title; ?>"
<a title="<?php echo $episode->getTvShow()->title; ?>" href="/tvshow/<?php echo $episode->getTvShow()->id; ?>"
href="/tvshow/<?php echo $episode->getTvShow()->id; ?>" role="link"
role="link" class=" MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO">
class=" MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO"> <?php echo $episode->getTvShow()->title; ?>
<?php echo $episode->getTvShow()->title; ?> </a>
</a> <?php if (1 == $episode->count) : ?>
<?php if(1 == $episode->count) : ?> <a title="<?php echo $episode->title; ?>"
<a title="<?php echo $episode->title; ?>" href="/episode/<?php echo $episode->id; ?>"
href="/episode/<?php echo $episode->id; ?>" role="link"
role="link" class="MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY Link-link-2XYrU Link-default-32xSO">
class="MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY Link-link-2XYrU Link-default-32xSO"> <?php echo $episode->title; ?>
<?php echo $episode->title; ?> </a>
</a> <?php endif; ?>
<?php endif; ?> <span class=" MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY ">
<span class=" MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY ">
<a title="<?php echo $episode->getSeason()->title; ?>" <a title="<?php echo $episode->getSeason()->title; ?>"
href="/season/<?php echo $episode->getSeason()->id; ?>" href="/season/<?php echo $episode->getSeason()->id; ?>"
role="link" role="link"
class=" Link-link-2XYrU Link-default-32xSO"> class=" Link-link-2XYrU Link-default-32xSO">
<?php echo 1 == $episode->count ? 'S' : 'Saison'; ?> <?php echo 1 == $episode->count ? 'S' : 'Saison'; ?>
<?php echo $episode->getSeason()->number; ?> <?php echo $episode->getSeason()->number; ?>
</a> </a>
<?php if(1 == $episode->count) : ?> <?php if (1 == $episode->count) : ?>
<span class="DashSeparator-separator-2a3yn">·</span> <span class="DashSeparator-separator-2a3yn">·</span>
<a title="<?php echo $episode->title; ?>" <a title="<?php echo $episode->title; ?>"
href="/episode/<?php echo $episode->id; ?>" href="/episode/<?php echo $episode->id; ?>"
role="link" role="link"
class=" Link-link-2XYrU Link-default-32xSO">E<?php echo $episode->number; ?> class=" Link-link-2XYrU Link-default-32xSO">E<?php echo $episode->number; ?>
</a> </a>
<?php endif; ?> <?php endif; ?>
</span> </span>
</div>
</div> </div>
</div> <?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
@ -152,70 +164,73 @@
</div> </div>
<div style="height: 255px; overflow: hidden;"> <div style="height: 255px; overflow: hidden;">
<div class="Measure-container-2XznZ"> <div class="Measure-container-2XznZ">
<div id="movies_list" class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET "> <div id="movies_list"
class="VirtualListScroller-scroller-37EU_ Scroller-scroller-d5-b- Scroller-horizontal-1k8ET ">
<div class=" " style="width: 4540px; height: 255px;"> <div class=" " style="width: 4540px; height: 255px;">
<?php if($movies) : ?> <?php if ($movies) : ?>
<?php <?php
$translate = -150; $translate = -150;
foreach ($movies as $movie) : foreach ($movies as $movie) :
?> ?>
<div class=" virtualized-cell-3KPHx " <div class=" virtualized-cell-3KPHx "
style="position: absolute; width: 127px; height: 240px; transform: translate3d(<?php echo $translate += 152; ?>px, 10px, 0px);"> style="position: absolute; width: 127px; height: 240px; transform: translate3d(<?php echo $translate += 152; ?>px, 10px, 0px);">
<div class="MetadataPosterCard-cardContainer-2gRcQ"> <div class="MetadataPosterCard-cardContainer-2gRcQ">
<div class="MetadataPosterCard-card-3bztR " <div class="MetadataPosterCard-card-3bztR "
style="width: 127px; height: 191px;"> style="width: 127px; height: 191px;">
<div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG "> <div class="MetadataPosterCardFace-face--dz_D MetadataPosterCardFace-poster-L2P6r MetadataPosterCardFace-faceFront-1bxHG ">
<div class="PosterCardImg-imageContainer-1Ar4M" data-movie-id="<?php echo $movie->id; ?>"> <div class="PosterCardImg-imageContainer-1Ar4M"
<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;" data-movie-id="<?php echo $movie->id; ?>">
class=""></div> <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;"
</div> class=""></div>
<div class=" MetadataPosterCardOverlay-overlay-1uMpL "> </div>
<div class="MetadataPosterCardOverlay-background-2EwyB"></div> <div class=" MetadataPosterCardOverlay-overlay-1uMpL ">
<div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn"> <div class="MetadataPosterCardOverlay-background-2EwyB"></div>
<div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div> <div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn">
<div class="MetadataPosterCardOverlay-unwatchedTag-Fqazx MetadataPosterCardOverlay-unwatchedBadge-Qn1fv MetadataPosterCardOverlay-badge-1FU-p"></div>
</div>
<a href="/movie/<?php echo $movie->id; ?>"
role="link"
class="MetadataPosterCardOverlay-link-1Swhl Link-link-2XYrU Link-default-32xSO"></a>
<button data-id="<?php echo $movie->id; ?>"
tabindex="-1"
role="button"
class="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>
<button id="id-3044" tabindex="-1"
aria-label="More Actions"
aria-haspopup="true"
data-qa-id="metadataPosterMoreButton"
role="button"
class="MetadataPosterCardOverlay-moreButton-3FK-K MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<i class="plex-icon-more-560"
aria-hidden="true"></i>
</button>
<button aria-label="Select Hercules"
id="id-3045" tabindex="-1" role="button"
class="MetadataPosterCardOverlay-selectButton-3rwSV SelectButton-selectButton-3Kbjm MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<div class="MetadataPosterCardOverlay-selectCircle-3ql8S SelectButton-selectCircle-3tdvG">
<i class="plex-icon-selected-560 SelectButton-selectedIcon-3-SAL"
aria-hidden="true"></i></div>
</button>
</div> </div>
<a href="/movie/<?php echo $movie->id; ?>"
role="link"
class="MetadataPosterCardOverlay-link-1Swhl Link-link-2XYrU Link-default-32xSO"></a>
<button data-id="<?php echo $movie->id; ?>"
tabindex="-1"
role="button"
class="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>
<button id="id-3044" tabindex="-1"
aria-label="More Actions"
aria-haspopup="true"
data-qa-id="metadataPosterMoreButton"
role="button"
class="MetadataPosterCardOverlay-moreButton-3FK-K MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<i class="plex-icon-more-560"
aria-hidden="true"></i>
</button>
<button aria-label="Select Hercules"
id="id-3045" tabindex="-1" role="button"
class="MetadataPosterCardOverlay-selectButton-3rwSV SelectButton-selectButton-3Kbjm MetadataPosterCardOverlay-button-M43H- Link-link-2XYrU Link-default-32xSO "
type="button">
<div class="MetadataPosterCardOverlay-selectCircle-3ql8S SelectButton-selectCircle-3tdvG">
<i class="plex-icon-selected-560 SelectButton-selectedIcon-3-SAL"
aria-hidden="true"></i></div>
</button>
</div> </div>
</div> </div>
</div> </div>
<div class="MetadataPosterCell-titleContainer-24DI6">
<a title="<?php echo $movie->title; ?>"
href="/movie/<?php echo $movie->id; ?>" role="link"
class="MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?>
</a>
<span class="MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY"><?php echo $movie->year; ?></span>
</div>
</div> </div>
<div class="MetadataPosterCell-titleContainer-24DI6"> <?php endforeach; ?>
<a title="<?php echo $movie->title; ?>" href="/movie/<?php echo $movie->id; ?>" role="link"
class="MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?>
</a>
<span class="MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY"><?php echo $movie->year; ?></span>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
@ -232,66 +247,66 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(window).on('load', function() { $(window).on('load', function () {
/** LAUNCH PLAYER **/ /** LAUNCH PLAYER **/
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) { $(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
var movie_id = $(this).data('id'); var movie_id = $(this).data('id');
if(movie_id === '') if (movie_id === '')
return; return;
event.stopPropagation(); event.stopPropagation();
$.ajax({ $.ajax({
url: '/rest/movie/stream', url: '/rest/movie/stream',
method: 'GET', method: 'GET',
data: { movie_id : movie_id }, data: {movie_id: movie_id},
dataType: 'html' dataType: 'html'
}).done(function(view) { }).done(function (view) {
launchPlayer(view); launchPlayer(view);
}).fail(function(data) { }).fail(function (data) {
console.error(data); console.error(data);
});
}); });
}); /** LOADING PICTURE **/
/** LOADING PICTURE **/ $('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) {
$('.PosterCardImg-imageContainer-1Ar4M[data-movie-id]').each(function (index, element) { var movie_id = $(element).data('movie-id');
var movie_id = $(element).data('movie-id'); $('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id=' + movie_id + '&width=' + 158 + '&height=' + 233 + '")');
$('[data-movie-id="' + movie_id + '"] > div').css('background-image', 'url("/cover/movie?movie_id='+ movie_id +'&width='+ 158 +'&height='+ 233 +'")'); });
}); /** SCROLL LIST TV SHOWS AND MOVIES **/
/** SCROLL LIST TV SHOWS AND MOVIES **/ $('.HubCell-hubActions-28w1- button').on('click', function () {
$('.HubCell-hubActions-28w1- button').on('click', function(){ var parent = $(this).closest('div[data-qa-id]');
var parent = $(this).closest('div[data-qa-id]'); var select = $(parent).data('qa-id');
var select = $(parent).data('qa-id'); var previous = $(parent).find('button[data-hubcell-action="previous"]');
var previous = $(parent).find('button[data-hubcell-action="previous"]'); var next = $(parent).find('button[data-hubcell-action="next"]');
var next = $(parent).find('button[data-hubcell-action="next"]');
if($(this).data('hubcell-action') === 'previous') { if ($(this).data('hubcell-action') === 'previous') {
$('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() - 152 * 2}, 500); $('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() - 152 * 2}, 500);
setTimeout(function(){ setTimeout(function () {
if($('#' + select + '_list').scrollLeft() <= (150 * 19)) { if ($('#' + select + '_list').scrollLeft() <= (150 * 19)) {
$(next).removeClass('isDisabled'); $(next).removeClass('isDisabled');
} }
if($('#' + select + '_list').scrollLeft() === 0) { if ($('#' + select + '_list').scrollLeft() === 0) {
$(previous).addClass('isDisabled'); $(previous).addClass('isDisabled');
} }
}, 500); }, 500);
} }
if($(this).data('hubcell-action') === 'next') { if ($(this).data('hubcell-action') === 'next') {
$('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() + 152 * 2}, 500); $('#' + select + '_list').animate({scrollLeft: $('#' + select + '_list').scrollLeft() + 152 * 2}, 500);
setTimeout(function(){ setTimeout(function () {
if($('#' + select + '_list').scrollLeft() > 0) { if ($('#' + select + '_list').scrollLeft() > 0) {
$(previous).removeClass('isDisabled'); $(previous).removeClass('isDisabled');
} }
if($('#' + select + '_list').scrollLeft() >= (150 * 19)) { if ($('#' + select + '_list').scrollLeft() >= (150 * 19)) {
$(next).addClass('isDisabled'); $(next).addClass('isDisabled');
} }
if($('#' + select + '_list').scrollLeft() === 0) { if ($('#' + select + '_list').scrollLeft() === 0) {
$(next).addClass('isDisabled'); $(next).addClass('isDisabled');
} }
}, 500); }, 500);
} }
});
}); });
});
</script> </script>

@ -15,7 +15,7 @@
<div id="content" class="scroll-container dark-scrollbar"> <div id="content" class="scroll-container dark-scrollbar">
<div> <div>
<div data-reactroot="" class="FullPage-container-3qanw"> <div data-reactroot="" class="FullPage-container-3qanw">
<?php echo \View::forge('layout/nav_bar_vertical', ['libraries' => $libraries, 'server' => $server]); ?> <?php echo \View::forge('layout/nav_bar_vertical', ['MenuLibraries' => $MenuLibraries, 'MenuServer' => $MenuServer]); ?>
<div class="Page-page-aq7i_ Scroller-scroller-d5-b- Scroller-none-1LyUO "> <div class="Page-page-aq7i_ Scroller-scroller-d5-b- Scroller-none-1LyUO ">
<?php echo $body; ?> <?php echo $body; ?>
</div> </div>
@ -34,8 +34,8 @@
<div class="ServerMenu-serverMenuScroller-1nSX6 Menu-menuScroller-E0NwY Scroller-vertical-1bgGS Scroller-scroller-d5-b- Scroller-auto-3t4gM" <div class="ServerMenu-serverMenuScroller-1nSX6 Menu-menuScroller-E0NwY Scroller-vertical-1bgGS Scroller-scroller-d5-b- Scroller-auto-3t4gM"
style="max-height: 300px;"> style="max-height: 300px;">
<div> <div>
<?php foreach (Model_Server::find_all() as $_server) : ?> <?php foreach (Model_Server::find(function ($query){$query->where('online',1)->and_where('disable',0);}) as $_server) : ?>
<?php if($_server->id === $server->id) : ?> <?php if($_server->id === $MenuServer->id) : ?>
<a role="menuitem" href="#" <a role="menuitem" href="#"
<?php else: ?> <?php else: ?>
<a role="menuitem" href="/home/<?php echo $_server->id; ?>" <a role="menuitem" href="/home/<?php echo $_server->id; ?>"
@ -47,7 +47,7 @@
<div class="ServerMenuItem-serverMenuDetails-1-Rfq"></div> <div class="ServerMenuItem-serverMenuDetails-1-Rfq"></div>
</div> </div>
<div class="ServerMenuItem-serverMenuIconContainer-2WtBG"> <div class="ServerMenuItem-serverMenuIconContainer-2WtBG">
<?php if($_server->id === $server->id) : ?> <?php if($_server->id === $MenuServer->id) : ?>
<i class="plex-icon-selected-560 ServerMenuItem-serverMenuIcon-2zKCW ServerMenuItem-selectedIcon-dhK05" <i class="plex-icon-selected-560 ServerMenuItem-serverMenuIcon-2zKCW ServerMenuItem-selectedIcon-dhK05"
aria-hidden="false" aria-label="Sélectionné(e)"></i> aria-hidden="false" aria-label="Sélectionné(e)"></i>
<?php endif; ?> <?php endif; ?>
@ -63,16 +63,12 @@
</div> </div>
</div> </div>
<div id="divVideo" style="display: none"> <div id="divVideo" style="display: none">
<div id="movie_id" style="height: 100%"></div> <div id="movie_stream" style="height: 100%"></div>
<div id="video_controls" class="AudioVideoPlayerView-container-kWiFs"></div> <div id="video_controls" class="AudioVideoPlayerView-container-kWiFs"></div>
</div> </div>
<?php <script type="text/javascript">
echo \Asset::js(isset($js_bottom) ? $js_bottom : null);
echo \Asset::js(['bootstrap.min.js']);
?>
<script>
$(function() { $(function() {
$('[data-toggle="tooltip"]').tooltip({ container: 'body'}); $('[data-toggle="tooltip"]').tooltip({ container: 'body', template: '<div class="tooltip Tooltip-tooltipPortal-1IUlb"><div class="tooltip-arrow"></div><div class="tooltip-inner Tooltip-tooltip-2AL-W"></div></div>'});
$(document).on('click', '#id-3026', function (event) { $(document).on('click', '#id-3026', function (event) {
event.stopPropagation(); event.stopPropagation();
$(this).find('.DisclosureArrow-disclosureArrow-1sBFv').toggleClass('DisclosureArrow-up-1U7WW DisclosureArrow-down-1U7WW'); $(this).find('.DisclosureArrow-disclosureArrow-1sBFv').toggleClass('DisclosureArrow-up-1U7WW DisclosureArrow-down-1U7WW');
@ -85,4 +81,8 @@ echo \Asset::js(['bootstrap.min.js']);
}); });
}); });
</script> </script>
<?php
echo \Asset::js(['bootstrap.min.js']);
echo \Asset::js(isset($js_bottom) ? $js_bottom : null);
?>
</body> </body>

@ -1,5 +1,5 @@
<head> <head>
<title>Plex</title> <title>PlexShare 1.0 by Chewbaka</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">

@ -4,8 +4,8 @@
<?php echo \View::forge('layout/body', [ <?php echo \View::forge('layout/body', [
'body' => isset($body) ? $body : null, 'body' => isset($body) ? $body : null,
'user' => isset($user) ? $user : null, 'user' => isset($user) ? $user : null,
'libraries' => isset($libraries) ? $libraries : null, 'MenuLibraries' => isset($MenuLibraries) ? $MenuLibraries : null,
'server' => isset($server) ? $server : null, 'MenuServer' => isset($MenuServer) ? $MenuServer : null,
'js_bottom' => isset($js_bottom) ? $js_bottom : null, 'js_bottom' => isset($js_bottom) ? $js_bottom : null,
]); ?> ]); ?>
</html> </html>

@ -19,8 +19,9 @@
</a> </a>
</li> </li>
<li> <li>
<a class="settings-btn" href="/settings" title="" data-toggle="tooltip" data-placement="bottom" data-original-title="Settings"> <a class="settings-btn dropdown-poster-container" href="/settings" title="" data-toggle="tooltip" data-placement="bottom" data-original-title="Settings">
<i class="glyphicon settings"></i> <i class="glyphicon settings"></i>
<span class="total-badge badge" style="position: absolute;top: 34px;left: 5px">0</span>
</a> </a>
</li> </li>
<li id="nav-dropdown" class="nav-dropdown dropdown"> <li id="nav-dropdown" class="nav-dropdown dropdown">
@ -30,15 +31,15 @@
style="background-image: url(&quot;blob:https://app.plex.tv/3ebfa0a2-486e-45d0-8213-ec862f30e792&quot;);"></div> style="background-image: url(&quot;blob:https://app.plex.tv/3ebfa0a2-486e-45d0-8213-ec862f30e792&quot;);"></div>
<i class="caret-icon"></i> <i class="caret-icon"></i>
</div> </div>
<span class="total-badge badge hidden">0</span> <span class="total-badge badge">0</span>
</a> </a>
<ul class="dropdown-menu signed-in full-user"> <ul class="dropdown-menu signed-in full-user">
<li class="signed-in-item dropdown-header username-header"><?php echo $user->username; ?></li> <li class="signed-in-item dropdown-header username-header"><?php echo $user->username; ?></li>
<li class="signed-in-item"><a href="#!/account">Account</a></li> <li class="signed-in-item"><a href="#!/account">Account</a></li>
<li class="signed-in-item"><a class="users-btn" href="#">Users <span class="invites-badge badge hidden">0</span></a></li>
<li class="divider"></li> <li class="divider"></li>
<?php if($user->admin) : ?> <?php if($user->admin) : ?>
<li class="signed-in-item full-user-item"><a class="admin-user-btn" href="#">Admin</a></li> <li class="signed-in-item full-user-item"><a class="admin-user-btn" href="/admin">Admin <span class="badge">0</span></a></li>
<li class="signed-in-item"><a class="users-btn" href="/admin/users">Users <span class="media-count-badge badge">0</span></a></li>
<li class="divider"></li> <li class="divider"></li>
<li class="signed-in-item switch-user-item"><a class="switch-user-btn" href="#">Switch User...</a></li> <li class="signed-in-item switch-user-item"><a class="switch-user-btn" href="#">Switch User...</a></li>
<?php endif; ?> <?php endif; ?>

@ -5,7 +5,7 @@
<div class="SidebarMenuButton-sidebarMenuButtonContainer-3vW-e"> <div class="SidebarMenuButton-sidebarMenuButtonContainer-3vW-e">
<span class="SidebarMenuButton-sidebarMenuTitle-2rcM8"> <span class="SidebarMenuButton-sidebarMenuTitle-2rcM8">
<span class="SidebarMenuButton-sidebarMenuPrimaryTitleContainer-15y7y"> <span class="SidebarMenuButton-sidebarMenuPrimaryTitleContainer-15y7y">
<span class="SidebarMenuButton-sidebarMenuPrimaryTitle-3-46F"><?php echo isset($server) ? $server->name : null; ?></span> <span class="SidebarMenuButton-sidebarMenuPrimaryTitle-3-46F"><?php echo isset($MenuServer) ? $MenuServer->name : null; ?></span>
<div class="DisclosureArrow-disclosureArrow-1sBFv DisclosureArrow-down-1U7WW DisclosureArrow-up-rjGpc DisclosureArrow-default-3_FCW DisclosureArrow-medium-3VjTd DisclosureArrow-isSelected-VMAVr"></div> <div class="DisclosureArrow-disclosureArrow-1sBFv DisclosureArrow-down-1U7WW DisclosureArrow-up-rjGpc DisclosureArrow-default-3_FCW DisclosureArrow-medium-3VjTd DisclosureArrow-isSelected-VMAVr"></div>
</span> </span>
<span class="SidebarMenuButton-sidebarMenuSecondaryTitle-1oZlq"></span> <span class="SidebarMenuButton-sidebarMenuSecondaryTitle-1oZlq"></span>
@ -39,8 +39,8 @@
role="header"> role="header">
<div class="SidebarServerLibraries-librariesTitle-3iqmv">Libraries</div> <div class="SidebarServerLibraries-librariesTitle-3iqmv">Libraries</div>
</div> </div>
<?php if (isset($libraries)) : ?> <?php if (isset($MenuLibraries)) : ?>
<?php foreach ($libraries as $library) : ?> <?php foreach ($MenuLibraries as $library) : ?>
<div class="SidebarLibraryItem-libraryListItem-2cmmj SidebarListItem-sidebarListItem-3ijGg"> <div class="SidebarLibraryItem-libraryListItem-2cmmj SidebarListItem-sidebarListItem-3ijGg">
<a data-qa-id="sidebarLibraryItem--11" <a data-qa-id="sidebarLibraryItem--11"
href="/library/<?php echo $library->id; ?>" href="/library/<?php echo $library->id; ?>"

@ -5,13 +5,21 @@
<div class="PageHeaderRight-pageHeaderRight-2CT0g"> <div class="PageHeaderRight-pageHeaderRight-2CT0g">
<div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ"> <div class="pageHeaderToolbar-toolbarContainer-2N-IJ Measure-container-2XznZ">
<div class="pageHeaderToolbar-toolbar-1lW-M"> <div class="pageHeaderToolbar-toolbar-1lW-M">
<button id="id-16" data-original-title="Lire" data-toggle="tooltip" role="button" <button id="id-16" title="Lire" data-toggle="tooltip" data-placement="bottom" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-play-560" aria-hidden="true"></i></button> type="button"><i class="plex-icon-toolbar-play-560" aria-hidden="true"></i>
<button id="id-15" data-original-title="Plus..." aria-haspopup="true" data-toggle="tooltip" </button>
<button id="id-362" title="Visionner la bande annonce." data-placement="bottom" data-toggle="tooltip" role="button" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" type="button">
<i class="plex-icon-toolbar-play-trailer-560" aria-hidden="true"></i>
</button>
<button id="id-21" title="Marquer comme vu" data-placement="bottom" data-toggle="tooltip" role="button" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" type="button">
<i class="plex-icon-toolbar-played-toggle-560" aria-hidden="true"></i>
</button>
<button id="id-15" title="Plus..." aria-haspopup="true" data-placement="bottom" data-toggle="tooltip"
role="button" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-more-560" aria-hidden="true"></i></button> type="button"><i class="plex-icon-toolbar-more-560" aria-hidden="true"></i>
</button>
</div> </div>
<div class="Measure-scrollContainer-3vb4J"> <div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div> <div class="Measure-expandContent-1JQfL"></div>
@ -21,7 +29,7 @@
</div> </div>
</div> </div>
<div class="PrePlayPageHeader-divider-WQRk8 PageHeaderDivider-pageHeaderDivider-DvwUq"></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" <button id="id-14" title="Montrer les affiches" data-placement="bottom" data-toggle="tooltip" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" type="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> <i class="plex-icon-toolbar-artwork-560" aria-hidden="true"></i></button>
</div> </div>
@ -31,15 +39,14 @@
<div class="PageContent-innerPageContent-3ktLT"> <div class="PageContent-innerPageContent-3ktLT">
<div> <div>
<div style="position: fixed; top: 180px;"> <div style="position: fixed; top: 180px;">
<div class="MetadataPosterCard-cardContainer-2gRcQ" <div class="MetadataPosterCard-cardContainer-2gRcQ">
data-qa-id="metadataPosterCard--/library/metadata/28283">
<div class="MetadataPosterCard-card-3bztR " style="width: 260px; height: 390px;"> <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="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 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;" <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> class=""></div>
</div> </div>
<div class=" MetadataPosterCardOverlay-overlay-1uMpL "> <div class=" MetadataPosterCardOverlay-overlay-1uMpL">
<div class="MetadataPosterCardOverlay-background-2EwyB"></div> <div class="MetadataPosterCardOverlay-background-2EwyB"></div>
<div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn" <div class="MetadataPosterCardOverlay-unwatchedTagContainer-1lcEn"
data-qa-id="metadataPosterUnwatchedBadge"> data-qa-id="metadataPosterUnwatchedBadge">
@ -57,15 +64,30 @@
</div> </div>
</div> </div>
</div> </div>
<?php if($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') : ?>
<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'])) : ?>
<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'])) : ?>
<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'])) : ?>
<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> </div>
<div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;"> <div class="PrePlayMetadataContent-content-2ww3j" style="padding-left: 320px;">
<div> <div>
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw"> <div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayPrimaryTitle-primaryTitle-1r9P9"> <div class="PrePlayPrimaryTitle-primaryTitle-1r9P9">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"><a title="<?php echo $movie->title; ?>" <div class="PrePlayLeftTitle-leftTitle-Ev1KG">
href="#" <a title="<?php echo $movie->title; ?>" href="#" role="link" class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?></a>
role="link"
class=" Link-link-2XYrU Link-default-32xSO"><?php echo $movie->title; ?></a>
</div> </div>
</div> </div>
<div class="PrePlaySecondaryTitle-secondaryTitle-YJRGC PrePlayPrimaryTitle-primaryTitle-1r9P9" <div class="PrePlaySecondaryTitle-secondaryTitle-YJRGC PrePlayPrimaryTitle-primaryTitle-1r9P9"
@ -81,13 +103,15 @@
</span> </span>
</div> </div>
<div class="PrePlayRatingRightTitle-ratingRightTitle-1d4Yy PrePlayRightTitle-rightTitle-VxiwU"> <div class="PrePlayRatingRightTitle-ratingRightTitle-1d4Yy PrePlayRightTitle-rightTitle-VxiwU">
<span <span class="PrePlayRatingRightTitle-criticRating-2J_tn">
class="PrePlayRatingRightTitle-criticRating-2J_tn"><div <div class="CriticRating-container-2t5Lw">
class="CriticRating-container-2t5Lw"><div <div class="CriticRating-rating-1Ntfn">
class="CriticRating-rating-1Ntfn"><div <div class="CriticRating-imdb-16xaH CriticRating-ratingImage-1bHp5" title="Note"></div>
class="CriticRating-other-uJc1K CriticRating-ratingImage-1bHp5" <?php echo $movie->rating; ?>
title="Note"></div><?php echo $movie->rating * 10; ?>% </div>
</div></div></span></div> </div>
</span>
</div>
</div> </div>
<div class="PrePlayTertiaryTitle-tertiaryTitle-1Rc92"> <div class="PrePlayTertiaryTitle-tertiaryTitle-1Rc92">
<div class="PrePlayLeftTitle-leftTitle-Ev1KG"> <div class="PrePlayLeftTitle-leftTitle-Ev1KG">
@ -99,18 +123,20 @@
</div> </div>
<div class="PrePlayRightTitle-rightTitle-VxiwU"> <div class="PrePlayRightTitle-rightTitle-VxiwU">
<span> <span>
<?php foreach ($movie->metadata['Genre'] as $genre) : ?> <?php if(isset($movie->metadata['Genre'])) :?>
<?php $genre = isset($movie->metadata['Genre']['@attributes']) ? $movie->metadata['Genre'] : $genre; ?> <?php foreach ($movie->metadata['Genre'] as $genre) : ?>
<span> <?php $genre = isset($movie->metadata['Genre']['@attributes']) ? $movie->metadata['Genre'] : $genre; ?>
<a href="#" role="link" <span>
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-default-32xSO"> <a href="#" role="link"
<?php echo $genre['@attributes']['tag']; ?> class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-default-32xSO">
</a>, <?php echo $genre['@attributes']['tag']; ?>
</span> </a>,
<?php if (isset($movie->metadata['Genre']['@attributes'])) { </span>
break; <?php if (isset($movie->metadata['Genre']['@attributes'])) {
} ?> break;
<?php endforeach; ?> } ?>
<?php endforeach; ?>
<?php endif; ?>
</span> </span>
</div> </div>
</div> </div>
@ -143,18 +169,20 @@
<div class="PrePlayDetailsGroupItem-label-2Ee43">Writed by</div> <div class="PrePlayDetailsGroupItem-label-2Ee43">Writed by</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"> <div class="PrePlayDetailsGroupItem-content-1aRNU">
<span> <span>
<?php foreach ($movie->metadata['Writer'] as $writer) : ?> <?php if(isset($movie->metadata['Writer'])) :?>
<?php $writer = isset($movie->metadata['Writer']['@attributes']) ? $movie->metadata['Writer'] : $writer; ?> <?php foreach ($movie->metadata['Writer'] as $writer) : ?>
<span> <?php $writer = isset($movie->metadata['Writer']['@attributes']) ? $movie->metadata['Writer'] : $writer; ?>
<a href="#" role="link" <span>
class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO"> <a href="#" role="link"
<?php echo $writer['@attributes']['tag']; ?> class="PrePlayTagList-tagsListLink-Z6lfX Link-link-2XYrU Link-link-2XYrU Link-default-32xSO">
</a>, <?php echo $writer['@attributes']['tag']; ?>
</span> </a>,
<?php if (isset($movie->metadata['Writer']['@attributes'])) { </span>
break; <?php if (isset($movie->metadata['Writer']['@attributes'])) {
} ?> break;
<?php endforeach; ?> } ?>
<?php endforeach; ?>
<?php endif; ?>
</span> </span>
</div> </div>
</div> </div>
@ -177,9 +205,9 @@
<div class="PrePlayDetailsGroupItem-label-2Ee43">Vidéo</div> <div class="PrePlayDetailsGroupItem-label-2Ee43">Vidéo</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"> <div class="PrePlayDetailsGroupItem-content-1aRNU">
<span data-qa-id="videoStream"> <span data-qa-id="videoStream">
SD <?php echo $movie->getMetaData()['Media']['@attributes']['videoResolution']; ?>p
<span class="DashSeparator-separator-2a3yn"></span> <span class="DashSeparator-separator-2a3yn"></span>
MPEG4 <?php echo $movie->getMetaData()['Stream']['Video'][0]['codec']; ?>
</span> </span>
</div> </div>
</div> </div>
@ -187,15 +215,25 @@
<div class="PrePlayDetailsGroupItem-label-2Ee43">Audio</div> <div class="PrePlayDetailsGroupItem-label-2Ee43">Audio</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"> <div class="PrePlayDetailsGroupItem-content-1aRNU">
<span> <span>
Inconnu <?php echo $movie->getMetaData()['Stream']['Audio'][0]['language']; ?>
<span class="DashSeparator-separator-2a3yn"></span> <span class="DashSeparator-separator-2a3yn"></span>
MP3 Stéréo <?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> </span>
</div> </div>
</div> </div>
<div class="PrePlayDetailsGroupItem-groupItem-3Tut9"> <div class="PrePlayDetailsGroupItem-groupItem-3Tut9">
<div class="PrePlayDetailsGroupItem-label-2Ee43">Sous-titres</div> <div class="PrePlayDetailsGroupItem-label-2Ee43">Sous-titres</div>
<div class="PrePlayDetailsGroupItem-content-1aRNU"><span>Aucun</span></div> <div class="PrePlayDetailsGroupItem-content-1aRNU">
<span>
<?php if(count($movie->getMetaData()['Stream']['SubTitle']) > 0): ?>
<?php echo isset($movie->getMetaData()['Stream']['SubTitle'][0]['language']) ? $movie->getMetaData()['Stream']['SubTitle'][0]['language'] : ''; ?>
<span class="DashSeparator-separator-2a3yn"></span>
<?php echo isset($movie->getMetaData()['Stream']['SubTitle'][0]['displayTitle']) ? $movie->getMetaData()['Stream']['SubTitle'][0]['displayTitle'] : $movie->getMetaData()['Stream']['SubTitle'][0]['title']; ?>
<?php else: ?>
Aucun
<?php endif;?>
</span>
</div>
</div> </div>
</div> </div>
<div class="PrePlaySummary-summary-1NL8g"> <div class="PrePlaySummary-summary-1NL8g">
@ -213,10 +251,75 @@
<button aria-haspopup="true" role="button" <button aria-haspopup="true" role="button"
class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO" class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button">Show more 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> <div class="CollapsibleText-readMoreArrow-34BdB 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> </button>
</div> </div>
</div> </div>
<div class="PrePlayMetadataListInnerContent-innerContent-2CsIz">
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayCastList-castList-3dQB5">
<div class="HubCell-hubCell-3Ys17" style="visibility: visible;" data-qa-id="hub--cast">
<div class="HubCellHeader-hubCellHeader-2pvYN">
<div class="HubCellTitle-hubCellTitle-2abIn" data-qa-id="hubCellTitle">ACTEURS</div>
<div class="HubCell-hubActions-28w1-">
<button data-qa-id="hubPreviousButton" role="button" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled " type="button" disabled="">
<i class="plex-icon-hub-prev-560" aria-hidden="false" aria-label="Page précédente"></i>
</button>
<button data-qa-id="hubNextButton" role="button" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO" type="button">
<i class="plex-icon-hub-next-560" aria-hidden="false" aria-label="Page suivante"></i>
</button>
</div>
</div>
<div style="height: 183px; overflow: hidden;">
<div class="Measure-container-3yONE">
<div class="HubCell-hubScroller-2qgkr VirtualListScroller-scroller-37EU_ Scroller-horizontal-cOKsq Scroller-scroller-3GqQc Scroller-horizontal-cOKsq ">
<?php $translate = -143; ?>
<div class=" " style="width: 5012px; height: 183px;">
<?php if(isset($movie->getMetadata()['Role'])) : ?>
<?php foreach ($movie->getMetadata()['Role'] as $role) : ?>
<?php $translate += 148; ?>
<div data-qa-id="cellItem" style="position: absolute; width: 118px; height: 168px; transform: translate3d(<?php echo $translate; ?>px, 10px, 0px);">
<a href="#" role="link" class="PrePlayCastCell-cardLink-Tndv5 Link-link-2XYrU Link-default-32xSO">
<div class="TagPosterCard-card-RVD0D MetadataPosterCardFace-poster-L2P6r TagPosterCard-isPerson-1ez1h" style="width: 118px; height: 118px;">
<?php if (isset($role['@attributes']['thumb'])) : ?>
<div class="PosterCardImg-imageContainer-1Ar4M">
<div style="background-image: url('<?php echo $role['@attributes']['thumb']; ?>'); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;" class=""></div>
</div>
<?php else : ?>
<div style="font-size: 30px; line-height: 118px;" class="Anagram-anagram-2KZ_Z">
<?php
$actor = explode(' ',$role['@attributes']['tag']);
echo substr($actor[0],0,1).substr($actor[1],0,1);
?>
</div>
<?php endif; ?>
</div>
</a>
<div class="PrePlayCastCell-titleContainer-PAy29">
<a data-qa-id="castTitle" title="<?php echo $role['@attributes']['tag']; ?>" href="#" role="link" class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO">
<?php echo $role['@attributes']['tag']; ?>
</a>
<span class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY " title="Johnny English">
<?php echo $role['@attributes']['role']; ?>
</span>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<div class="Measure-scrollContainer-1c6dy">
<div class="Measure-expandContent-zsLw6"></div>
</div>
<div class="Measure-scrollContainer-1c6dy">
<div class="Measure-shrinkContent-303GS Measure-expandContent-zsLw6"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
<div class="PrePlayMetadataListInnerContent-innerContent-2CsIz"> <div class="PrePlayMetadataListInnerContent-innerContent-2CsIz">
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw"> <div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
@ -238,6 +341,18 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(window).on('load', function() { $(window).on('load', function() {
/** READ MORE **/
$(document).on('click', '.CollapsibleText-readMore-1bRJm', function (event) {
var summary = $(document).find('.CollapsibleText-contentTransition-15VYv');
if(summary.css('max-height') === '78px') {
$(this).find('div').removeClass('DisclosureArrow-down-1U7WW').addClass('DisclosureArrow-up-1U7WW');
summary.css('max-height', '10000px');
} else {
$(this).find('div').removeClass('DisclosureArrow-up-1U7WW').addClass('DisclosureArrow-down-1U7WW');
summary.css('max-height', '78px');
}
});
/** LAUNCH PLAYER **/ /** LAUNCH PLAYER **/
$(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) { $(document).on('click', '.MetadataPosterCardOverlay-playButton-1fjhk.PlayButton-playButton-3WX8X', function (event) {
event.stopPropagation(); event.stopPropagation();

@ -1,5 +1,5 @@
<head> <head>
<title>Plex</title> <title>PlexShare :: Settings</title>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
@ -14,7 +14,7 @@
<div id="plex" class="application"> <div id="plex" class="application">
<?php echo \View::forge('layout/nav_bar_header', ['user' => $user]); ?> <?php echo \View::forge('layout/nav_bar_header', ['user' => $user]); ?>
<div class="background-container"> <div class="background-container">
<div data-reactroot="" class="FullPage-container-17Y0c"> <div class="FullPage-container-17Y0c">
<div> <div>
<div> <div>
<div style="background-image: url('//assets.plex.tv/deploys/desktop/env-eb2798cc3c7d9533df5b563963d5c394/3.41.1-304f788/common/img/backgrounds/preset-dark.64cc1c942221cd2c153244bd8ecfb67a.png'); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;" <div style="background-image: url('//assets.plex.tv/deploys/desktop/env-eb2798cc3c7d9533df5b563963d5c394/3.41.1-304f788/common/img/backgrounds/preset-dark.64cc1c942221cd2c153244bd8ecfb67a.png'); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;"
@ -29,11 +29,6 @@
<li class="web-nav-item"><a class="web-btn btn-gray" href="/settings">General</a></li> <li class="web-nav-item"><a class="web-btn btn-gray" href="/settings">General</a></li>
<li class="server-nav-item "><a class="server-btn btn-gray" href="/settings/servers">My Servers<span class="badge">0</span></a></li> <li class="server-nav-item "><a class="server-btn btn-gray" href="/settings/servers">My Servers<span class="badge">0</span></a></li>
<li class="users-nav-item "><a class="users-btn btn-gray" href="/settings/libraries">My Libraries<span class="badge">0</span></a></li> <li class="users-nav-item "><a class="users-btn btn-gray" href="/settings/libraries">My Libraries<span class="badge">0</span></a></li>
<?php if($user->admin) : ?>
<li class="server-nav-item "><a class="server-btn btn-gray" href="/admin/servers">All Servers<span class="badge">0</span></a></li>
<li class="users-nav-item "><a class="users-btn btn-gray" href="/admin/libraries">All Libraries<span class="badge">0</span></a></li>
<li class="devices-nav-item "><a class="devices-btn btn-gray" href="/admin/users">Users</a></li>
<?php endif; ?>
</ul> </ul>
<h2>Settings</h2> <h2>Settings</h2>
<?php echo $body; ?> <?php echo $body; ?>
@ -42,14 +37,14 @@
<div> <div>
</div> </div>
</div> </div>
<?php
echo \Asset::js(isset($js_bottom) ? $js_bottom : null);
echo \Asset::js(['bootstrap.min.js']);
?>
<script> <script>
$(document).ready(function () { $(window).on('load', function() {
$('[data-toggle="tooltip"]').tooltip({ container: 'body'}); $('[data-toggle="tooltip"]').tooltip({ container: 'body'});
}); });
</script> </script>
<?php
echo \Asset::js(['bootstrap.min.js']);
echo \Asset::js(isset($js_bottom) ? $js_bottom : null);
?>
</body> </body>
</html> </html>

@ -5,7 +5,7 @@
<div class="col-sm-4 col-md-3"> <div class="col-sm-4 col-md-3">
<ul class="settings-nav nav nav-cards"> <ul class="settings-nav nav nav-cards">
<li><a class="card btn-gray selected" href="#general-web-group">General</a></li> <li><a class="card btn-gray selected" href="#general-web-group">General</a></li>
<li><a class="card btn-gray" href="#quality-web-group">Sub Account</a></li> <li><a class="card btn-gray" href="#subaccount-web-group">Sub Account</a></li>
<li><a class="card btn-gray" href="#player-web-group">Player</a></li> <li><a class="card btn-gray" href="#player-web-group">Player</a></li>
</ul> </ul>
</div> </div>
@ -16,68 +16,118 @@
<div class="form-group"> <div class="form-group">
<label for="language">Language</label> <label for="language">Language</label>
<select id="language"> <select id="language">
<option value="en" selected=""> English</option> <option value="english" selected=""> English</option>
<option value="fr"> Français</option> <option value="french"> Français</option>
</select> </select>
<p class="help-block"> <p class="help-block">
Aidez-nous à traduire cette application dans votre langue <a href="https://transifex.com/plex-1/plex-web" target="_blank">ici</a>. Aidez-nous à traduire cette application dans votre langue <a
href="https://transifex.com/plex-1/plex-web" target="_blank">ici</a>.
</p> </p>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="input_FriendlyName_c"> <label class="control-label" for="input_FriendlyName_c">
Second refresh Second refresh
</label> </label>
<input id="input_FriendlyName_c" class="form-control" name="refresh" value="" placeholder="ex: 800" type="text"> <input id="input_FriendlyName_c" class="form-control" name="refresh" value=""
placeholder="ex: 800" type="text">
<p class="help-block">Number in second, you want to check new content on server.</p> <p class="help-block">Number in second, you want to check new content on server.</p>
</div> </div>
</div> </div>
<div id="player-web-group" class="settings-group"><h4 class="settings-header-first ">Audio &amp; <div id="subaccount-web-group" class="settings-group">
sous-titres</h4> <h4 class="settings-header-first">Sub Account</h4>
<div class="form-group advanced-setting"><label for="audioBoost">Augmenter le volume du son <h6><button class="btn btn-primary"><i class="glyphicon circle-plus"></i> Add sub account</button></h6>
multi-canal</label> <select id="audioBoost" data-type="int"> <div class="device-list-container col-sm-12">
<option value="100" selected="">Aucun</option> <ul class="list card-tile-list">
<option value="150">Petite</option> <li class="card-tile-list-item card-2-col-item">
<option value="200">Grande</option> <div class="card card-device">
<option value="250">Énorme</option> <div class="card-actions">
<button class="remove-device-btn card-action-btn" title="Permissions" data-toggle="tooltip" data-placement="top">
<i class="glyphicon unlock"></i>
</button>
<button class="remove-device-btn card-action-btn btn-danger" title="Delete" data-toggle="tooltip" data-placement="top">
<i class="glyphicon remove-2"></i>
</button>
</div>
<h4 class="name">Chewbaka</h4>
<div class="card-details">
<div class="version text-muted">Last use: an hour ago</div>
</div>
</div>
</li>
</ul>
</div>
</div>
<div id="player-web-group" class="settings-group">
<h4 class="settings-header-first">Streaming</h4>
<div class="form-group">
<label for="remoteQuality">Video Quality</label>
<select id="remoteQuality" data-type="int">
<option value="-1">Maximale</option>
<option value="20000"> 20 Mbps, 1080p</option>
<option value="12000"> 12 Mbps, 1080p</option>
<option value="10000"> 10 Mbps, 1080p</option>
<option value="8000"> 8 Mbps, 1080p</option>
<option value="4000"> 4 Mbps, 720p</option>
<option value="3000"> 3 Mbps, 720p</option>
<option value="2000" selected=""> 2 Mbps, 720p</option>
<option value="1500"> 1.5 Mbps, 480p</option>
<option value="700"> 0.7 Mbps</option>
<option value="300"> 0.3 Mbps</option>
<option value="200"> 0.2 Mbps</option>
</select> </select>
<p class="help-block">Augmente le volume si le son est converti de multi-canal à <p class="help-block">Set the default quality for streaming video over the internet. If
stéréo.</p></div> quality is set too high, videos will start slowly and pause frequently.</p></div>
<div class="form-group"><label for="subtitleSize">Taille des sous-titres</label> <select <div class="form-group">
id="subtitleSize" data-type="int"> <label for="subtitleSize">Subtitle Size</label>
<option value="50">Minuscule</option> <select id="subtitleSize" data-type="int">
<option value="75">Petite</option> <option value="50">Tiny</option>
<option value="100" selected="">Normale</option> <option value="75">Small</option>
<option value="125">Grande</option> <option value="100" selected="">Normal</option>
<option value="200">Énorme</option> <option value="125">Large</option>
</select></div> <option value="200">Huge</option>
<div class="form-group advanced-setting"><label for="subtitlesBurnLevel">Incruster les
sous-titres</label> <select id="subtitlesBurnLevel">
<option value="auto" selected="">Automatique</option>
<option value="avoid">Seulement le format des images</option>
<option value="always">Toujours</option>
</select> </select>
<p class="help-block">Détermine si le serveur doit incruster les sous-titres lors de </div>
l'encodage, en fonction du format des sous-titres. Eviter l'incrustation des
sous-titres améliore les performances du serveur, mais n'est possible qu'avec le
lecteur HTML5.</p></div>
<h4 class="settings-header">Bonus</h4> <h4 class="settings-header">Bonus</h4>
<div class="form-group"><label for="extrasPrefixCount">Bandes annonces de Cinema avant le <div class="form-group">
film</label> <select id="extrasPrefixCount" data-type="int"> <label for="extrasPrefixCount">Cinema Trailers to Play Before Movies</label>
<option value="0" selected="">Aucun</option> <select id="extrasPrefixCount" data-type="int">
<option value="0" selected="">None</option>
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>
<option value="3">3</option> <option value="3">3</option>
<option value="4">4</option> <option value="4">4</option>
<option value="5">5</option> <option value="5">5</option>
</select></div> </select>
</div>
</div> </div>
<div class="form-footer"> <div class="form-footer">
<button type="submit" class="submit-btn btn btn-lg btn-primary btn-loading disabled"> <button type="submit" class="submit-btn btn btn-lg btn-primary disabled">
<div class="loading loading-sm"></div>
<span class="btn-label">Enregistrer les modifications</span></button> <span class="btn-label">Enregistrer les modifications</span></button>
<span class="form-message"></span></div> <span class="form-message"></span></div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript">
$(window).on('load', function () {
if(window.location.hash !== '') {
var href = window.location.hash;
$('.settings-nav li .card').removeClass('selected');
$('.settings-nav li .card[href="' + href + '"]').addClass('selected');
$('#web-settings-form .settings-group').removeClass('active');
$(href).addClass('active');
}
$(document).on('click', '.settings-nav li .card', function (event) {
$('.settings-nav li .card').removeClass('selected');
$(this).addClass('selected');
var href = $(this).attr('href');
$('#web-settings-form .settings-group').removeClass('active');
$(href).addClass('active');
});
});
</script>

@ -89,38 +89,7 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(window).on('load', function() {
$('.filter-bar .add').on('click', function () {
$.ajax({
method: 'get',
url: '/rest/settings/add_server.json'
}).done(function (data) {
$('body').append(data);
setTimeout(function(){
$('.media-server-modal').removeClass('out').addClass('in');
},100);
});
});
$(document).on('click', '.media-server-modal button.close', function () {
$('.media-server-modal').removeClass('in').addClass('out').delay(500).queue(function(){ $(this).remove()});
});
$(document).on('click', '#add-plex button', function () {
var url = $('#add-plex #url').val();
var port = $('#add-plex #port').val();
var token = $('#add-plex #token').val();
$.ajax({
method: 'post',
url: '/rest/settings/server.json',
data: {url: url, port: port, token: token}
}).done(function (data) {
show_alert('success', 'Server save succesfully!');
$('.media-server-modal button.close').click();
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
setTimeout(function(){location.reload()}, 200);
});
});
// LIBRARY BUTTON ACTION // LIBRARY BUTTON ACTION
$('button.refresh-library-btn').on('click', function () { $('button.refresh-library-btn').on('click', function () {
var library_id = $(this).data('library-id'); var library_id = $(this).data('library-id');
@ -155,6 +124,21 @@
show_alert('error', data.message); show_alert('error', data.message);
}); });
}); });
$('button.enable-library-btn').on('click', function () {
var button = this;
var library_id = $(this).data('library-id');
$.ajax({
method: 'put',
url: '/rest/settings/library.json',
data: {library_id: library_id}
}).done(function (data) {
show_alert('success', 'Library enable succesfully!');
$(button).closest('.card.card-device').removeClass('disabled');
}).fail(function (data) {
data = JSON.parse(data.responseText);
show_alert('error', data.message);
});
});
// REFRESH ALL LIBRARIES // REFRESH ALL LIBRARIES
$('.filter-bar .refresh').on('click', function () { $('.filter-bar .refresh').on('click', function () {

@ -60,7 +60,7 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(window).on('load', function() {
$('.filter-bar .add').on('click', function () { $('.filter-bar .add').on('click', function () {
$.ajax({ $.ajax({
method: 'get', method: 'get',

@ -1,4 +1,5 @@
<input id="data_movie" type="hidden" data-src="<?php echo $movie->getStreamUrl(); ?>"/> <input id="data_movie" type="hidden" data-src="<?php echo $movie->getStreamUrl(); ?>"/>
<input id="data_movie_id" type="hidden" data-movie-id="<?php echo $movie->id; ?>"/>
<button aria-label="Lire" role="playCenter" type="button" <button aria-label="Lire" role="playCenter" type="button"
class="PlayPauseOverlay-playButton-25OfW PlayButton-playButton-3WX8X Link-link-2XYrU Link-default-32xSO" class="PlayPauseOverlay-playButton-25OfW PlayButton-playButton-3WX8X Link-link-2XYrU Link-default-32xSO"
style="z-index: 0"> style="z-index: 0">
@ -28,7 +29,7 @@
</div> </div>
</div> </div>
<!-- Quality choice --> <!-- Quality choice -->
<div class="AudioVideoPlaybackSettings-container-2pTAj AudioVideoStripeContainer-container-MI02O" style="display: none; bottom: 86px;"> <div class="AudioVideoPlaybackSettings-container-2pTAj AudioVideoStripeContainer-container-MI02O" style="transform: translateY(246px)">
<div class="AudioVideoPlaybackSettings-title-2MRYF">Configuration de la lecture</div> <div class="AudioVideoPlaybackSettings-title-2MRYF">Configuration de la lecture</div>
<div class="AudioVideoPlaybackSettings-menusContainer-2bvbj" data-qa-id="playbackSettingsContainer"> <div class="AudioVideoPlaybackSettings-menusContainer-2bvbj" data-qa-id="playbackSettingsContainer">
<div class="AudioVideoSettingsRow-row-2CrSz "> <div class="AudioVideoSettingsRow-row-2CrSz ">
@ -64,8 +65,7 @@
style="bottom: -86px; height: 86px; z-index: 0"> style="bottom: -86px; height: 86px; z-index: 0">
<div class="AudioVideoBottomBar-controlsContainer-2c743"> <div class="AudioVideoBottomBar-controlsContainer-2c743">
<div> <div>
<di v <div class="AudioVideoBottomBar-seekBar-2ai3z SeekBar-seekBar-2UK3i Slider-slider-2oLVT Slider-hasAutoHideThumb-tpdhC">
class="AudioVideoBottomBar-seekBar-2ai3z SeekBar-seekBar-2UK3i Slider-slider-2oLVT Slider-hasAutoHideThumb-tpdhC">
<div class="SeekBar-seekBarTrack-3Gu5R Slider-track-28JOS"> <div class="SeekBar-seekBarTrack-3Gu5R Slider-track-28JOS">
<div class="SeekBar-seekBarBuffer-3bUz9 Slider-secondaryFill-31_05 Slider-fill-35GFq " <div class="SeekBar-seekBarBuffer-3bUz9 Slider-secondaryFill-31_05 Slider-fill-35GFq "
style="transform: scaleX(0);"></div> style="transform: scaleX(0);"></div>
@ -107,7 +107,7 @@
</div> </div>
<?php else : ?> <?php else : ?>
<div class="AudioVideoPlayerControlsMetadata-titlesContainer-1oLik"> <div class="AudioVideoPlayerControlsMetadata-titlesContainer-1oLik">
<a title="<?php echo $movie->title; ?>" href="#" role="link" <a title="<?php echo $movie->title; ?>" href="/movie/<?php echo $movie->id; ?>" role="link"
class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO"> class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO">
<?php echo $movie->title; ?> <?php echo $movie->title; ?>
</a> </a>
@ -122,7 +122,7 @@
<button data-qa-id="mediaDuration" role="button" <button data-qa-id="mediaDuration" role="button"
class="DurationRemaining-container-1F4w8 Link-link-2XYrU Link-default-32xSO" class="DurationRemaining-container-1F4w8 Link-link-2XYrU Link-default-32xSO"
type="button"><span class="media-time">00:00</span> / <span type="button"><span class="media-time">00:00</span> / <span
class="media-duration"><?php echo $movie->getDuractionMovie(); ?></span></button> class="media-duration"><?php echo $movie->getDurationMovie(); ?></span></button>
</div> </div>
</div> </div>
<div class="AudioVideoPlayerControls-buttonGroupCenter-Vok98 AudioVideoPlayerControls-buttonGroup-ShnOa"> <div class="AudioVideoPlayerControls-buttonGroupCenter-Vok98 AudioVideoPlayerControls-buttonGroup-ShnOa">

@ -8,10 +8,6 @@
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-play-560" type="button"><i class="plex-icon-toolbar-play-560"
aria-hidden="true"></i></button> aria-hidden="true"></i></button>
<button id="id-568" aria-label="Visionner la bande annonce." role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-play-trailer-560"
aria-hidden="true"></i></button>
<button id="id-639" aria-label="Ordre aléatoire." data-qa-id="toolbarShuffle" role="button" <button id="id-639" aria-label="Ordre aléatoire." data-qa-id="toolbarShuffle" role="button"
class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO" class="ToolbarButton-toolbarButton-3xzHJ Link-link-2XYrU Link-default-32xSO"
type="button"><i class="plex-icon-toolbar-shuffle-560" type="button"><i class="plex-icon-toolbar-shuffle-560"
@ -122,7 +118,7 @@
</div> </div>
</div> </div>
<div class="PrePlaySummary-summary-1NL8g"> <div class="PrePlaySummary-summary-1NL8g">
<div class="false" style="overflow: hidden; max-height: 78px;"> <div class="CollapsibleText-contentTransition-15VYv" style="overflow: hidden; max-height: 78px;">
<div class="Measure-container-2XznZ"><?php echo $tvshow->summary; ?> <div class="Measure-container-2XznZ"><?php echo $tvshow->summary; ?>
<div class="Measure-scrollContainer-3vb4J"> <div class="Measure-scrollContainer-3vb4J">
<div class="Measure-expandContent-1JQfL"></div> <div class="Measure-expandContent-1JQfL"></div>
@ -134,8 +130,8 @@
</div> </div>
<button aria-haspopup="true" role="button" <button aria-haspopup="true" role="button"
class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO" class="CollapsibleText-readMore-1bRJm DisclosureArrowButton-disclosureArrowButton-3tbYZ DisclosureArrowButton-medium-3-Y37 Link-link-2XYrU Link-default-32xSO"
type="button">Voir plus type="button">Read 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> <div class="CollapsibleText-readMoreArrow-34BdB 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> </button>
</div> </div>
</div> </div>
@ -153,11 +149,10 @@
<div class="HubCellTitle-hubCellTitle-2abIn" data-qa-id="hubCellTitle">SAISONS</div> <div class="HubCellTitle-hubCellTitle-2abIn" data-qa-id="hubCellTitle">SAISONS</div>
</div> </div>
<div> <div>
<div class=" " style="width: 1226px; height: 248px;"> <div class=" " style="width: 100%;">
<?php $translate = -132; ?>
<?php foreach ($tvshow->getSeasons() as $season) : ?> <?php foreach ($tvshow->getSeasons() as $season) : ?>
<div class=" virtualized-cell-3KPHx" <div class=" virtualized-cell-3KPHx"
style="position: absolute; width: 122px; height: 233px; transform: translate3d(<?php echo $translate += 152; ?>px, 10px, 0px);"> style="position: relative; width: 137px; height: 206px; display: inline-block; margin-left: 28px; margin-top: 10px">
<div class="MetadataPosterCard-cardContainer-2gRcQ" <div class="MetadataPosterCard-cardContainer-2gRcQ"
data-qa-id="metadataPosterCard--/library/metadata/28083"> data-qa-id="metadataPosterCard--/library/metadata/28083">
<div class="MetadataPosterCard-card-3bztR " <div class="MetadataPosterCard-card-3bztR "
@ -215,6 +210,71 @@
</div> </div>
</div> </div>
</div> </div>
<div class="PrePlayMetadataListInnerContent-innerContent-2CsIz">
<div class="PrePlayMetadataInnerContent-innerContent-1BPzw">
<div class="PrePlayCastList-castList-3dQB5">
<div class="HubCell-hubCell-3Ys17" style="visibility: visible;" data-qa-id="hub--cast">
<div class="HubCellHeader-hubCellHeader-2pvYN">
<div class="HubCellTitle-hubCellTitle-2abIn" data-qa-id="hubCellTitle">ACTEURS</div>
<div class="HubCell-hubActions-28w1-">
<button data-qa-id="hubPreviousButton" role="button" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO isDisabled " type="button" disabled="">
<i class="plex-icon-hub-prev-560" aria-hidden="false" aria-label="Page précédente"></i>
</button>
<button data-qa-id="hubNextButton" role="button" class="HubCell-hubScrollButton-2Y7ri Link-link-2XYrU Link-default-32xSO" type="button">
<i class="plex-icon-hub-next-560" aria-hidden="false" aria-label="Page suivante"></i>
</button>
</div>
</div>
<div style="height: 183px; overflow: hidden;">
<div class="Measure-container-3yONE">
<div class="HubCell-hubScroller-2qgkr VirtualListScroller-scroller-37EU_ Scroller-horizontal-cOKsq Scroller-scroller-3GqQc Scroller-horizontal-cOKsq ">
<?php $translate = -143; ?>
<div class=" " style="width: 5012px; height: 183px;">
<?php if(isset($tvshow->getMetadata()['Role'])) : ?>
<?php foreach ($tvshow->getMetadata()['Role'] as $role) : ?>
<?php $translate += 148; ?>
<div data-qa-id="cellItem" style="position: absolute; width: 118px; height: 168px; transform: translate3d(<?php echo $translate; ?>px, 10px, 0px);">
<a href="#" role="link" class="PrePlayCastCell-cardLink-Tndv5 Link-link-2XYrU Link-default-32xSO">
<div class="TagPosterCard-card-RVD0D MetadataPosterCardFace-poster-L2P6r TagPosterCard-isPerson-1ez1h" style="width: 118px; height: 118px;">
<?php if (isset($role['@attributes']['thumb'])) : ?>
<div class="PosterCardImg-imageContainer-1Ar4M">
<div style="background-image: url('<?php echo $role['@attributes']['thumb']; ?>'); background-size: cover; background-position: center center; background-repeat: no-repeat; width: 100%; height: 100%; position: absolute; z-index: 2;" class=""></div>
</div>
<?php else : ?>
<div style="font-size: 30px; line-height: 118px;" class="Anagram-anagram-2KZ_Z">
<?php
$actor = explode(' ',$role['@attributes']['tag']);
echo substr($actor[0],0,1).substr($actor[1],0,1);
?>
</div>
<?php endif; ?>
</div>
</a>
<div class="PrePlayCastCell-titleContainer-PAy29">
<a data-qa-id="castTitle" title="<?php echo $role['@attributes']['tag']; ?>" href="#" role="link" class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F Link-link-2XYrU Link-default-32xSO">
<?php echo $role['@attributes']['tag']; ?>
</a>
<span class=" MetadataPosterTitle-singleLineTitle-24_DN MetadataPosterTitle-title-3tU5F MetadataPosterTitle-isSecondary-2VUxY " title="Johnny English">
<?php echo $role['@attributes']['role']; ?>
</span>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<div class="Measure-scrollContainer-1c6dy">
<div class="Measure-expandContent-zsLw6"></div>
</div>
<div class="Measure-scrollContainer-1c6dy">
<div class="Measure-shrinkContent-303GS Measure-expandContent-zsLw6"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -229,6 +289,18 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(window).on('load', function() { $(window).on('load', function() {
/** READ MORE **/
$(document).on('click', '.CollapsibleText-readMore-1bRJm', function (event) {
var summary = $(document).find('.CollapsibleText-contentTransition-15VYv');
if(summary.css('max-height') === '78px') {
$(this).find('div').removeClass('DisclosureArrow-down-1U7WW').addClass('DisclosureArrow-up-1U7WW');
summary.css('max-height', '10000px');
} else {
$(this).find('div').removeClass('DisclosureArrow-up-1U7WW').addClass('DisclosureArrow-down-1U7WW');
summary.css('max-height', '78px');
}
});
$('.PosterCardImg-imageContainer-1Ar4M[data-tvshow-id]').each(function (index, element) { $('.PosterCardImg-imageContainer-1Ar4M[data-tvshow-id]').each(function (index, element) {
var tvshow_id = $(element).data('tvshow-id'); var tvshow_id = $(element).data('tvshow-id');
$('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id=' + tvshow_id + '&width=' + 325 + '&height=' + 488 + '")'); $('[data-tvshow-id="' + tvshow_id + '"] > div').css('background-image', 'url("/cover/tvshow?tvshow_id=' + tvshow_id + '&width=' + 325 + '&height=' + 488 + '")');

File diff suppressed because one or more lines are too long

@ -12,7 +12,9 @@ function toHHMMSS(num) {
if(hours > 0){times += hours+':'} if(hours > 0){times += hours+':'}
return times + minutes + ':' + seconds; return times + minutes + ':' + seconds;
} }
var player = null; var player = null;
function launchPlayer(view) { function launchPlayer(view) {
var lastTimeMouseMoved = null; var lastTimeMouseMoved = null;
var timeout = null; var timeout = null;
@ -31,7 +33,7 @@ function launchPlayer(view) {
player = new Clappr.Player({ player = new Clappr.Player({
source: movie_src, source: movie_src,
parentId: '#movie_id', parentId: '#movie_stream',
width: '100%', width: '100%',
height: '100%', height: '100%',
mediacontrol: false, mediacontrol: false,
@ -42,7 +44,7 @@ function launchPlayer(view) {
}, },
events: { events: {
onReady: function () { onReady: function () {
$('#movie_id').find('.media-control, .player-poster').remove(); $('#movie_stream').find('.media-control, .player-poster').remove();
}, },
onPause: function () { onPause: function () {
$('button[data-qa-id="resumeButton"] i').toggleClass('plex-icon-player-play-560 plex-icon-player-pause-560'); $('button[data-qa-id="resumeButton"] i').toggleClass('plex-icon-player-play-560 plex-icon-player-pause-560');
@ -55,6 +57,10 @@ function launchPlayer(view) {
$('.media-time').html(toHHMMSS(timeplay)); $('.media-time').html(toHHMMSS(timeplay));
$('.SeekBar-seekBarFill-1Lcu0').css('transform', 'scaleX('+ percent +')'); $('.SeekBar-seekBarFill-1Lcu0').css('transform', 'scaleX('+ percent +')');
if(parseInt(percent * 100) > 1) {
ajaxPlayingMovies($('#data_movie_id').data('movie-id'));
}
} }
} }
}); });
@ -65,6 +71,7 @@ function launchPlayer(view) {
}); });
/** EVENT PLAYER TO GET CURRENT TIME **/ /** EVENT PLAYER TO GET CURRENT TIME **/
/** BUFFER BAR PROGRESS **/
player.core.getCurrentContainer().on(Clappr.Events.CONTAINER_PROGRESS, function(progress) { player.core.getCurrentContainer().on(Clappr.Events.CONTAINER_PROGRESS, function(progress) {
var buffer = progress.current / progress.total; var buffer = progress.current / progress.total;
$('.SeekBar-seekBarBuffer-3bUz9').css('transform', 'scaleX('+ buffer +')'); $('.SeekBar-seekBarBuffer-3bUz9').css('transform', 'scaleX('+ buffer +')');
@ -78,7 +85,6 @@ function launchPlayer(view) {
}); });
/** RESUME **/ /** RESUME **/
$(document).on('click', 'button[data-qa-id="resumeButton"]', function () { $(document).on('click', 'button[data-qa-id="resumeButton"]', function () {
console.log(player.isPlaying());
if(!player.isPlaying()) if(!player.isPlaying())
$('button[role="playCenter"]').click(); $('button[role="playCenter"]').click();
else else
@ -99,27 +105,38 @@ function launchPlayer(view) {
else else
fullScreen(); fullScreen();
}); });
/** SETTINGS AUDIO VIDEO AND SUBTITLES **/
$(document).on('click', '.AudioVideoPlayerControls-buttonGroupRight-17650 .AudioVideoPlayerControls-auxButtons-2YhIh > button', function (event) {
var video_audio_control = $('.AudioVideoPlaybackSettings-container-2pTAj.AudioVideoStripeContainer-container-MI02O');
if(video_audio_control.css('transform') === 'matrix(1, 0, 0, 1, 0, 246)')
video_audio_control.css('transform', 'translateY(0px)');
else
video_audio_control.css('transform', 'translateY(246px)');
});
/** HOVER PLAYER, BUTTON CENTER AND NAVBAR SHOW NAVBAR **/ /** HOVER PLAYER, BUTTON CENTER AND NAVBAR SHOW NAVBAR **/
$(document).on('mouseover', '#movie_id , button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi', function (event) { $(document).on('mouseover', '#movie_stream , button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi, .AudioVideoPlaybackSettings-container-2pTAj.AudioVideoStripeContainer-container-MI02O', function (event) {
clearTimeout(timeout); clearTimeout(timeout);
$('.AudioVideoFullPlayer-topBar-2XUGM').css('transform', 'translateY(60px)'); $('.AudioVideoFullPlayer-topBar-2XUGM').css('transform', 'translateY(60px)');
$('.AudioVideoFullPlayer-bottomBar-2yixi').css('transform', 'translateY(-86px)'); $('.AudioVideoFullPlayer-bottomBar-2yixi').css('transform', 'translateY(-86px)');
}); });
/** BUTTON CENTER AND NAVBAR HIDE NAVBAR **/ /** BUTTON CENTER AND NAVBAR HIDE NAVBAR **/
$(document).on('mouseout', 'button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi', function (event) { $(document).on('mouseleave', '#movie_stream, #video_controls', function (event) {
$('.AudioVideoFullPlayer-topBar-2XUGM').css('transform', ''); $('.AudioVideoFullPlayer-topBar-2XUGM').css('transform', '');
$('.AudioVideoFullPlayer-bottomBar-2yixi').css('transform', ''); $('.AudioVideoFullPlayer-bottomBar-2yixi').css('transform', '');
$('.AudioVideoPlaybackSettings-container-2pTAj.AudioVideoStripeContainer-container-MI02O').css('transform', 'translateY(246px)');
}); });
/** MOUSE MOVE ON PLAYER KEEP VISIBLE NAVBAR **/ /** MOUSE MOVE ON PLAYER KEEP VISIBLE NAVBAR **/
$(document).on('mousemove', '#movie_id, button[role="playCenter"]', function () { $(document).on('mousemove', '#movie_stream, button[role="playCenter"]', function () {
$('button[role="playCenter"], #movie_id').css('cursor', 'pointer'); $('button[role="playCenter"], #movie_stream').css('cursor', 'pointer');
$('button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi').mouseover(); $('button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi').mouseover();
lastTimeMouseMoved = new Date().getTime(); lastTimeMouseMoved = new Date().getTime();
timeout = setInterval(function() { timeout = setInterval(function() {
var currentTime = new Date().getTime(); var currentTime = new Date().getTime();
if ((currentTime - lastTimeMouseMoved) > 1000) { if ((currentTime - lastTimeMouseMoved) > 1000) {
$('button[role="playCenter"], #movie_id').css('cursor', 'none'); $('button[role="playCenter"], #movie_stream').css('cursor', 'none');
$('button[role="playCenter"], .AudioVideoFullPlayer-topBar-2XUGM, .AudioVideoFullPlayer-bottomBar-2yixi').mouseout(); $('#movie_stream, #video_controls').mouseleave();
clearTimeout(timeout); clearTimeout(timeout);
} }
}, 1000); }, 1000);
@ -189,6 +206,7 @@ function initSliders () {
var slider1 = new Slider($('.Slider-thumbTrack-21hGV .Slider-thumb-2QGiU').get(0)); var slider1 = new Slider($('.Slider-thumbTrack-21hGV .Slider-thumb-2QGiU').get(0));
slider1.clickElementBefore = $('.SeekBar-seekBarTrack-3Gu5R').get(0); slider1.clickElementBefore = $('.SeekBar-seekBarTrack-3Gu5R').get(0);
slider1.init(); slider1.init();
var slider2 = new Slider($('.VolumeSlider-slider-1QXdT .Slider-thumb-2QGiU').get(0)); var slider2 = new Slider($('.VolumeSlider-slider-1QXdT .Slider-thumb-2QGiU').get(0));
slider2.clickElementBefore = $('.VolumeSlider-fill-3XkYy').get(0); slider2.clickElementBefore = $('.VolumeSlider-fill-3XkYy').get(0);
slider2.clickElementAfter = $('.VolumeSlider-track-2WJDz').get(0); slider2.clickElementAfter = $('.VolumeSlider-track-2WJDz').get(0);
@ -373,7 +391,4 @@ Slider.prototype.handleClick = function (event) {
this.valueNow = parseInt(((this.valueMax - this.valueMin) * diffX) / this.railWidth); this.valueNow = parseInt(((this.valueMax - this.valueMin) * diffX) / this.railWidth);
this.moveSliderTo(this.valueNow); this.moveSliderTo(this.valueNow);
/*event.preventDefault();
event.stopPropagation();*/
}; };

@ -13,8 +13,13 @@ function updateServers(servers) {
url: '/rest/browse/server.json', url: '/rest/browse/server.json',
data: {server_id: server.id} data: {server_id: server.id}
}).done(function (data) { }).done(function (data) {
updateLibraries(server); if(data.error === true)
ajax -= 1; show_alert('error', data.message);
else
{
updateLibraries(server);
ajax -= 1;
}
}); });
}, (index + 1) * 1000); }, (index + 1) * 1000);
}); });

Loading…
Cancel
Save