Skip to content

Commit 7f5cf76

Browse files
authored
Return None for history source if media no longer exists (#1269)
1 parent a9e2406 commit 7f5cf76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plexapi/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,10 @@ def _reload(self, **kwargs):
953953
raise NotImplementedError('History objects cannot be reloaded. Use source() to get the source media item.')
954954

955955
def source(self):
956-
""" Return the source media object for the history entry. """
957-
return self.fetchItem(self._details_key)
956+
""" Return the source media object for the history entry
957+
or None if the media no longer exists on the server.
958+
"""
959+
return self.fetchItem(self._details_key) if self._details_key else None
958960

959961
def delete(self):
960962
""" Delete the history entry. """

0 commit comments

Comments
 (0)