Skip to content

Commit 07cf7d1

Browse files
committed
fixMatch rework not so not-y
1 parent 86c722f commit 07cf7d1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plexapi/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,12 +470,11 @@ def matches(self, auto=False, agent=None, title=None, year=None, language=None):
470470
def fixMatch(self, searchResult=None, auto=False):
471471
""" Use match result to update show metadata. """
472472
key = '/library/metadata/%s/match' % self.ratingKey
473-
if not auto:
474-
if not searchResult:
475-
raise NotFound('fixMatch() requires either auto=True or '
476-
'searchResult=:class:`~plexapi.media.SearchResult.')
477-
else:
473+
if auto:
478474
searchResult = self.matches()[0]
475+
elif not searchResult:
476+
raise NotFound('fixMatch() requires either auto=True or '
477+
'searchResult=:class:`~plexapi.media.SearchResult`.')
479478

480479
params = {'guid': searchResult.guid,
481480
'name': searchResult.name}

0 commit comments

Comments
 (0)