diff --git a/core/channeltools.py b/core/channeltools.py index 13544356..c6fc2135 100644 --- a/core/channeltools.py +++ b/core/channeltools.py @@ -168,15 +168,8 @@ def get_channel_controls_settings(channel_name): return list_controls, dict_settings -def get_default_settings(channel_name): - import filetools, inspect - - # Check if it is a real channel - try: - channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name]) - except: - return get_channel_json(channel_name).get('settings', list()) - +def get_lang(channel_name): + channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name]) list_language = [config.get_localized_string(70522)] if hasattr(channel, 'list_language'): for language in channel.list_language: @@ -198,7 +191,18 @@ def get_default_settings(channel_name): else: for lang in langs: list_language.append(lang) + return list_language +def get_default_settings(channel_name): + import filetools, inspect + + # Check if it is a real channel + try: + channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name]) + except: + return get_channel_json(channel_name).get('settings', list()) + + list_language = get_lang(channel_name) # Check if the automatic renumbering function exists renumber = False diff --git a/core/support.py b/core/support.py index 49a082c7..118d6ec9 100644 --- a/core/support.py +++ b/core/support.py @@ -200,7 +200,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else '' title = cleantitle(scraped['title']) if scraped['title'] else '' title2 = cleantitle(scraped['title2']) if scraped['title2'] else '' - quality = scraped['quality'] if scraped['quality'] else '' + quality = scraped['quality'].strip() if scraped['quality'] else '' Type = scraped['type'] if scraped['type'] else '' plot = cleantitle(scraped["plot"]) if scraped["plot"] else '' @@ -353,8 +353,8 @@ def scrape(func): if 'lang' in bl: it.contentLanguage, it.title = scrapeLang(bl, it.contentLanguage, it.title) if 'quality' in bl and bl['quality']: - it.quality = bl['quality'] - it.title = it.title + typo(bl['quality'], '_ [] color kod') + it.quality = bl['quality'].strip() + it.title = it.title + typo(bl['quality'].strip(), '_ [] color kod') log('BLOCK ', '=', block) itemlist.extend(blockItemlist) matches.extend(blockMatches) @@ -908,14 +908,14 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True): if item.contentChannel != 'videolibrary': videolibrary(itemlist, item, function_level=3) if get_setting('downloadenabled'): download(itemlist, item, function_level=3) - filterLang(item, itemlist) return itemlist def filterLang(item, itemlist): import channeltools - list_language = channeltools.get_channel_json(item.channel).get('language', list()) - from specials import filtertools - itemlist = filtertools.get_links(itemlist, item, list_language) + list_language = channeltools.get_lang(item.channel) + if len(list_language) > 1: + from specials import filtertools + itemlist = filtertools.get_links(itemlist, item, list_language) return itemlist def aplay(item, itemlist, list_servers='', list_quality=''): diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 33f7ce68..9d3ddb1e 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -1807,7 +1807,7 @@ msgid "Delete" msgstr "" msgctxt "#60438" -msgid "¿Enable / disable filter?" +msgid "Enable / Disable filter?" msgstr "" msgctxt "#60439" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 2ad48d12..00fcf07b 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -1806,12 +1806,12 @@ msgid "Delete" msgstr "Eliminare" msgctxt "#60438" -msgid "¿Enable / disable filter?" +msgid "Enable / Disable filter?" msgstr "Attiva / Disattiva filtro?" msgctxt "#60439" msgid "Language" -msgstr "Linguaggio" +msgstr "Lingua" msgctxt "#60440" msgid "Permitted quality" @@ -1819,7 +1819,7 @@ msgstr "Qualità consentita" msgctxt "#60441" msgid "Filter links for: [COLOR %s]%s[/COLOR]" -msgstr "Link di filtro per: [COLOR %s]%s[/COLOR]" +msgstr "Filtro link per: [COLOR %s]%s[/COLOR]" msgctxt "#60442" msgid "Are you sure you want to delete the filter?" diff --git a/specials/filtertools.py b/specials/filtertools.py index 294dd95d..0acdeacd 100644 --- a/specials/filtertools.py +++ b/specials/filtertools.py @@ -431,7 +431,7 @@ def config_item(item): if item.show.lower().strip() in dict_series: allow_option = True active = dict_series.get(item.show.lower().strip(), {}).get(TAG_ACTIVE, False) - custom_button = {'label': 'Borrar', 'function': 'delete', 'visible': True, 'close': True} + custom_button = {'label': config.get_localized_string(60437), 'function': 'delete', 'visible': True, 'close': True} list_controls = [] @@ -439,7 +439,7 @@ def config_item(item): active_control = { "id": "active", "type": "bool", - "label": "¿Activar/Desactivar filtro?", + "label": config.get_localized_string(60438), "color": "", "default": active, "enabled": allow_option, @@ -450,8 +450,8 @@ def config_item(item): language_option = { "id": "language", "type": "list", - "label": "Idioma", - "color": "0xFFee66CC", + "label": config.get_localized_string(60439), + # "color": "0xFFee66CC", "default": item.list_language.index(lang_selected), "enabled": True, "visible": True, @@ -483,7 +483,7 @@ def config_item(item): # concatenamos list_controls con list_controls_calidad list_controls.extend(list_controls_calidad) - title = "Filtrado de enlaces para: [COLOR %s]%s[/COLOR]" % (COLOR.get("selected", "auto"), item.show) + title = config.get_localized_string(60441) % (COLOR.get("selected", "auto"), item.show) platformtools.show_channel_settings(list_controls=list_controls, callback='save', item=item, caption=title, custom_button=custom_button) @@ -496,9 +496,8 @@ def delete(item, dict_values): dict_series = jsontools.get_node_from_file(item.from_channel, TAG_TVSHOW_FILTER) tvshow = item.show.strip().lower() - heading = "¿Está seguro que desea eliminar el filtro?" - line1 = "Pulse 'Si' para eliminar el filtro de [COLOR %s]%s[/COLOR], pulse 'No' o cierre la ventana para " \ - "no hacer nada." % (COLOR.get("selected", "auto"), item.show.strip()) + heading = config.get_localized_string(60442) + line1 = config.get_localized_string(60443) % (COLOR.get("selected", "auto"), item.show.strip()) if platformtools.dialog_yesno(heading, line1) == 1: lang_selected = dict_series.get(tvshow, {}).get(TAG_LANGUAGE, "") @@ -508,9 +507,9 @@ def delete(item, dict_values): sound = False if result: - message = "FILTRO ELIMINADO" + message = config.get_localized_string(60444) else: - message = "Error al guardar en disco" + message = config.get_localized_string(60445) sound = True heading = "%s [%s]" % (item.show.strip(), lang_selected) @@ -555,9 +554,9 @@ def save(item, dict_data_saved): sound = False if result: - message = "FILTRO GUARDADO" + message = config.get_localized_string(60446) else: - message = "Error al guardar en disco" + message = config.get_localized_string(70593) sound = True heading = "%s [%s]" % (item.show.strip(), lang_selected)