mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-15 01:15:05 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
316ee49883
35 changed files with 82 additions and 80 deletions
|
@ -397,27 +397,28 @@ class TvMaze(TVInfoBase):
|
||||||
# type: (...) -> Dict[integer_types, integer_types]
|
# type: (...) -> Dict[integer_types, integer_types]
|
||||||
return {sid: v.seconds_since_epoch for sid, v in iteritems(tvmaze.show_updates().updates)}
|
return {sid: v.seconds_since_epoch for sid, v in iteritems(tvmaze.show_updates().updates)}
|
||||||
|
|
||||||
def _convert_person(self, tvmaze_person_obj):
|
def _convert_person(self, tvmaze_person_obj, load_credits=True):
|
||||||
# type: (tvmaze.Person) -> TVInfoPerson
|
# type: (tvmaze.Person, bool) -> TVInfoPerson
|
||||||
ch = []
|
ch = []
|
||||||
_dupes = []
|
_dupes = []
|
||||||
for c in tvmaze_person_obj.castcredits or []:
|
if load_credits:
|
||||||
ti_show = TVInfoShow()
|
for c in tvmaze_person_obj.castcredits or []:
|
||||||
ti_show.seriesname = clean_data(c.show.name)
|
ti_show = TVInfoShow()
|
||||||
ti_show.id = c.show.id
|
ti_show.seriesname = clean_data(c.show.name)
|
||||||
ti_show.firstaired = clean_data(c.show.premiered)
|
ti_show.id = c.show.id
|
||||||
ti_show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: ti_show.id})
|
ti_show.firstaired = clean_data(c.show.premiered)
|
||||||
ti_show.overview = clean_data(c.show.summary)
|
ti_show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: ti_show.id})
|
||||||
ti_show.status = clean_data(c.show.status)
|
ti_show.overview = clean_data(c.show.summary)
|
||||||
net = c.show.network or c.show.web_channel
|
ti_show.status = clean_data(c.show.status)
|
||||||
if net:
|
net = c.show.network or c.show.web_channel
|
||||||
ti_show.network = clean_data(net.name)
|
if net:
|
||||||
ti_show.network_id = net.maze_id
|
ti_show.network = clean_data(net.name)
|
||||||
ti_show.network_country = clean_data(net.country)
|
ti_show.network_id = net.maze_id
|
||||||
ti_show.network_country_code = clean_data(net.code)
|
ti_show.network_country = clean_data(net.country)
|
||||||
ti_show.network_timezone = clean_data(net.timezone)
|
ti_show.network_country_code = clean_data(net.code)
|
||||||
ti_show.network_is_stream = None is not c.show.web_channel
|
ti_show.network_timezone = clean_data(net.timezone)
|
||||||
ch.append(TVInfoCharacter(name=clean_data(c.character.name), ti_show=ti_show, episode_count=1))
|
ti_show.network_is_stream = None is not c.show.web_channel
|
||||||
|
ch.append(TVInfoCharacter(name=clean_data(c.character.name), ti_show=ti_show, episode_count=1))
|
||||||
try:
|
try:
|
||||||
birthdate = tvmaze_person_obj.birthday and tz_p.parse(tvmaze_person_obj.birthday).date()
|
birthdate = tvmaze_person_obj.birthday and tz_p.parse(tvmaze_person_obj.birthday).date()
|
||||||
except (BaseException, Exception):
|
except (BaseException, Exception):
|
||||||
|
@ -440,66 +441,67 @@ class TvMaze(TVInfoBase):
|
||||||
url=tvmaze_person_obj.url, ids=TVInfoIDs(ids={TVINFO_TVMAZE: tvmaze_person_obj.id})
|
url=tvmaze_person_obj.url, ids=TVInfoIDs(ids={TVINFO_TVMAZE: tvmaze_person_obj.id})
|
||||||
)
|
)
|
||||||
|
|
||||||
for (c_t, regular) in [(tvmaze_person_obj.castcredits or [], True),
|
if load_credits:
|
||||||
(tvmaze_person_obj.guestcastcredits or [], False)]:
|
for (c_t, regular) in [(tvmaze_person_obj.castcredits or [], True),
|
||||||
for c in c_t: # type: tvmaze.CastCredit
|
(tvmaze_person_obj.guestcastcredits or [], False)]:
|
||||||
_show = c.show or c.episode.show
|
for c in c_t: # type: tvmaze.CastCredit
|
||||||
_clean_char_name = clean_data(c.character.name)
|
_show = c.show or c.episode.show
|
||||||
ti_show = TVInfoShow()
|
_clean_char_name = clean_data(c.character.name)
|
||||||
if None is not _show:
|
ti_show = TVInfoShow()
|
||||||
_clean_show_name = clean_data(_show.name)
|
if None is not _show:
|
||||||
_clean_show_id = clean_data(_show.id)
|
_clean_show_name = clean_data(_show.name)
|
||||||
_cur_dup = (_clean_char_name, _clean_show_id)
|
_clean_show_id = clean_data(_show.id)
|
||||||
if _cur_dup in _dupes:
|
_cur_dup = (_clean_char_name, _clean_show_id)
|
||||||
_co = next((_c for _c in ch if _clean_show_id == _c.ti_show.id
|
if _cur_dup in _dupes:
|
||||||
and _c.name == _clean_char_name), None)
|
_co = next((_c for _c in ch if _clean_show_id == _c.ti_show.id
|
||||||
if None is not _co:
|
and _c.name == _clean_char_name), None)
|
||||||
ti_show = _co.ti_show
|
if None is not _co:
|
||||||
_co.episode_count += 1
|
ti_show = _co.ti_show
|
||||||
if not regular:
|
_co.episode_count += 1
|
||||||
ep_no = c.episode.episode_number or 0
|
if not regular:
|
||||||
_co.guest_episodes_numbers.setdefault(c.episode.season_number, []).append(ep_no)
|
ep_no = c.episode.episode_number or 0
|
||||||
if c.episode.season_number not in ti_show:
|
_co.guest_episodes_numbers.setdefault(c.episode.season_number, []).append(ep_no)
|
||||||
season = TVInfoSeason(show=ti_show, number=c.episode.season_number)
|
if c.episode.season_number not in ti_show:
|
||||||
ti_show[c.episode.season_number] = season
|
season = TVInfoSeason(show=ti_show, number=c.episode.season_number)
|
||||||
else:
|
ti_show[c.episode.season_number] = season
|
||||||
season = ti_show[c.episode.season_number]
|
else:
|
||||||
episode = self._make_episode(c.episode, show_obj=ti_show)
|
season = ti_show[c.episode.season_number]
|
||||||
episode.season = season
|
episode = self._make_episode(c.episode, show_obj=ti_show)
|
||||||
ti_show[c.episode.season_number][ep_no] = episode
|
episode.season = season
|
||||||
continue
|
ti_show[c.episode.season_number][ep_no] = episode
|
||||||
else:
|
continue
|
||||||
_dupes.append(_cur_dup)
|
else:
|
||||||
ti_show.seriesname = clean_data(_show.name)
|
_dupes.append(_cur_dup)
|
||||||
ti_show.id = _show.id
|
ti_show.seriesname = clean_data(_show.name)
|
||||||
ti_show.firstaired = clean_data(_show.premiered)
|
ti_show.id = _show.id
|
||||||
ti_show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: ti_show.id})
|
ti_show.firstaired = clean_data(_show.premiered)
|
||||||
ti_show.overview = enforce_type(clean_data(_show.summary), str, '')
|
ti_show.ids = TVInfoIDs(ids={TVINFO_TVMAZE: ti_show.id})
|
||||||
ti_show.status = clean_data(_show.status)
|
ti_show.overview = enforce_type(clean_data(_show.summary), str, '')
|
||||||
net = _show.network or _show.web_channel
|
ti_show.status = clean_data(_show.status)
|
||||||
if net:
|
net = _show.network or _show.web_channel
|
||||||
ti_show.network = clean_data(net.name)
|
if net:
|
||||||
ti_show.network_id = net.maze_id
|
ti_show.network = clean_data(net.name)
|
||||||
ti_show.network_country = clean_data(net.country)
|
ti_show.network_id = net.maze_id
|
||||||
ti_show.network_timezone = clean_data(net.timezone)
|
ti_show.network_country = clean_data(net.country)
|
||||||
ti_show.network_country_code = clean_data(net.code)
|
ti_show.network_timezone = clean_data(net.timezone)
|
||||||
ti_show.network_is_stream = None is not _show.web_channel
|
ti_show.network_country_code = clean_data(net.code)
|
||||||
if c.episode:
|
ti_show.network_is_stream = None is not _show.web_channel
|
||||||
|
if c.episode:
|
||||||
|
|
||||||
ti_show.show_loaded = False
|
ti_show.show_loaded = False
|
||||||
ti_show.load_method = self._show_info_loader
|
ti_show.load_method = self._show_info_loader
|
||||||
season = TVInfoSeason(show=ti_show, number=c.episode.season_number)
|
season = TVInfoSeason(show=ti_show, number=c.episode.season_number)
|
||||||
ti_show[c.episode.season_number] = season
|
ti_show[c.episode.season_number] = season
|
||||||
episode = self._make_episode(c.episode, show_obj=ti_show)
|
episode = self._make_episode(c.episode, show_obj=ti_show)
|
||||||
episode.season = season
|
episode.season = season
|
||||||
ti_show[c.episode.season_number][c.episode.episode_number or 0] = episode
|
ti_show[c.episode.season_number][c.episode.episode_number or 0] = episode
|
||||||
if not regular:
|
if not regular:
|
||||||
_g_kw = {'guest_episodes_numbers': {c.episode.season_number: [c.episode.episode_number or 0]}}
|
_g_kw = {'guest_episodes_numbers': {c.episode.season_number: [c.episode.episode_number or 0]}}
|
||||||
else:
|
else:
|
||||||
_g_kw = {}
|
_g_kw = {}
|
||||||
ch.append(TVInfoCharacter(name=_clean_char_name, ti_show=ti_show, regular=regular, episode_count=1,
|
ch.append(TVInfoCharacter(name=_clean_char_name, ti_show=ti_show, regular=regular, episode_count=1,
|
||||||
person=[_ti_person_obj], **_g_kw))
|
person=[_ti_person_obj], **_g_kw))
|
||||||
_ti_person_obj.characters = ch
|
_ti_person_obj.characters = ch
|
||||||
return _ti_person_obj
|
return _ti_person_obj
|
||||||
|
|
||||||
def _show_info_loader(self, show_id, show_data=None, show_obj=None, load_images=True, load_actors=True):
|
def _show_info_loader(self, show_id, show_data=None, show_obj=None, load_images=True, load_actors=True):
|
||||||
|
@ -553,7 +555,7 @@ class TvMaze(TVInfoBase):
|
||||||
existing_character = next(
|
existing_character = next(
|
||||||
(c for c in _s_o.cast[RoleTypes.ActorMain] if c.id == cur_ch.id),
|
(c for c in _s_o.cast[RoleTypes.ActorMain] if c.id == cur_ch.id),
|
||||||
None) # type: Optional[TVInfoCharacter]
|
None) # type: Optional[TVInfoCharacter]
|
||||||
person = self._convert_person(cur_ch.person)
|
person = self._convert_person(cur_ch.person, load_credits=False)
|
||||||
if existing_character:
|
if existing_character:
|
||||||
existing_person = next((p for p in existing_character.person
|
existing_person = next((p for p in existing_character.person
|
||||||
if person.id == p.ids.get(TVINFO_TVMAZE)),
|
if person.id == p.ids.get(TVINFO_TVMAZE)),
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
||||||
2023-09-06
|
2024-01-11
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue