mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
Fix LibrarySection totalViewSize for photo libraries (#715)
This commit is contained in:
parent
2a810c63ae
commit
2e7ae1f3ec
1 changed files with 5 additions and 2 deletions
|
@ -394,7 +394,7 @@ class LibrarySection(PlexObject):
|
||||||
@property
|
@property
|
||||||
def totalSize(self):
|
def totalSize(self):
|
||||||
""" Returns the total number of items in the library for the default library type. """
|
""" 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):
|
def totalViewSize(self, libtype=None, includeCollections=True):
|
||||||
""" Returns the total number of items in the library for a specified libtype.
|
""" Returns the total number of items in the library for a specified libtype.
|
||||||
|
@ -414,7 +414,10 @@ class LibrarySection(PlexObject):
|
||||||
'X-Plex-Container-Size': 0
|
'X-Plex-Container-Size': 0
|
||||||
}
|
}
|
||||||
if libtype is not None:
|
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))
|
part = '/library/sections/%s/all%s' % (self.key, utils.joinArgs(args))
|
||||||
data = self._server.query(part)
|
data = self._server.query(part)
|
||||||
return utils.cast(int, data.attrib.get("totalSize"))
|
return utils.cast(int, data.attrib.get("totalSize"))
|
||||||
|
|
Loading…
Reference in a new issue