Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

4 Shows

Jose Erick Carreon edited this page Apr 25, 2019 · 2 revisions

How access to the Shows and its information?

Access to multiple Shows

You can access to multiples moves of different forms since those that unwatched, by year, by content rating, etc; Of course, all this from the select section of type show.

// First get a section of type show.
$section = $server->getLibrary()->getSection('TV Shows');

// Get a shows from section.
$section->getAll();                    // Get all shows from section.
$section->getUnwatched();              // Get all shows from section.
$section->getRecentlyViewed();         // Get shows recently viewed.
$section->getByGenre(147);             // Get shows by genre key.
$section->getByYear(1983);             // Get shows released in 1983.
$section->getByCollection(1247);       // Get shows by collections
$section->getByFirstCharacter('Q');    // Get shows that start with the letter 'Q'.
$section->getByContentRating('TV-MA'); // Get shows by 'TV-MA' content rating.

// You can also get shows use the plex search engine.
$section->search('Breaking Bad');

Access to one Show

For get a show in specific there is 3 forms:

// First get a section of type show.
$section = $server->getLibrary()->getSection('Cartoons');

$section->get(46585); // Get show by key (id).
$section->get('The Simpsons'); // Get show by exact title.
$section->get('/library/metadata/46585'); // Get show by API URL.

Access to Show information

List all functions for access of the data of a show

// First get a show.
$show = $server->getLibrary()->getSection('TV Shows')->get('Breaking Bad');

$show->getRatingkey(); // Get key (id)
$show->getKey(); // Get url metadata with key
$show->getTitle();
$show->getTitleSort();
$show->getYear();
$show->getArt(); // Get backgroup image.
$show->getThumb();
$show->buildUrlThumb(); //Generate a url of thumb with token
$show->getRating(); // Get rating 0-10
$show->getSummary();
$show->getType();
$show->getContentRating();
$show->getIndex();
$show->getGenres();
$show->getRoles();
$show->getAddedat();
$show->getUpdatedat();
$show->getSeasonsCount();    // Get total of seasons
$show->getEpisodesCount();   // Get total of episodes

Access to Seasons from a section Show

This information is in Sections-Seasons

Access to recently Episodes form section of type show

// Lists of recently episodes
$section->getRecentlyAiredEpisodes();  // Get recently released episodes.
$section->getRecentlyAddedEpisodes();  // Get recently added episodes.
$section->getRecentlyViewedEpisodes(); // Get recently viewed episodes.
$section->getOnDeckEpisodes();         // Get episodes on deck.

Access to multiples or a specific Episode of all seasons from a section of type show

$section->getAllEpisodes();
$section->getEpisode(3412);
$section->getEpisode('The One with the Candy Hearts');
$section->getRandomEpisode();

$section->searchEpisodes('Candy Hearts')