Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def fetchItems(self, ekey, cls=None, container_start=None, container_size=None,
@property
def totalSize(self):
""" Returns the total number of items in the library for the default library type. """
return self.totalViewSize(libtype=self.TYPE, includeCollections=False)
return self.totalViewSize(includeCollections=False)

def totalViewSize(self, libtype=None, includeCollections=True):
""" Returns the total number of items in the library for a specified libtype.
Expand All @@ -414,7 +414,10 @@ def totalViewSize(self, libtype=None, includeCollections=True):
'X-Plex-Container-Size': 0
}
if libtype is not None:
args['type'] = utils.searchType(libtype)
if libtype == 'photo':
args['clusterZoomLevel'] = 1
else:
args['type'] = utils.searchType(libtype)
part = '/library/sections/%s/all%s' % (self.key, utils.joinArgs(args))
data = self._server.query(part)
return utils.cast(int, data.attrib.get("totalSize"))
Expand Down