mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Return None for history source if media no longer exists (#1269)
This commit is contained in:
parent
a9e2406e25
commit
7f5cf76cbd
1 changed files with 4 additions and 2 deletions
|
@ -953,8 +953,10 @@ class PlexHistory(object):
|
|||
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. """
|
||||
|
|
Loading…
Reference in a new issue