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

Commit b7153e1

Browse files
committed
Added single and multiple album retrieval to the atist item object.
1 parent 16e0714 commit b7153e1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Server/Library/Item/Artist.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 albumn objects for the intstantiated artist.
59+
*
60+
* @uses Plex_Server_Library::getItems()
61+
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
62+
*
63+
* @return Plex_Server_Library_Item_Album[] An array of Plex library album
64+
* objects.
65+
*/
66+
public function getAlbums()
67+
{
68+
return $this->getItems(
69+
$this->buildChildrenEndpoint()
70+
);
71+
}
72+
73+
/**
74+
* Returns a single album 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 album.
78+
*
79+
* @uses Plex_Server_Library_ItemAbstract::getPolymorphicItem()
80+
*
81+
* @return Plex_Server_Library_Item_Album A single album.
82+
*/
83+
public function getAlbum($polymorphicData)
84+
{
85+
return $this->getPolymorphicItem($polymorphicData);
86+
}
5687
}

0 commit comments

Comments
 (0)