Skip to content

Commit c2c13fb

Browse files
committed
removing unmatch/match methods from video:Movie and video:Show classes
matching can be done for artists, albums, shows, movies
1 parent 1f74368 commit c2c13fb

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

plexapi/video.py

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -260,49 +260,6 @@ def _prettyfilename(self):
260260
# This is just for compat.
261261
return self.title
262262

263-
def unmatch(self):
264-
""" Unmatches movie object. """
265-
key = '/library/metadata/%s/unmatch' % self.ratingKey
266-
return self._server.query(key, method=self._server._session.put)
267-
268-
def matches(self, auto=True, agent=None, title=None, year=None, lang=None):
269-
""" Return list of movie metadata matches from library agent. """
270-
key = '/library/metadata/%s/matches' % self.ratingKey
271-
if not auto:
272-
key += '?manual=%s' % 1
273-
if title:
274-
key += '&title=%s' % quote(title)
275-
if agent:
276-
agents = {ag.shortIdentifier: ag for ag in self._server.agents()}
277-
if agents.get(agent):
278-
agent = agents.get(agent)
279-
key += '&agent=%s' % agent.identifier
280-
else:
281-
raise NotFound('Couldnt find "%s" in agents list (%s)' %
282-
(agent, ','.join(agents.keys())))
283-
else:
284-
sectionAgent = self.section().agent
285-
key += '&agent=%s' % sectionAgent
286-
if year:
287-
key += '&year=%s' % year
288-
if lang:
289-
key += '&language=%s' % lang
290-
else:
291-
sectionLang = self.section().language
292-
key += '&language=%s' % sectionLang
293-
294-
data = self._server.query(key, method=self._server._session.get)
295-
return self.findItems(data)
296-
297-
def fixMatch(self, searchResult):
298-
""" Use match result to update movie metadata. """
299-
key = '/library/metadata/%s/match' % self.ratingKey
300-
params = {'guid': searchResult.guid,
301-
'name': searchResult.name}
302-
303-
data = key + '?' + urlencode(params)
304-
self._server.query(data, method=self._server._session.put)
305-
306263
def download(self, savepath=None, keep_original_name=False, **kwargs):
307264
""" Download video files to specified directory.
308265
@@ -453,49 +410,6 @@ def unwatched(self):
453410
""" Returns list of unwatched :class:`~plexapi.video.Episode` objects. """
454411
return self.episodes(viewCount=0)
455412

456-
def unmatch(self):
457-
""" Unmatches show object. """
458-
key = '/library/metadata/%s/unmatch' % self.ratingKey
459-
self._server.query(key, method=self._server._session.put)
460-
461-
def matches(self, auto=True, agent=None, title=None, year=None, lang=None):
462-
""" Return list of show metadata matches from library agent. """
463-
key = '/library/metadata/%s/matches' % self.ratingKey
464-
if not auto:
465-
key += '?manual=%s' % 1
466-
if title:
467-
key += '&title=%s' % quote(title)
468-
if agent:
469-
agents = {ag.shortIdentifier: ag for ag in self._server.agents()}
470-
if agents.get(agent):
471-
agent = agents.get(agent)
472-
key += '&agent=%s' % agent.identifier
473-
else:
474-
raise NotFound('Couldnt find "%s" in agents list (%s)' %
475-
(agent, ','.join(agents.keys())))
476-
else:
477-
sectionAgent = self.section().agent
478-
key += '&agent=%s' % sectionAgent
479-
if year:
480-
key += '&year=%s' % year
481-
if lang:
482-
key += '&language=%s' % lang
483-
else:
484-
sectionLang = self.section().language
485-
key += '&language=%s' % sectionLang
486-
487-
data = self._server.query(key, method=self._server._session.get)
488-
return self.findItems(data)
489-
490-
def fixMatch(self, searchResult):
491-
""" Use match result to update show metadata. """
492-
key = '/library/metadata/%s/match' % self.ratingKey
493-
params = {'guid': searchResult.guid,
494-
'name': searchResult.name}
495-
496-
data = key + '?' + urlencode(params)
497-
self._server.query(data, method=self._server._session.put)
498-
499413
def get(self, title=None, season=None, episode=None):
500414
""" Alias to :func:`~plexapi.video.Show.episode()`. """
501415
return self.episode(title, season, episode)

0 commit comments

Comments
 (0)