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

Commit

Permalink
Updated the library class to work with the new tiered sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbart committed Dec 17, 2012
1 parent 7fa6126 commit 6a6f2b5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Server/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function buildUrl($endpoint)
*
* @uses Plex_MachineAbstract::makeCall()
* @uses Plex_Server_Library::buildUrl()
* @uses Plex_Server_Library_Item::factory()
* @uses Plex_Server_Library_ItemAbstract::factory()
* @uses Plex_Server_Library_ItemInterface::setAttributes()
*
* return Plex_Server_Library_Item[] An array of plex library items.
Expand All @@ -118,11 +118,12 @@ protected function getItems($endpoint)
$itemArray = $this->makeCall($this->buildUrl($endpoint));

foreach ($itemArray as $attribute) {
$item = Plex_Server_Library_Item::factory($attribute['type']);
$item = Plex_Server_Library_ItemAbstract::factory(
$attribute['type']
);
$item->setAttributes($attribute);
$items[] = $item;
}

return $items;
}

Expand All @@ -133,12 +134,11 @@ protected function getItems($endpoint)
* @uses Plex_MachineAbstract::$name
* @uses Plex_MachineAbstract::$address
* @uses Plex_MachineAbstract::$port
* @uses Plex_MachineAbstract::getBaseUrl()
* @uses Plex_MachineAbstract::makeCall()
* @uses Plex_MachineAbstract::xmlAttributesToArray()
* @uses Plex_Server_Library::ENDPOINT_LIBRARY
* @uses Plex_Server_Library::ENDPOINT_SECTION
* @uses Plex_Server_Library_Section::setAttributes()
* @uses Plex_Server_Library::buildUrl()
* @uses Plex_Server_Library_SectionAbstract::factory()
* @uses Plex_Server_Library_SectionAbstract::setAttributes()
*
* @return Plex_Server_Library_Section[] An array of user defined Plex
* library sections.
Expand All @@ -151,7 +151,8 @@ public function getSections()
);

foreach ($sectionArray as $attribute) {
$section = new Plex_Server_Library_Section(
$section = Plex_Server_Library_SectionAbstract::factory(
$attribute['type'],
$this->name,
$this->address,
$this->port
Expand Down

0 comments on commit 6a6f2b5

Please sign in to comment.