diff --git a/resources/language/resource.language.de_de/strings.po b/resources/language/resource.language.de_de/strings.po index eec3dc0..1295fb5 100644 --- a/resources/language/resource.language.de_de/strings.po +++ b/resources/language/resource.language.de_de/strings.po @@ -126,6 +126,14 @@ msgctxt "#30039" msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." msgstr "Zeige in der Season-Übersicht eines Anime nur Dubs in Japanisch, deiner CR Sprache oder in einer der von Dir konfigurierten Untertitel-Sprachen" +msgctxt "#30036" +msgid "Show dub language in Season View" +msgstr "Zeige die Audio-Sprache in der Season-Übersicht" + +msgctxt "#30037" +msgid "In an anime seasons view, display a dub tag in front of the season name." +msgstr "Zeige in der Season-Übersicht eines Anime die Audio-Sprache vor dem Titel der Staffel." + # Crunchyroll Menue diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 09bffe7..680a9af 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -126,6 +126,14 @@ msgctxt "#30039" msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." msgstr "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." +msgctxt "#30036" +msgid "Show dub language in Season View" +msgstr "Show dub language in Season View" + +msgctxt "#30037" +msgid "In an anime seasons view, display a dub tag in front of the season name." +msgstr "In an anime seasons view, display a dub tag in front of the season name." + # Crunchyroll Menue diff --git a/resources/language/resource.language.es_es/strings.po b/resources/language/resource.language.es_es/strings.po index b15b3d0..d275f2e 100644 --- a/resources/language/resource.language.es_es/strings.po +++ b/resources/language/resource.language.es_es/strings.po @@ -126,6 +126,14 @@ msgctxt "#30039" msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." msgstr "En una vista de temporadas de anime, sólo se muestran los idiomas de audio en japonés, su idioma Crunchyroll o cualquiera de los idiomas de subtítulos configurados." +msgctxt "#30036" +msgid "Show dub language in Season View" +msgstr "Mostrar el idioma de doblaje en la vista de temporadas" + +msgctxt "#30037" +msgid "In an anime seasons view, display a dub tag in front of the season name." +msgstr "En la vista de temporadas de un anime, muestra una etiqueta de doblaje delante del nombre de la temporada." + # Crunchyroll Menue diff --git a/resources/language/resource.language.fr_fr/strings.po b/resources/language/resource.language.fr_fr/strings.po index 8e73dee..0bbfccf 100644 --- a/resources/language/resource.language.fr_fr/strings.po +++ b/resources/language/resource.language.fr_fr/strings.po @@ -125,6 +125,14 @@ msgctxt "#30039" msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." msgstr "Dans une vue de saisons d'anime, n'affichez que les langues audio en japonais, votre langue Crunchyroll ou l'une des langues de sous-titres que vous avez configurées." +msgctxt "#30036" +msgid "Show dub language in Season View" +msgstr "Afficher la langue du doublage dans la vue des saisons" + +msgctxt "#30037" +msgid "In an anime seasons view, display a dub tag in front of the season name." +msgstr "Dans la vue des saisons d'un anime, afficher une étiquette de doublage devant le nom de la saison." + # Crunchyroll Menue msgctxt "#30040" diff --git a/resources/language/resource.language.pt_br/strings.po b/resources/language/resource.language.pt_br/strings.po index f6f2480..0af4ffd 100644 --- a/resources/language/resource.language.pt_br/strings.po +++ b/resources/language/resource.language.pt_br/strings.po @@ -125,6 +125,13 @@ msgctxt "#30039" msgid "In an anime seasons view, only display dubs in either Japanese, your CR language or any of your configured subtitle languages." msgstr "Em uma exibição de temporadas de anime, exiba apenas os idiomas de áudio em japonês, o idioma Crunchyroll ou qualquer um dos idiomas de legenda configurados." +msgctxt "#30036" +msgid "Show dub language in Season View" +msgstr "Mostrar o idioma da dublagem na visualização da temporada" + +msgctxt "#30037" +msgid "In an anime seasons view, display a dub tag in front of the season name." +msgstr "Em uma visualização de temporadas de anime, exiba uma tag de dublagem na frente do nome da temporada." # Crunchyroll Menue diff --git a/resources/lib/model.py b/resources/lib/model.py index f4b5c63..0d2884c 100644 --- a/resources/lib/model.py +++ b/resources/lib/model.py @@ -211,19 +211,52 @@ def to_item(self, args: Args) -> xbmcgui.ListItem: li = xbmcgui.ListItem() li.setLabel(self.title) + li_info = li.getVideoInfoTag() # if is a playable item, set some things if hasattr(self, 'duration'): li.setProperty("IsPlayable", "true") - li.setProperty('TotalTime', str(float(getattr(self, 'duration')))) + li_info.setDuration(int(getattr(self, 'duration'))) # set resume if not fully watched and playhead > x if hasattr(self, 'playcount') and getattr(self, 'playcount') == 0: if hasattr(self, 'playhead') and getattr(self, 'playhead') > 0: resume = int(getattr(self, 'playhead') / getattr(self, 'duration') * 100) if 5 <= resume <= 90: - li.setProperty('ResumeTime', str(float(getattr(self, 'playhead')))) + li_info.setResumePoint(float(getattr(self, 'playhead')), float(getattr(self, 'duration'))) + + + li_info.setTitle(list_info.get('title')) + li_info.setTvShowTitle(list_info.get('tvshowtitle')) + li_info.setSeason(int(list_info.get('season'))) + """ sometimes no explicit episode number is given: ['', 'OVA', 'SP'] + sometimes it's a plain number, sometimes it's text + """ + if str(list_info.get('episode')).isnumeric(): + li_info.setEpisode(int(list_info.get('episode'))) + else: + li_info.setEpisode(0) + if list_info.get('plot'): # seasons don't have plots + li_info.setPlot(list_info.get('plot')) + li_info.setPlotOutline(list_info.get('plotoutline')) + + # playhead -> see setResumePoint above + # duration -> see setDuration above + li_info.setPlaycount(int(list_info.get('playcount'))) + + # season_id -> not part of InfoTagVideo + # series_id -> not part of InfoTagVideo + # episode_id -> not part of InfoTagVideo + # stream_id -> not part of InfoTagVideo + + if list_info.get('year'): # it's unlikely the other dates are given if year is missing + li_info.setYear(int(list_info.get('year')[0:3])) # only use first 4 digits in case of date + li_info.setFirstAired(list_info.get('aired')) + li_info.setPremiered(list_info.get('premiered')) + + li_info.setRating(float(list_info.get('rating'))) + + li_info.setMediaType(list_info.get('mediatype')) - li.setInfo('video', list_info) li.setArt({ "thumb": self.thumb or 'DefaultFolder.png', 'poster': self.poster or self.thumb or 'DefaultFolder.png', @@ -265,7 +298,7 @@ def get_info(self, args: Args) -> Dict: Crunchyroll XBMC series collection season season - episode episode + episode episode """ @@ -337,7 +370,11 @@ def __init__(self, data: dict): super().__init__() self.id = data.get("id") - self.title: str = data.get("title") + settings = xbmcaddon.Addon(id=re.sub(r"^plugin://([^/]+)/.*$", r"\1", sys.argv[0])).getSettings() + if settings.getBool("show_lang_in_seasons"): + self.title: str = '[' + data.get("audio_locale") + '] ' + data.get("title") + else: + self.title: str = data.get("title") self.tvshowtitle: str = data.get("title") self.series_id: str | None = data.get("series_id") self.season_id: str | None = data.get("id") diff --git a/resources/lib/utils.py b/resources/lib/utils.py index c394157..6d48b33 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -293,4 +293,5 @@ def highlight_list_item_title(list_item: xbmcgui.ListItem): Used to highlight that item is already on watchlist """ - list_item.setInfo('video', {'title': '[COLOR orange]' + list_item.getLabel() + '[/COLOR]'}) + li_info = list_item.getVideoInfoTag() + li_info.setTitle('[COLOR orange]' + list_item.getLabel() + '[/COLOR]') diff --git a/resources/lib/view.py b/resources/lib/view.py index 1738198..6b42860 100644 --- a/resources/lib/view.py +++ b/resources/lib/view.py @@ -82,19 +82,24 @@ def add_item( # create list item li = xbmcgui.ListItem(label=info["title"], path=u) + li_info = li.getVideoInfoTag() # get infoLabels info_labels = make_info_label(args, info) if is_folder: # directory - info_labels["mediatype"] = "tvshow" - li.setInfo(mediatype, info_labels) + li_info.setTitle(info_labels.get('title')) + if info_labels.get('genre'): + li_info.setGenres([info_labels.get('genre')]) + li_info.setMediaType('tvshow') else: # playable video - info_labels["mediatype"] = "episode" - li.setInfo(mediatype, info_labels) li.setProperty("IsPlayable", "true") + li_info.setTitle(info_labels.get('title')) + if info_labels.get('genre'): + li_info.setGenres([info_labels.get('genre')]) + li_info.setMediaType('episode') # add context menu to jump to seasons xor episodes # @todo: this only makes sense in some very specific places, we need a way to handle these better. diff --git a/resources/settings.xml b/resources/settings.xml index 0c1e831..de041e7 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -99,6 +99,12 @@ true + + + 0 + false + +