fixMatch rework not so not-y

This commit is contained in:
blacktwin 2020-03-14 23:39:04 -04:00
parent 86c722f8bd
commit 07cf7d16e4

View file

@ -470,12 +470,11 @@ class PlexPartialObject(PlexObject):
def fixMatch(self, searchResult=None, auto=False): def fixMatch(self, searchResult=None, auto=False):
""" Use match result to update show metadata. """ """ Use match result to update show metadata. """
key = '/library/metadata/%s/match' % self.ratingKey key = '/library/metadata/%s/match' % self.ratingKey
if not auto: if auto:
if not searchResult:
raise NotFound('fixMatch() requires either auto=True or '
'searchResult=:class:`~plexapi.media.SearchResult.')
else:
searchResult = self.matches()[0] searchResult = self.matches()[0]
elif not searchResult:
raise NotFound('fixMatch() requires either auto=True or '
'searchResult=:class:`~plexapi.media.SearchResult`.')
params = {'guid': searchResult.guid, params = {'guid': searchResult.guid,
'name': searchResult.name} 'name': searchResult.name}