mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 12:58:26 +00:00
update exists function
with updated media.py use new media attributes.
This commit is contained in:
parent
8c78fbacd8
commit
8e7c5e9b67
1 changed files with 7 additions and 12 deletions
|
@ -91,19 +91,14 @@ class Video(PlexPartialObject):
|
|||
|
||||
def exists(self):
|
||||
"""" Returns exists, accessible, and file"""
|
||||
self.reload()
|
||||
exist_path = []
|
||||
data = self._server.query(self.key + self._include)
|
||||
for elem in data:
|
||||
for media in elem:
|
||||
for part in media:
|
||||
exists = utils.cast(bool, part.attrib.get('exists'))
|
||||
accessible = utils.cast(bool, part.attrib.get('accessible'))
|
||||
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))
|
||||
|
||||
for media in self.media:
|
||||
for part in media.parts:
|
||||
if part.exists is None and part.accessible is None and part.file is None:
|
||||
pass
|
||||
else:
|
||||
exist_path.append((part.exists, part.accessible, part.file))
|
||||
return exist_path
|
||||
|
||||
def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=False, title=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue