Skip to content

Commit

Permalink
Return None for history source if media no longer exists (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Nov 3, 2023
1 parent a9e2406 commit 7f5cf76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,10 @@ def _reload(self, **kwargs):
raise NotImplementedError('History objects cannot be reloaded. Use source() to get the source media item.')

def source(self):
""" Return the source media object for the history entry. """
return self.fetchItem(self._details_key)
""" Return the source media object for the history entry
or None if the media no longer exists on the server.
"""
return self.fetchItem(self._details_key) if self._details_key else None

def delete(self):
""" Delete the history entry. """
Expand Down

0 comments on commit 7f5cf76

Please sign in to comment.