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

Commit 6a6f2b5

Browse files
committed
Updated the library class to work with the new tiered sections.
1 parent 7fa6126 commit 6a6f2b5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Server/Library.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function buildUrl($endpoint)
107107
*
108108
* @uses Plex_MachineAbstract::makeCall()
109109
* @uses Plex_Server_Library::buildUrl()
110-
* @uses Plex_Server_Library_Item::factory()
110+
* @uses Plex_Server_Library_ItemAbstract::factory()
111111
* @uses Plex_Server_Library_ItemInterface::setAttributes()
112112
*
113113
* return Plex_Server_Library_Item[] An array of plex library items.
@@ -118,11 +118,12 @@ protected function getItems($endpoint)
118118
$itemArray = $this->makeCall($this->buildUrl($endpoint));
119119

120120
foreach ($itemArray as $attribute) {
121-
$item = Plex_Server_Library_Item::factory($attribute['type']);
121+
$item = Plex_Server_Library_ItemAbstract::factory(
122+
$attribute['type']
123+
);
122124
$item->setAttributes($attribute);
123125
$items[] = $item;
124126
}
125-
126127
return $items;
127128
}
128129

@@ -133,12 +134,11 @@ protected function getItems($endpoint)
133134
* @uses Plex_MachineAbstract::$name
134135
* @uses Plex_MachineAbstract::$address
135136
* @uses Plex_MachineAbstract::$port
136-
* @uses Plex_MachineAbstract::getBaseUrl()
137137
* @uses Plex_MachineAbstract::makeCall()
138-
* @uses Plex_MachineAbstract::xmlAttributesToArray()
139-
* @uses Plex_Server_Library::ENDPOINT_LIBRARY
140138
* @uses Plex_Server_Library::ENDPOINT_SECTION
141-
* @uses Plex_Server_Library_Section::setAttributes()
139+
* @uses Plex_Server_Library::buildUrl()
140+
* @uses Plex_Server_Library_SectionAbstract::factory()
141+
* @uses Plex_Server_Library_SectionAbstract::setAttributes()
142142
*
143143
* @return Plex_Server_Library_Section[] An array of user defined Plex
144144
* library sections.
@@ -151,7 +151,8 @@ public function getSections()
151151
);
152152

153153
foreach ($sectionArray as $attribute) {
154-
$section = new Plex_Server_Library_Section(
154+
$section = Plex_Server_Library_SectionAbstract::factory(
155+
$attribute['type'],
155156
$this->name,
156157
$this->address,
157158
$this->port

0 commit comments

Comments
 (0)