Skip to content

Commit 8e7c5e9

Browse files
authored
update exists function
with updated media.py use new media attributes.
1 parent 8c78fba commit 8e7c5e9

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

plexapi/video.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,14 @@ def _defaultSyncTitle(self):
9191

9292
def exists(self):
9393
"""" Returns exists, accessible, and file"""
94+
self.reload()
9495
exist_path = []
95-
data = self._server.query(self.key + self._include)
96-
for elem in data:
97-
for media in elem:
98-
for part in media:
99-
exists = utils.cast(bool, part.attrib.get('exists'))
100-
accessible = utils.cast(bool, part.attrib.get('accessible'))
101-
part_file = part.attrib.get('file')
102-
if exists is None and accessible is None and part_file is None:
103-
pass
104-
else:
105-
exist_path.append((exists, accessible, part_file))
106-
96+
for media in self.media:
97+
for part in media.parts:
98+
if part.exists is None and part.accessible is None and part.file is None:
99+
pass
100+
else:
101+
exist_path.append((part.exists, part.accessible, part.file))
107102
return exist_path
108103

109104
def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=False, title=None):

0 commit comments

Comments
 (0)