Skip to content

Commit

Permalink
Python Bindings: Allow searching for collections
Browse files Browse the repository at this point in the history
The ttvdb.py script does not return a valid xml when searching
for an ID without season or episode, like
'ttvdb.py -D 282022'.
Provide means to search for a collection, which is proven to work:
'ttvdb.py -C 282022'.

(cherry picked from commit 708b35d)
  • Loading branch information
rcrdnalor committed Oct 11, 2020
1 parent d285bdd commit 577dd50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mythtv/bindings/python/MythTV/system.py
Expand Up @@ -390,9 +390,10 @@ def sortedSearch(self, phrase, subtitle=None, tolerance=None):
return sorted(self.search(phrase, subtitle, tolerance), \
key=lambda r: r.levenshtein)

def grabInetref(self, inetref, season=None, episode=None):
def grabInetref(self, inetref, season=None, episode=None, search_collection=False):
"""
obj.grabInetref(inetref, season=None, episode=None) -> metadata object
obj.grabInetref(inetref, season=None, episode=None, search_collection=False)
-> metadata object
Returns a direct search for a specific movie or episode.
'inetref' can be an existing VideoMetadata object, and
Expand All @@ -411,7 +412,10 @@ def grabInetref(self, inetref, season=None, episode=None):
# inetref may expand to "my_grabber_script.xyz_1234" or "9876"
args = list(args)
args[0] = args[0].split("_")[-1]
return next(self.command('-D', *args))
if search_collection:
return next(self.command('-C', *args))
else:
return next(self.command('-D', *args))

class SystemEvent( System ):
"""
Expand Down

0 comments on commit 577dd50

Please sign in to comment.