Override libtype for PhotoSection.all()

This commit is contained in:
JonnyWong16 2020-12-26 20:53:55 -08:00
parent ce51fc70e9
commit d5c29cc626
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -441,10 +441,7 @@ class LibrarySection(PlexObject):
""" Returns a list of all items from this library section.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting.
"""
if isinstance(self, PhotoSection):
libtype = 'photoalbum'
elif libtype is None:
libtype = self.TYPE
libtype = libtype or self.TYPE
return self.search(libtype=libtype, **kwargs)
def folders(self):
@ -1053,6 +1050,13 @@ class PhotoSection(LibrarySection):
CONTENT_TYPE = 'photo'
METADATA_TYPE = 'photo'
def all(self, libtype=None, **kwargs):
""" Returns a list of all items from this library section.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting.
"""
libtype = libtype or 'photoalbum'
return self.search(libtype=libtype, **kwargs)
def collections(self, **kwargs):
raise NotImplementedError('Collections are not available for a Photo library.')