update exists function

with updated media.py use new media attributes.
This commit is contained in:
blacktwin 2019-09-30 21:03:49 -04:00 committed by GitHub
parent 8c78fbacd8
commit 8e7c5e9b67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,19 +91,14 @@ class Video(PlexPartialObject):
def exists(self): def exists(self):
"""" Returns exists, accessible, and file""" """" Returns exists, accessible, and file"""
self.reload()
exist_path = [] exist_path = []
data = self._server.query(self.key + self._include) for media in self.media:
for elem in data: for part in media.parts:
for media in elem: if part.exists is None and part.accessible is None and part.file is None:
for part in media: pass
exists = utils.cast(bool, part.attrib.get('exists')) else:
accessible = utils.cast(bool, part.attrib.get('accessible')) exist_path.append((part.exists, part.accessible, part.file))
part_file = part.attrib.get('file')
if exists is None and accessible is None and part_file is None:
pass
else:
exist_path.append((exists, accessible, part_file))
return exist_path return exist_path
def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=False, title=None): def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=False, title=None):