mirror of
https://github.com/pkkid/python-plexapi
synced 2024-09-20 22:01:57 +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):
|
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):
|
||||||
|
|
Loading…
Reference in a new issue