Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions mythtv/bindings/python/ttvdbv4/myth4ttvdbv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,26 +556,29 @@ def buildSingle(self):

gen_episodes = ttvdb.getSeriesEpisodes(inetref, season_type='default', season=season,
episodeNumber=episode, yielded=True)
ep = next(gen_episodes)
epi_x = ttvdb.getEpisodeExtended(ep.id)
for lang in self._select_preferred_langs(epi_x.nameTranslations):
translation = ttvdb.getEpisodeTranslation(epi_x.id, lang)
epi_x.fetched_translations.append(translation)
if self.debug:
print("%04d: buildSingle: Episode Information for %s : %s : %s"
% (self._get_ellapsed_time(), inetref, season, episode))
_print_class_content(epi_x)

# get season information:
sea_x = None
for s in epi_x.seasons:
if s.type.id == ser_x.defaultSeasonType:
sea_x = ttvdb.getSeasonExtended(s.id)
if self.debug:
print("%04d: buildSingle: Season Information for %s : %s"
% (self._get_ellapsed_time(), inetref, season))
_print_class_content(sea_x)
break
try:
ep = next(gen_episodes)
epi_x = ttvdb.getEpisodeExtended(ep.id)
for lang in self._select_preferred_langs(epi_x.nameTranslations):
translation = ttvdb.getEpisodeTranslation(epi_x.id, lang)
epi_x.fetched_translations.append(translation)
if self.debug:
print("%04d: buildSingle: Episode Information for %s : %s : %s"
% (self._get_ellapsed_time(), inetref, season, episode))
_print_class_content(epi_x)

# get season information:
sea_x = None
for s in epi_x.seasons:
if s.type.id == ser_x.defaultSeasonType:
sea_x = ttvdb.getSeasonExtended(s.id)
if self.debug:
print("%04d: buildSingle: Season Information for %s : %s"
% (self._get_ellapsed_time(), inetref, season))
_print_class_content(sea_x)
break
except StopIteration:
sys.exit("No matching episode found")

# no we have all extended records for series, season, episode, create xml for them
self._format_xml(ser_x, sea_x, epi_x)
Expand Down Expand Up @@ -605,6 +608,8 @@ def buildCollection(self, other_inetref=None, xml_output=True):

# get data for passed inetref and preferred translations
ser_x = ttvdb.getSeriesExtended(tvinetref)
if not ser_x:
sys.exit("No matching collection found")

ser_x.fetched_translations = []
for lang in self._select_preferred_langs(ser_x.nameTranslations):
Expand Down
5 changes: 2 additions & 3 deletions mythtv/bindings/python/ttvdbv4/ttvdbv4_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ def _query_yielded(record, path, params, listname=None):
for item in datalist:
yield record(item)
else:
raise StopIteration
return
else:
#break
raise StopIteration
return
curr_page += 1
params['page'] = curr_page

Expand Down
4 changes: 4 additions & 0 deletions mythtv/programs/scripts/metadata/Television/tvmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ def buildSingleItem(inetref, season, episode_id):

# get info for season episodes:
ep_info = tvmaze.get_episode_information(episode_id)
if not ep_info:
sys.exit("No matching episode found")
m = VideoMetadata()
if show_info.genres is not None and len(show_info.genres) > 0:
for g in show_info.genres:
Expand Down Expand Up @@ -534,6 +536,8 @@ def buildCollection(tvinetref, opts):
print("Function 'buildCollection' called with argument '%s'" % tvinetref)

show_info = tvmaze.get_show(tvinetref)
if not show_info:
sys.exit("No matching collection found")
if opts.debug:
for k, v in show_info.__dict__.items():
print(k, " : ", v)
Expand Down
Loading