|
@ -18,7 +18,7 @@ from tornado._locale_data import LOCALE_NAMES |
|
|
|
|
|
|
|
|
from _23 import filter_iter |
|
|
from _23 import filter_iter |
|
|
from six import integer_types, iteritems, string_types |
|
|
from six import integer_types, iteritems, string_types |
|
|
from sg_helpers import get_url, try_int |
|
|
from sg_helpers import clean_data, get_url, try_int |
|
|
from lib.dateutil.parser import parser |
|
|
from lib.dateutil.parser import parser |
|
|
# noinspection PyProtectedMember |
|
|
# noinspection PyProtectedMember |
|
|
from lib.dateutil.tz.tz import _datetime_to_timestamp |
|
|
from lib.dateutil.tz.tz import _datetime_to_timestamp |
|
@ -144,22 +144,26 @@ class TvMaze(TVInfoBase): |
|
|
|
|
|
|
|
|
def _search_show(self, name=None, ids=None, **kwargs): |
|
|
def _search_show(self, name=None, ids=None, **kwargs): |
|
|
def _make_result_dict(s): |
|
|
def _make_result_dict(s): |
|
|
language = s.language.lower() |
|
|
language = clean_data(s.language.lower()) |
|
|
language_country_code = None |
|
|
language_country_code = None |
|
|
for cur_locale in iteritems(LOCALE_NAMES): |
|
|
for cur_locale in iteritems(LOCALE_NAMES): |
|
|
if language in cur_locale[1]['name_en'].lower(): |
|
|
if language in cur_locale[1]['name_en'].lower(): |
|
|
language_country_code = cur_locale[0].split('_')[1].lower() |
|
|
language_country_code = cur_locale[0].split('_')[1].lower() |
|
|
break |
|
|
break |
|
|
return {'seriesname': s.name, 'id': s.id, 'firstaired': s.premiered, |
|
|
return {'seriesname': clean_data(s.name), 'id': s.id, 'firstaired': clean_data(s.premiered), |
|
|
'network': (s.network and s.network.name) or (s.web_channel and s.web_channel.name), |
|
|
'network': clean_data((s.network and s.network.name) or (s.web_channel and s.web_channel.name)), |
|
|
'genres': isinstance(s.genres, list) and ', '.join(g.lower() for g in s.genres) or s.genres, |
|
|
'genres': clean_data(isinstance(s.genres, list) and ', '.join(g.lower() for g in s.genres) or |
|
|
'overview': s.summary, 'language': s.language, 'language_country_code': language_country_code, |
|
|
s.genres), |
|
|
|
|
|
'overview': clean_data(s.summary), 'language': clean_data(s.language), |
|
|
|
|
|
'language_country_code': clean_data(language_country_code), |
|
|
'runtime': s.average_runtime or s.runtime, |
|
|
'runtime': s.average_runtime or s.runtime, |
|
|
'type': s.type, 'schedule': s.schedule, 'status': s.status, 'official_site': s.official_site, |
|
|
'type': clean_data(s.type), 'schedule': s.schedule, 'status': clean_data(s.status), |
|
|
'aliases': [a.name for a in s.akas], 'image': s.image and s.image.get('original'), |
|
|
'official_site': clean_data(s.official_site), |
|
|
|
|
|
'aliases': [clean_data(a.name) for a in s.akas], 'image': s.image and s.image.get('original'), |
|
|
'ids': TVInfoIDs( |
|
|
'ids': TVInfoIDs( |
|
|
tvdb=s.externals.get('thetvdb'), rage=s.externals.get('tvrage'), tvmaze=s.id, |
|
|
tvdb=s.externals.get('thetvdb'), rage=s.externals.get('tvrage'), tvmaze=s.id, |
|
|
imdb=s.externals.get('imdb') and try_int(s.externals.get('imdb').replace('tt', ''), None))} |
|
|
imdb=clean_data(s.externals.get('imdb') and try_int(s.externals.get('imdb').replace('tt', ''), |
|
|
|
|
|
None)))} |
|
|
results = [] |
|
|
results = [] |
|
|
if ids: |
|
|
if ids: |
|
|
for t, p in iteritems(ids): |
|
|
for t, p in iteritems(ids): |
|
@ -229,7 +233,7 @@ class TvMaze(TVInfoBase): |
|
|
self._set_item(sid, ep_obj.season_number, ep_obj.episode_number, _k, image) |
|
|
self._set_item(sid, ep_obj.season_number, ep_obj.episode_number, _k, image) |
|
|
else: |
|
|
else: |
|
|
self._set_item(sid, ep_obj.season_number, ep_obj.episode_number, _k, |
|
|
self._set_item(sid, ep_obj.season_number, ep_obj.episode_number, _k, |
|
|
getattr(ep_obj, _s, getattr(empty_ep, _k))) |
|
|
clean_data(getattr(ep_obj, _s, getattr(empty_ep, _k)))) |
|
|
|
|
|
|
|
|
if ep_obj.airstamp: |
|
|
if ep_obj.airstamp: |
|
|
try: |
|
|
try: |
|
@ -240,11 +244,11 @@ class TvMaze(TVInfoBase): |
|
|
|
|
|
|
|
|
@staticmethod |
|
|
@staticmethod |
|
|
def _set_network(show_obj, network, is_stream): |
|
|
def _set_network(show_obj, network, is_stream): |
|
|
show_obj['network'] = network.name |
|
|
show_obj['network'] = clean_data(network.name) |
|
|
show_obj['network_timezone'] = network.timezone |
|
|
show_obj['network_timezone'] = clean_data(network.timezone) |
|
|
show_obj['network_country'] = network.country |
|
|
show_obj['network_country'] = clean_data(network.country) |
|
|
show_obj['network_country_code'] = network.code |
|
|
show_obj['network_country_code'] = clean_data(network.code) |
|
|
show_obj['network_id'] = network.maze_id |
|
|
show_obj['network_id'] = clean_data(network.maze_id) |
|
|
show_obj['network_is_stream'] = is_stream |
|
|
show_obj['network_is_stream'] = is_stream |
|
|
|
|
|
|
|
|
def _get_tvm_show(self, show_id, get_ep_info): |
|
|
def _get_tvm_show(self, show_id, get_ep_info): |
|
@ -266,8 +270,9 @@ class TvMaze(TVInfoBase): |
|
|
|
|
|
|
|
|
show_obj = self.shows[sid].__dict__ |
|
|
show_obj = self.shows[sid].__dict__ |
|
|
for k, v in iteritems(show_obj): |
|
|
for k, v in iteritems(show_obj): |
|
|
if k not in ('cast', 'crew', 'images'): |
|
|
if k not in ('cast', 'crew', 'images', 'aliases'): |
|
|
show_obj[k] = getattr(show_data, show_map.get(k, k), show_obj[k]) |
|
|
show_obj[k] = getattr(show_data, show_map.get(k, k), clean_data(show_obj[k])) |
|
|
|
|
|
show_obj['aliases'] = [clean_data(a.name) for a in show_data.akas] |
|
|
show_obj['runtime'] = show_data.average_runtime or show_data.runtime |
|
|
show_obj['runtime'] = show_data.average_runtime or show_data.runtime |
|
|
p_set = False |
|
|
p_set = False |
|
|
if show_data.image: |
|
|
if show_data.image: |
|
@ -356,21 +361,21 @@ class TvMaze(TVInfoBase): |
|
|
existing_person.birthdate, existing_person.deathdate, existing_person.country, |
|
|
existing_person.birthdate, existing_person.deathdate, existing_person.country, |
|
|
existing_person.country_code, existing_person.country_timezone, existing_person.thumb_url, |
|
|
existing_person.country_code, existing_person.country_timezone, existing_person.thumb_url, |
|
|
existing_person.url, existing_person.ids) = \ |
|
|
existing_person.url, existing_person.ids) = \ |
|
|
(ch.person.id, ch.person.name, |
|
|
(ch.person.id, clean_data(ch.person.name), |
|
|
ch.person.image and ch.person.image.get('original'), |
|
|
ch.person.image and ch.person.image.get('original'), |
|
|
PersonGenders.named.get( |
|
|
PersonGenders.named.get( |
|
|
ch.person.gender and ch.person.gender.lower(), PersonGenders.unknown), |
|
|
ch.person.gender and ch.person.gender.lower(), PersonGenders.unknown), |
|
|
person.birthdate, person.deathdate, |
|
|
person.birthdate, person.deathdate, |
|
|
ch.person.country and ch.person.country.get('name'), |
|
|
ch.person.country and clean_data(ch.person.country.get('name')), |
|
|
ch.person.country and ch.person.country.get('code'), |
|
|
ch.person.country and clean_data(ch.person.country.get('code')), |
|
|
ch.person.country and ch.person.country.get('timezone'), |
|
|
ch.person.country and clean_data(ch.person.country.get('timezone')), |
|
|
ch.person.image and ch.person.image.get('medium'), |
|
|
ch.person.image and ch.person.image.get('medium'), |
|
|
ch.person.url, {TVINFO_TVMAZE: ch.person.id}) |
|
|
ch.person.url, {TVINFO_TVMAZE: ch.person.id}) |
|
|
else: |
|
|
else: |
|
|
existing_character.person.append(person) |
|
|
existing_character.person.append(person) |
|
|
else: |
|
|
else: |
|
|
show_obj['cast'][RoleTypes.ActorMain].append( |
|
|
show_obj['cast'][RoleTypes.ActorMain].append( |
|
|
Character(p_id=ch.id, name=ch.name, image=ch.image and ch.image.get('original'), |
|
|
Character(p_id=ch.id, name=clean_data(ch.name), image=ch.image and ch.image.get('original'), |
|
|
person=[person], |
|
|
person=[person], |
|
|
plays_self=ch.plays_self, thumb_url=ch.image and ch.image.get('medium') |
|
|
plays_self=ch.plays_self, thumb_url=ch.image and ch.image.get('medium') |
|
|
)) |
|
|
)) |
|
@ -386,18 +391,19 @@ class TvMaze(TVInfoBase): |
|
|
if show_data.cast: |
|
|
if show_data.cast: |
|
|
show_obj['actors'] = [ |
|
|
show_obj['actors'] = [ |
|
|
{'character': {'id': ch.id, |
|
|
{'character': {'id': ch.id, |
|
|
'name': ch.name, |
|
|
'name': clean_data(ch.name), |
|
|
'url': 'https://www.tvmaze.com/character/view?id=%s' % ch.id, |
|
|
'url': 'https://www.tvmaze.com/character/view?id=%s' % ch.id, |
|
|
'image': ch.image and ch.image.get('original'), |
|
|
'image': ch.image and ch.image.get('original'), |
|
|
}, |
|
|
}, |
|
|
'person': {'id': ch.person and ch.person.id, |
|
|
'person': {'id': ch.person and ch.person.id, |
|
|
'name': ch.person and ch.person.name, |
|
|
'name': ch.person and clean_data(ch.person.name), |
|
|
'url': ch.person and 'https://www.tvmaze.com/person/view?id=%s' % ch.person.id, |
|
|
'url': ch.person and 'https://www.tvmaze.com/person/view?id=%s' % ch.person.id, |
|
|
'image': ch.person and ch.person.image and ch.person.image.get('original'), |
|
|
'image': ch.person and ch.person.image and ch.person.image.get('original'), |
|
|
'birthday': None, # not sure about format |
|
|
'birthday': None, # not sure about format |
|
|
'deathday': None, # not sure about format |
|
|
'deathday': None, # not sure about format |
|
|
'gender': ch.person and ch.person.gender and ch.person.gender, |
|
|
'gender': ch.person and ch.person.gender and ch.person.gender, |
|
|
'country': ch.person and ch.person.country and ch.person.country.get('name'), |
|
|
'country': ch.person and ch.person.country and |
|
|
|
|
|
clean_data(ch.person.country.get('name')), |
|
|
}, |
|
|
}, |
|
|
} for ch in show_data.cast.characters] |
|
|
} for ch in show_data.cast.characters] |
|
|
|
|
|
|
|
@ -405,12 +411,12 @@ class TvMaze(TVInfoBase): |
|
|
for cw in show_data.crew: |
|
|
for cw in show_data.crew: |
|
|
rt = crew_type_names.get(cw.type.lower(), RoleTypes.CrewOther) |
|
|
rt = crew_type_names.get(cw.type.lower(), RoleTypes.CrewOther) |
|
|
show_obj['crew'][rt].append( |
|
|
show_obj['crew'][rt].append( |
|
|
Crew(p_id=cw.person.id, name=cw.person.name, |
|
|
Crew(p_id=cw.person.id, name=clean_data(cw.person.name), |
|
|
image=cw.person.image and cw.person.image.get('original'), |
|
|
image=cw.person.image and cw.person.image.get('original'), |
|
|
gender=cw.person.gender, birthdate=cw.person.birthday, deathdate=cw.person.death_day, |
|
|
gender=cw.person.gender, birthdate=cw.person.birthday, deathdate=cw.person.death_day, |
|
|
country=cw.person.country and cw.person.country.get('name'), |
|
|
country=cw.person.country and clean_data(cw.person.country.get('name')), |
|
|
country_code=cw.person.country and cw.person.country.get('code'), |
|
|
country_code=cw.person.country and clean_data(cw.person.country.get('code')), |
|
|
country_timezone=cw.person.country and cw.person.country.get('timezone'), |
|
|
country_timezone=cw.person.country and clean_data(cw.person.country.get('timezone')), |
|
|
crew_type_name=cw.type, |
|
|
crew_type_name=cw.type, |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
@ -418,8 +424,8 @@ class TvMaze(TVInfoBase): |
|
|
if show_data.externals: |
|
|
if show_data.externals: |
|
|
show_obj['ids'] = TVInfoIDs(tvdb=show_data.externals.get('thetvdb'), |
|
|
show_obj['ids'] = TVInfoIDs(tvdb=show_data.externals.get('thetvdb'), |
|
|
rage=show_data.externals.get('tvrage'), |
|
|
rage=show_data.externals.get('tvrage'), |
|
|
imdb=show_data.externals.get('imdb') and |
|
|
imdb=clean_data(show_data.externals.get('imdb') and |
|
|
try_int(show_data.externals.get('imdb').replace('tt', ''), None)) |
|
|
try_int(show_data.externals.get('imdb').replace('tt', ''), None))) |
|
|
|
|
|
|
|
|
if show_data.network: |
|
|
if show_data.network: |
|
|
self._set_network(show_obj, show_data.network, False) |
|
|
self._set_network(show_obj, show_data.network, False) |
|
@ -457,7 +463,7 @@ class TvMaze(TVInfoBase): |
|
|
log.error('error episodes have no numbers') |
|
|
log.error('error episodes have no numbers') |
|
|
season_obj = season_obj or self.shows[sid][cur_s_v.season_number].__dict__ |
|
|
season_obj = season_obj or self.shows[sid][cur_s_v.season_number].__dict__ |
|
|
for k, v in iteritems(season_map): |
|
|
for k, v in iteritems(season_map): |
|
|
season_obj[k] = getattr(cur_s_v, v, None) or empty_se.get(v) |
|
|
season_obj[k] = clean_data(getattr(cur_s_v, v, None)) or empty_se.get(v) |
|
|
if cur_s_v.network: |
|
|
if cur_s_v.network: |
|
|
self._set_network(season_obj, cur_s_v.network, False) |
|
|
self._set_network(season_obj, cur_s_v.network, False) |
|
|
elif cur_s_v.web_channel: |
|
|
elif cur_s_v.web_channel: |
|
@ -480,20 +486,20 @@ class TvMaze(TVInfoBase): |
|
|
ch = [] |
|
|
ch = [] |
|
|
for c in person_obj.castcredits or []: |
|
|
for c in person_obj.castcredits or []: |
|
|
show = TVInfoShow() |
|
|
show = TVInfoShow() |
|
|
show.seriesname = c.show.name |
|
|
show.seriesname = clean_data(c.show.name) |
|
|
show.id = c.show.id |
|
|
show.id = c.show.id |
|
|
show.firstaired = c.show.premiered |
|
|
show.firstaired = clean_data(c.show.premiered) |
|
|
show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: show.id}) |
|
|
show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: show.id}) |
|
|
show.overview = c.show.summary |
|
|
show.overview = clean_data(c.show.summary) |
|
|
show.status = c.show.status |
|
|
show.status = clean_data(c.show.status) |
|
|
net = c.show.network or c.show.web_channel |
|
|
net = c.show.network or c.show.web_channel |
|
|
show.network = net.name |
|
|
show.network = clean_data(net.name) |
|
|
show.network_id = net.maze_id |
|
|
show.network_id = net.maze_id |
|
|
show.network_country = net.country |
|
|
show.network_country = clean_data(net.country) |
|
|
show.network_timezone = net.timezone |
|
|
show.network_timezone = clean_data(net.timezone) |
|
|
show.network_country_code = net.code |
|
|
show.network_country_code = clean_data(net.code) |
|
|
show.network_is_stream = None is not c.show.web_channel |
|
|
show.network_is_stream = None is not c.show.web_channel |
|
|
ch.append(Character(name=c.character.name, show=show)) |
|
|
ch.append(Character(name=clean_data(c.character.name), show=show)) |
|
|
try: |
|
|
try: |
|
|
birthdate = person_obj.birthday and tz_p.parse(person_obj.birthday).date() |
|
|
birthdate = person_obj.birthday and tz_p.parse(person_obj.birthday).date() |
|
|
except (BaseException, Exception): |
|
|
except (BaseException, Exception): |
|
@ -502,14 +508,14 @@ class TvMaze(TVInfoBase): |
|
|
deathdate = person_obj.death_day and tz_p.parse(person_obj.death_day).date() |
|
|
deathdate = person_obj.death_day and tz_p.parse(person_obj.death_day).date() |
|
|
except (BaseException, Exception): |
|
|
except (BaseException, Exception): |
|
|
deathdate = None |
|
|
deathdate = None |
|
|
return Person(p_id=person_obj.id, name=person_obj.name, |
|
|
return Person(p_id=person_obj.id, name=clean_data(person_obj.name), |
|
|
image=person_obj.image and person_obj.image.get('original'), |
|
|
image=person_obj.image and person_obj.image.get('original'), |
|
|
gender=PersonGenders.named.get(person_obj.gender and person_obj.gender.lower(), |
|
|
gender=PersonGenders.named.get(person_obj.gender and person_obj.gender.lower(), |
|
|
PersonGenders.unknown), |
|
|
PersonGenders.unknown), |
|
|
birthdate=birthdate, deathdate=deathdate, |
|
|
birthdate=birthdate, deathdate=deathdate, |
|
|
country=person_obj.country and person_obj.country.get('name'), |
|
|
country=person_obj.country and clean_data(person_obj.country.get('name')), |
|
|
country_code=person_obj.country and person_obj.country.get('code'), |
|
|
country_code=person_obj.country and clean_data(person_obj.country.get('code')), |
|
|
country_timezone=person_obj.country and person_obj.country.get('timezone'), |
|
|
country_timezone=person_obj.country and clean_data(person_obj.country.get('timezone')), |
|
|
thumb_url=person_obj.image and person_obj.image.get('medium'), |
|
|
thumb_url=person_obj.image and person_obj.image.get('medium'), |
|
|
url=person_obj.url, ids={TVINFO_TVMAZE: person_obj.id}, characters=ch |
|
|
url=person_obj.url, ids={TVINFO_TVMAZE: person_obj.id}, characters=ch |
|
|
) |
|
|
) |
|
@ -574,35 +580,35 @@ class TvMaze(TVInfoBase): |
|
|
make out of TVMazeEpisode object and optionally TVMazeShow a TVInfoEpisode |
|
|
make out of TVMazeEpisode object and optionally TVMazeShow a TVInfoEpisode |
|
|
""" |
|
|
""" |
|
|
ti_show = TVInfoShow() |
|
|
ti_show = TVInfoShow() |
|
|
ti_show.seriesname = show_data.name |
|
|
ti_show.seriesname = clean_data(show_data.name) |
|
|
ti_show.id = show_data.maze_id |
|
|
ti_show.id = show_data.maze_id |
|
|
ti_show.seriesid = ti_show.id |
|
|
ti_show.seriesid = ti_show.id |
|
|
ti_show.language = show_data.language |
|
|
ti_show.language = clean_data(show_data.language) |
|
|
ti_show.overview = show_data.summary |
|
|
ti_show.overview = clean_data(show_data.summary) |
|
|
ti_show.firstaired = show_data.premiered |
|
|
ti_show.firstaired = clean_data(show_data.premiered) |
|
|
ti_show.runtime = show_data.average_runtime or show_data.runtime |
|
|
ti_show.runtime = show_data.average_runtime or show_data.runtime |
|
|
ti_show.vote_average = show_data.rating and show_data.rating.get('average') |
|
|
ti_show.vote_average = show_data.rating and show_data.rating.get('average') |
|
|
ti_show.popularity = show_data.weight |
|
|
ti_show.popularity = show_data.weight |
|
|
ti_show.genre_list = show_data.genres or [] |
|
|
ti_show.genre_list = clean_data(show_data.genres or []) |
|
|
ti_show.genre = '|%s|' % '|'.join(ti_show.genre_list).lower() |
|
|
ti_show.genre = '|%s|' % '|'.join(ti_show.genre_list).lower() |
|
|
ti_show.official_site = show_data.official_site |
|
|
ti_show.official_site = clean_data(show_data.official_site) |
|
|
ti_show.status = show_data.status |
|
|
ti_show.status = clean_data(show_data.status) |
|
|
ti_show.show_type = (isinstance(show_data.type, string_types) and [show_data.type.lower()] or |
|
|
ti_show.show_type = clean_data((isinstance(show_data.type, string_types) and [show_data.type.lower()] or |
|
|
isinstance(show_data.type, list) and [x.lower() for x in show_data.type] or []) |
|
|
isinstance(show_data.type, list) and [x.lower() for x in show_data.type] or [])) |
|
|
ti_show.lastupdated = show_data.updated |
|
|
ti_show.lastupdated = show_data.updated |
|
|
ti_show.poster = show_data.image and show_data.image.get('original') |
|
|
ti_show.poster = show_data.image and show_data.image.get('original') |
|
|
if get_akas: |
|
|
if get_akas: |
|
|
ti_show.aliases = [a.name for a in show_data.akas] |
|
|
ti_show.aliases = [clean_data(a.name) for a in show_data.akas] |
|
|
if 'days' in show_data.schedule: |
|
|
if 'days' in show_data.schedule: |
|
|
ti_show.airs_dayofweek = ', '.join(show_data.schedule['days']) |
|
|
ti_show.airs_dayofweek = ', '.join(clean_data(show_data.schedule['days'])) |
|
|
network = show_data.network or show_data.web_channel |
|
|
network = show_data.network or show_data.web_channel |
|
|
if network: |
|
|
if network: |
|
|
ti_show.network_is_stream = None is not show_data.web_channel |
|
|
ti_show.network_is_stream = None is not show_data.web_channel |
|
|
ti_show.network = network.name |
|
|
ti_show.network = clean_data(network.name) |
|
|
ti_show.network_id = network.maze_id |
|
|
ti_show.network_id = network.maze_id |
|
|
ti_show.network_country = network.country |
|
|
ti_show.network_country = clean_data(network.country) |
|
|
ti_show.network_country_code = network.code |
|
|
ti_show.network_country_code = clean_data(network.code) |
|
|
ti_show.network_timezone = network.timezone |
|
|
ti_show.network_timezone = clean_data(network.timezone) |
|
|
if get_images and show_data.images: |
|
|
if get_images and show_data.images: |
|
|
b_set, f_set, p_set = False, False, False |
|
|
b_set, f_set, p_set = False, False, False |
|
|
for cur_img in show_data.images: |
|
|
for cur_img in show_data.images: |
|
@ -641,8 +647,9 @@ class TvMaze(TVInfoBase): |
|
|
ti_show.fanart = cur_img.resolutions.get('original')['url'] |
|
|
ti_show.fanart = cur_img.resolutions.get('original')['url'] |
|
|
ti_show.ids = TVInfoIDs( |
|
|
ti_show.ids = TVInfoIDs( |
|
|
tvdb=show_data.externals.get('thetvdb'), rage=show_data.externals.get('tvrage'), tvmaze=show_data.id, |
|
|
tvdb=show_data.externals.get('thetvdb'), rage=show_data.externals.get('tvrage'), tvmaze=show_data.id, |
|
|
imdb=show_data.externals.get('imdb') and try_int(show_data.externals.get('imdb').replace('tt', ''), None)) |
|
|
imdb=clean_data(show_data.externals.get('imdb') and |
|
|
ti_show.imdb_id = show_data.externals.get('imdb') |
|
|
try_int(show_data.externals.get('imdb').replace('tt', ''), None))) |
|
|
|
|
|
ti_show.imdb_id = clean_data(show_data.externals.get('imdb')) |
|
|
if isinstance(ti_show.imdb_id, integer_types): |
|
|
if isinstance(ti_show.imdb_id, integer_types): |
|
|
ti_show.imdb_id = 'tt%07d' % ti_show.imdb_id |
|
|
ti_show.imdb_id = 'tt%07d' % ti_show.imdb_id |
|
|
|
|
|
|
|
@ -650,9 +657,9 @@ class TvMaze(TVInfoBase): |
|
|
ti_episode.id = episode_data.maze_id |
|
|
ti_episode.id = episode_data.maze_id |
|
|
ti_episode.seasonnumber = episode_data.season_number |
|
|
ti_episode.seasonnumber = episode_data.season_number |
|
|
ti_episode.episodenumber = episode_data.episode_number |
|
|
ti_episode.episodenumber = episode_data.episode_number |
|
|
ti_episode.episodename = episode_data.title |
|
|
ti_episode.episodename = clean_data(episode_data.title) |
|
|
ti_episode.airtime = episode_data.airtime |
|
|
ti_episode.airtime = clean_data(episode_data.airtime) |
|
|
ti_episode.firstaired = episode_data.airdate |
|
|
ti_episode.firstaired = clean_data(episode_data.airdate) |
|
|
if episode_data.airstamp: |
|
|
if episode_data.airstamp: |
|
|
try: |
|
|
try: |
|
|
at = _datetime_to_timestamp(tz_p.parse(episode_data.airstamp)) |
|
|
at = _datetime_to_timestamp(tz_p.parse(episode_data.airstamp)) |
|
@ -662,7 +669,7 @@ class TvMaze(TVInfoBase): |
|
|
ti_episode.filename = episode_data.image and (episode_data.image.get('original') or |
|
|
ti_episode.filename = episode_data.image and (episode_data.image.get('original') or |
|
|
episode_data.image.get('medium')) |
|
|
episode_data.image.get('medium')) |
|
|
ti_episode.is_special = episode_data.is_special() |
|
|
ti_episode.is_special = episode_data.is_special() |
|
|
ti_episode.overview = episode_data.summary |
|
|
ti_episode.overview = clean_data(episode_data.summary) |
|
|
ti_episode.runtime = episode_data.runtime |
|
|
ti_episode.runtime = episode_data.runtime |
|
|
ti_episode.show = ti_show |
|
|
ti_episode.show = ti_show |
|
|
return ti_episode |
|
|
return ti_episode |
|
|