|
|
|
|
@@ -3287,15 +3287,16 @@ def _show_new_titles(plugin_name: str, page: int = 1, *, action_name: str = "new
|
|
|
|
|
meta = plugin_meta.get(title)
|
|
|
|
|
info_labels, art, cast = _merge_metadata(title, tmdb_info, tmdb_art, tmdb_cast, meta)
|
|
|
|
|
info_labels = dict(info_labels or {})
|
|
|
|
|
info_labels.setdefault("mediatype", "movie")
|
|
|
|
|
is_direct_play = bool(
|
|
|
|
|
plugin_name.casefold() == "einschalten"
|
|
|
|
|
and _get_setting_bool("einschalten_enable_playback", default=False)
|
|
|
|
|
)
|
|
|
|
|
info_labels.setdefault("mediatype", "movie" if is_direct_play else "tvshow")
|
|
|
|
|
playstate = _title_playstate(plugin_name, title)
|
|
|
|
|
info_labels = _apply_playstate_to_info(dict(info_labels), playstate)
|
|
|
|
|
display_label = _label_with_duration(title, info_labels)
|
|
|
|
|
display_label = _label_with_playstate(display_label, playstate)
|
|
|
|
|
direct_play = bool(
|
|
|
|
|
plugin_name.casefold() == "einschalten"
|
|
|
|
|
and _get_setting_bool("einschalten_enable_playback", default=False)
|
|
|
|
|
)
|
|
|
|
|
direct_play = is_direct_play
|
|
|
|
|
_add_directory_item(
|
|
|
|
|
handle,
|
|
|
|
|
display_label,
|
|
|
|
|
@@ -3381,8 +3382,6 @@ def _show_latest_episodes(plugin_name: str, page: int = 1) -> None:
|
|
|
|
|
playstate = _get_playstate(key)
|
|
|
|
|
|
|
|
|
|
label = f"{title} - S{season_number:02d}E{episode_number:02d}"
|
|
|
|
|
if airdate:
|
|
|
|
|
label = f"{label} ({airdate})"
|
|
|
|
|
label = _label_with_playstate(label, playstate)
|
|
|
|
|
|
|
|
|
|
info_labels: dict[str, object] = {
|
|
|
|
|
@@ -4122,15 +4121,14 @@ def _play_episode(
|
|
|
|
|
title_key = (title or "").strip().casefold()
|
|
|
|
|
_tmdb_id = _tmdb_cache_get(_TMDB_ID_CACHE, title_key, 0)
|
|
|
|
|
_imdb_id = ""
|
|
|
|
|
trakt_media: dict[str, object] | None = None
|
|
|
|
|
_kind = _tmdb_cache_get(_MEDIA_TYPE_CACHE, title_key, "tv") if _tmdb_id else "tv"
|
|
|
|
|
if _tmdb_id:
|
|
|
|
|
_kind = _tmdb_cache_get(_MEDIA_TYPE_CACHE, title_key, "tv")
|
|
|
|
|
_imdb_id = _fetch_and_cache_imdb_id(title_key, _tmdb_id, _kind)
|
|
|
|
|
_set_trakt_ids_property(title, _tmdb_id, _imdb_id)
|
|
|
|
|
trakt_media = {
|
|
|
|
|
"title": title, "tmdb_id": _tmdb_id, "imdb_id": _imdb_id, "kind": _kind,
|
|
|
|
|
"season": season_number or 0, "episode": episode_number or 0,
|
|
|
|
|
}
|
|
|
|
|
trakt_media: dict[str, object] = {
|
|
|
|
|
"title": title, "tmdb_id": _tmdb_id, "imdb_id": _imdb_id, "kind": _kind,
|
|
|
|
|
"season": season_number or 0, "episode": episode_number or 0,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_play_final_link(
|
|
|
|
|
final_link,
|
|
|
|
|
@@ -4234,6 +4232,19 @@ def _play_episode_url(
|
|
|
|
|
if episode_number > 0:
|
|
|
|
|
info_labels["episode"] = str(episode_number)
|
|
|
|
|
display_title = _label_with_duration(display_title, info_labels)
|
|
|
|
|
|
|
|
|
|
title_key = (title or "").strip().casefold()
|
|
|
|
|
_tmdb_id = _tmdb_cache_get(_TMDB_ID_CACHE, title_key, 0)
|
|
|
|
|
_imdb_id = ""
|
|
|
|
|
_kind = _tmdb_cache_get(_MEDIA_TYPE_CACHE, title_key, "tv") if _tmdb_id else "tv"
|
|
|
|
|
if _tmdb_id:
|
|
|
|
|
_imdb_id = _fetch_and_cache_imdb_id(title_key, _tmdb_id, _kind)
|
|
|
|
|
_set_trakt_ids_property(title, _tmdb_id, _imdb_id)
|
|
|
|
|
trakt_media: dict[str, object] = {
|
|
|
|
|
"title": title, "tmdb_id": _tmdb_id, "imdb_id": _imdb_id, "kind": _kind,
|
|
|
|
|
"season": season_number or 0, "episode": episode_number or 0,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_play_final_link(
|
|
|
|
|
final_link,
|
|
|
|
|
display_title=display_title,
|
|
|
|
|
@@ -4241,6 +4252,7 @@ def _play_episode_url(
|
|
|
|
|
art=art,
|
|
|
|
|
cast=cast,
|
|
|
|
|
resolve_handle=resolve_handle,
|
|
|
|
|
trakt_media=trakt_media,
|
|
|
|
|
)
|
|
|
|
|
_track_playback_and_update_state_async(
|
|
|
|
|
_playstate_key(plugin_name=plugin_name, title=title, season=season_label, episode=episode_label)
|
|
|
|
|
|