mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Fix build_item() to deal with audio
This commit is contained in:
parent
0b9509da27
commit
3ca226e897
1 changed files with 5 additions and 5 deletions
|
@ -186,12 +186,12 @@ class Track(Audio):
|
|||
|
||||
|
||||
def build_item(server, elem, initpath):
|
||||
VIDEOCLS = {Movie.TYPE:Movie, Show.TYPE:Show, Season.TYPE:Season, Episode.TYPE:Episode}
|
||||
vtype = elem.attrib.get('type')
|
||||
if vtype in VIDEOCLS:
|
||||
cls = VIDEOCLS[vtype]
|
||||
AUDIOCLS = {Artist.TYPE:Artist, Album.TYPE:Album, Track.TYPE:Track}
|
||||
atype = elem.attrib.get('type')
|
||||
if atype in AUDIOCLS:
|
||||
cls = AUDIOCLS[atype]
|
||||
return cls(server, elem, initpath)
|
||||
raise UnknownType('Unknown video type: %s' % vtype)
|
||||
raise UnknownType('Unknown audio type: %s' % atype)
|
||||
|
||||
|
||||
def find_key(server, key):
|
||||
|
|
Loading…
Reference in a new issue