From d5c29cc62684adcca814b138b1e0bcce2542f22b Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 26 Dec 2020 20:53:55 -0800 Subject: [PATCH] Override libtype for PhotoSection.all() --- plexapi/library.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plexapi/library.py b/plexapi/library.py index b3d04fd7..56b822f0 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -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.')