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

Commit 16e0714

Browse files
committed
Added single and multiple episode retrieval to the season class and fixed some comments in the show class.
1 parent 23e4920 commit 16e0714

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

Server/Library/Item/Season.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,35 @@ public function setAttributes($attribute)
5353
{
5454
parent::setAttributes($attribute);
5555
}
56+
57+
/**
58+
* Returns an array of all the episode objects for the intstantiated season.
59+
*
60+
* @uses Plex_Server_Library::getItems()
61+
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
62+
*
63+
* @return Plex_Server_Library_Item_Episode[] An array of Plex library
64+
* episodes objects.
65+
*/
66+
public function getEpisodes()
67+
{
68+
return $this->getItems(
69+
$this->buildChildrenEndpoint()
70+
);
71+
}
72+
73+
/**
74+
* Returns a single episode by index, key, or exact title match.
75+
*
76+
* @param integer|string $polymorphicData Either an index, a key, or a title
77+
* for an exact title match that will be used to retrieve a single episode.
78+
*
79+
* @uses Plex_Server_Library_ItemAbstract::getPolymorphicItem()
80+
*
81+
* @return Plex_Server_Library_Item_Episode A single episode.
82+
*/
83+
public function getEpisode($polymorphicData)
84+
{
85+
return $this->getPolymorphicItem($polymorphicData);
86+
}
5687
}

Server/Library/Item/Show.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public function setAttributes($attribute)
6060
* @uses Plex_Server_Library::getItems()
6161
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
6262
*
63-
* @return Plex_Server_Library_ItemSeason[] An array of Plex library season
63+
* @return Plex_Server_Library_Item_Season[] An array of Plex library season
6464
* objects.
65-
*/
65+
*/
6666
public function getSeasons()
6767
{
6868
return $this->getItems(

0 commit comments

Comments
 (0)