mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 22:24:12 +00:00
update fixMatch to allow for auto fixmatch
auto will select the first searchResult from matches
This commit is contained in:
parent
38b0fee6c9
commit
dc5d147315
1 changed files with 8 additions and 1 deletions
|
@ -457,9 +457,16 @@ class PlexPartialObject(PlexObject):
|
|||
data = self._server.query(key, method=self._server._session.get)
|
||||
return self.findItems(data)
|
||||
|
||||
def fixMatch(self, searchResult):
|
||||
def fixMatch(self, searchResult=None, auto=False):
|
||||
""" Use match result to update show metadata. """
|
||||
key = '/library/metadata/%s/match' % self.ratingKey
|
||||
if not auto:
|
||||
if not searchResult:
|
||||
raise NotFound('fixMatch() requires either auto=True or '
|
||||
'searchResult=:class:`~plexapi.media.SearchResult.')
|
||||
else:
|
||||
searchResult = self.matches()[0]
|
||||
|
||||
params = {'guid': searchResult.guid,
|
||||
'name': searchResult.name}
|
||||
|
||||
|
|
Loading…
Reference in a new issue