mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-26 13:40:22 +00:00
add unmatch, matches, and fixMatches methods for movies
matches will need additional work for manual matches
This commit is contained in:
parent
95114c4a35
commit
4c9aef21c7
1 changed files with 24 additions and 0 deletions
|
@ -260,6 +260,30 @@ class Movie(Playable, Video):
|
|||
# This is just for compat.
|
||||
return self.title
|
||||
|
||||
def unmatch(self):
|
||||
""" Unmatches movie object"""
|
||||
key = '/library/metadata/%s/unmatch' % self.ratingKey
|
||||
return self._server.query(key, method=self._server._session.put)
|
||||
|
||||
def matches(self):
|
||||
""" Return list of movie metadata matches from library agent"""
|
||||
results = []
|
||||
key = '/library/metadata/%s/matches' % self.ratingKey
|
||||
data = self._server.query(key, method=self._server._session.get)
|
||||
|
||||
for elem in data:
|
||||
results.append(media.SearchResult(data=elem, server=self._server))
|
||||
return results
|
||||
|
||||
def fixMatch(self, searchResult):
|
||||
""" Use match result to update movie metadata. """
|
||||
key = '/library/metadata/%s/match' % self.ratingKey
|
||||
params = {'guid': searchResult.guid,
|
||||
'name': searchResult.name}
|
||||
|
||||
data = key + '?' + urlencode(params)
|
||||
self._server.query(data, method=self._server._session.put)
|
||||
|
||||
def download(self, savepath=None, keep_original_name=False, **kwargs):
|
||||
""" Download video files to specified directory.
|
||||
|
||||
|
|
Loading…
Reference in a new issue