diff --git a/channelselector.py b/channelselector.py index 03b51bf5..52c174d2 100644 --- a/channelselector.py +++ b/channelselector.py @@ -26,10 +26,14 @@ def getmainlist(view="thumb_"): context = CONTEXT)) # Añade los canales que forman el menú principal if addon.getSetting('enable_news_menu') == "true": + # itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist", + # thumbnail=get_thumb("news.png", view), + # category=config.get_localized_string(30119), viewmode="thumbnails", + # context=CONTEXT + [{"title": config.get_localized_string(70285), "channel": "news", "action": "menu_opciones","goto": True}])) itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist", thumbnail=get_thumb("news.png", view), category=config.get_localized_string(30119), viewmode="thumbnails", - context=CONTEXT + [{"title": config.get_localized_string(70285), "channel": "news", "action": "menu_opciones","goto": True}])) + context=CONTEXT + [{"title": config.get_localized_string(70285), "channel": "shortcuts", "action": "SettingOnPosition", "category":5}])) if addon.getSetting('enable_channels_menu') == "true": itemlist.append(Item(title=config.get_localized_string(30118), channel="channelselector", action="getchanneltypes", @@ -38,11 +42,16 @@ def getmainlist(view="thumb_"): context = CONTEXT)) if addon.getSetting('enable_search_menu') == "true": + # itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist", + # thumbnail=get_thumb("search.png", view), + # category=config.get_localized_string(30119), viewmode="list", + # context = CONTEXT + [{"title": config.get_localized_string(60412), "action": "setting_channel_new", "channel": "search"}, + # {"title": config.get_localized_string(70286), "action": "settings", "channel": "search"}])) itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist", thumbnail=get_thumb("search.png", view), category=config.get_localized_string(30119), viewmode="list", context = CONTEXT + [{"title": config.get_localized_string(60412), "action": "setting_channel_new", "channel": "search"}, - {"title": config.get_localized_string(70286), "action": "settings", "channel": "search"}])) + {"title": config.get_localized_string(70286), "channel": "shortcuts", "action": "SettingOnPosition", "category":3}])) if addon.getSetting('enable_onair_menu') == "true": itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001), @@ -62,20 +71,31 @@ def getmainlist(view="thumb_"): context = CONTEXT)) if config.get_videolibrary_support() and addon.getSetting('enable_library_menu') == "true": + # itemlist.append(Item(title=config.get_localized_string(30131), channel="videolibrary", action="mainlist", + # thumbnail=get_thumb("videolibrary.png", view), + # category=config.get_localized_string(30119), viewmode="thumbnails", + # context=CONTEXT + [{"title": config.get_localized_string(70287), "channel": "videolibrary", + # "action": "channel_config"}])) itemlist.append(Item(title=config.get_localized_string(30131), channel="videolibrary", action="mainlist", thumbnail=get_thumb("videolibrary.png", view), category=config.get_localized_string(30119), viewmode="thumbnails", - context=CONTEXT + [{"title": config.get_localized_string(70287), "channel": "videolibrary", - "action": "channel_config"}])) + context=CONTEXT + [{"title": config.get_localized_string(70287), "channel": "shortcuts", "action": "SettingOnPosition", "category":2}, + {"title": config.get_localized_string(60568), "channel": "videolibrary", "action": "update_videolibrary"}])) if downloadenabled != "false": + # itemlist.append(Item(title=config.get_localized_string(30101), channel="downloads", action="mainlist", + # thumbnail=get_thumb("downloads.png", view), viewmode="list", + # context=CONTEXT + [{"title": config.get_localized_string(70288), "channel": "setting", "config": "downloads", + # "action": "channel_config"}])) itemlist.append(Item(title=config.get_localized_string(30101), channel="downloads", action="mainlist", thumbnail=get_thumb("downloads.png", view), viewmode="list", - context=CONTEXT + [{"title": config.get_localized_string(70288), "channel": "setting", "config": "downloads", - "action": "channel_config"}])) + context=CONTEXT + [{"title": config.get_localized_string(70288), "channel": "shortcuts", "action": "SettingOnPosition", "category":4}])) thumb_setting = "setting_%s.png" % 0 # config.get_setting("plugin_updates_available") - itemlist.append(Item(title=config.get_localized_string(30100), channel="setting", action="mainlist", + # itemlist.append(Item(title=config.get_localized_string(30100), channel="setting", action="mainlist", + # thumbnail=get_thumb(thumb_setting, view), + # category=config.get_localized_string(30100), viewmode="list")) + itemlist.append(Item(title=config.get_localized_string(30100), channel="setting", action="settings", thumbnail=get_thumb(thumb_setting, view), category=config.get_localized_string(30100), viewmode="list")) itemlist.append(Item(title=config.get_localized_string(30104) + " (v" + config.get_addon_version(with_fix=True) + ")", channel="help", action="mainlist", diff --git a/core/servertools.py b/core/servertools.py index 666594a7..2c4b86da 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -735,7 +735,7 @@ def check_list_links(itemlist, numero='', timeout=3): El parámetro numero indica cuantos enlaces hay que verificar (0:5, 1:10, 2:15, 3:20) El parámetro timeout indica un tope de espera para descargar la página """ - numero = ((int(numero) + 1) * 5) if numero != '' else 10 + numero = numero if numero > 4 else ((int(numero) + 1) * 5) if numero != '' else 5 import sys if sys.version_info[0] >= 3: from concurrent import futures diff --git a/core/support.py b/core/support.py index a4cb2bd2..90376d12 100755 --- a/core/support.py +++ b/core/support.py @@ -1091,11 +1091,9 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True, down_load=True): if CL and not AP: if get_setting('checklinks', item.channel): checklinks = get_setting('checklinks', item.channel) - else: - checklinks = get_setting('checklinks') - if get_setting('checklinks_number', item.channel): checklinks_number = get_setting('checklinks_number', item.channel) else: + checklinks = get_setting('checklinks') checklinks_number = get_setting('checklinks_number') itemlist = servertools.check_list_links(itemlist, checklinks_number) diff --git a/default_channel_settings.json b/default_channel_settings.json index 943a4b58..86c79405 100644 --- a/default_channel_settings.json +++ b/default_channel_settings.json @@ -47,7 +47,7 @@ "default": 2, "enabled": true, "visible": "eq(-1,true)", - "lvalues": [ "3", "5", "10", "15", "20" ] + "lvalues": [ "5", "10", "15", "20" ] } ], diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 6c4178e5..5188f01a 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -465,37 +465,37 @@ def set_context_commands(item, parent_item): else: context = [] - if config.get_setting("faster_item_serialization"): - # logger.info("Reducing serialization!") - itemBK = item - item = Item() - item.action = itemBK.action - item.channel = itemBK.channel - infoLabels = {} - if itemBK.infoLabels["year"]: infoLabels["year"] = itemBK.infoLabels["year"] - if itemBK.infoLabels["imdb_id"]: infoLabels["imdb_id"] = itemBK.infoLabels["imdb_id"] - if itemBK.infoLabels["tmdb_id"]: infoLabels["tmdb_id"] = itemBK.infoLabels["tmdb_id"] - if itemBK.infoLabels["tvdb_id"]: infoLabels["tvdb_id"] = itemBK.infoLabels["tvdb_id"] - if itemBK.infoLabels["noscrap_id"]: infoLabels["noscrap_id"] = itemBK.infoLabels["noscrap_id"] - if len(infoLabels) > 0: item.infoLabels = infoLabels + # if config.get_setting("faster_item_serialization"): + # # logger.info("Reducing serialization!") + # itemBK = item + # item = Item() + # item.action = itemBK.action + # item.channel = itemBK.channel + # infoLabels = {} + # if itemBK.infoLabels["year"]: infoLabels["year"] = itemBK.infoLabels["year"] + # if itemBK.infoLabels["imdb_id"]: infoLabels["imdb_id"] = itemBK.infoLabels["imdb_id"] + # if itemBK.infoLabels["tmdb_id"]: infoLabels["tmdb_id"] = itemBK.infoLabels["tmdb_id"] + # if itemBK.infoLabels["tvdb_id"]: infoLabels["tvdb_id"] = itemBK.infoLabels["tvdb_id"] + # if itemBK.infoLabels["noscrap_id"]: infoLabels["noscrap_id"] = itemBK.infoLabels["noscrap_id"] + # if len(infoLabels) > 0: item.infoLabels = infoLabels - if itemBK.thumbnail: item.thumbnail = itemBK.thumbnail - if itemBK.extra: item.extra = itemBK.extra - if itemBK.contentEpisodeNumber: item.contentEpisodeNumber = itemBK.contentEpisodeNumber - if itemBK.contentEpisodeTitle: item.contentEpisodeTitle = itemBK.contentEpisodeTitle - if itemBK.contentPlot: item.contentPlot = itemBK.contentPlot - if itemBK.contentQuality: item.contentQuality = itemBK.contentQuality - if itemBK.contentSeason: item.contentSeason = itemBK.contentSeason - if itemBK.contentSerieName: item.contentSerieName = itemBK.contentSerieName - if itemBK.contentThumbnail: item.contentThumbnail = itemBK.contentThumbnail - if itemBK.contentTitle: item.contentTitle = itemBK.contentTitle - if itemBK.contentType: item.contentType = itemBK.contentType - if itemBK.duration: item.duration = itemBK.duration - if itemBK.plot: item.plot = itemBK.plot - if itemBK.quality: item.quality = itemBK.quality - if itemBK.show: item.show = itemBK.show - if itemBK.title: item.title = itemBK.title - if itemBK.viewcontent: item.viewcontent = itemBK.viewcontent + # if itemBK.thumbnail: item.thumbnail = itemBK.thumbnail + # if itemBK.extra: item.extra = itemBK.extra + # if itemBK.contentEpisodeNumber: item.contentEpisodeNumber = itemBK.contentEpisodeNumber + # if itemBK.contentEpisodeTitle: item.contentEpisodeTitle = itemBK.contentEpisodeTitle + # if itemBK.contentPlot: item.contentPlot = itemBK.contentPlot + # if itemBK.contentQuality: item.contentQuality = itemBK.contentQuality + # if itemBK.contentSeason: item.contentSeason = itemBK.contentSeason + # if itemBK.contentSerieName: item.contentSerieName = itemBK.contentSerieName + # if itemBK.contentThumbnail: item.contentThumbnail = itemBK.contentThumbnail + # if itemBK.contentTitle: item.contentTitle = itemBK.contentTitle + # if itemBK.contentType: item.contentType = itemBK.contentType + # if itemBK.duration: item.duration = itemBK.duration + # if itemBK.plot: item.plot = itemBK.plot + # if itemBK.quality: item.quality = itemBK.quality + # if itemBK.show: item.show = itemBK.show + # if itemBK.title: item.title = itemBK.title + # if itemBK.viewcontent: item.viewcontent = itemBK.viewcontent # itemJson = item.tojson() # logger.info("Elemento: {0} bytes".format(len(itemJson))) diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 676e8542..436899db 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -106,13 +106,33 @@ msgid "NO" msgstr "" msgctxt "#30024" -msgid "Contextual Menu" +msgid "Select the elements you want to display on the Contextual Menu" msgstr "" msgctxt "#30025" msgid "KoD Preferences" msgstr "Preferenze KoD" +msgctxt "#30026" +msgid "Direct" +msgstr "" + +msgctxt "#30027" +msgid "SetResolvedUrl" +msgstr "" + +msgctxt "#30028" +msgid "Built-In" +msgstr "" + +msgctxt "#30029" +msgid "Download and Play" +msgstr "" + +msgctxt "#30030" +msgid "Advanced Options" +msgstr "" + msgctxt "#30043" msgid "Force view mode:" msgstr "" @@ -2327,11 +2347,11 @@ msgid "Videolibrary options" msgstr "" msgctxt "#60567" -msgid " Overwrite the entire video library (strm, nfo and json)" +msgid "Overwrite the entire video library (strm, nfo and json)" msgstr "" msgctxt "#60568" -msgid " Search for new episodes and update the video library" +msgid "Search for new episodes and update the video library" msgstr "" msgctxt "#60569" @@ -3267,12 +3287,12 @@ msgid "Movie|Tv Shows|Anime|Children|Documentary|Horror|Castellan|Latin|Torrent" msgstr "" msgctxt "#70126" -msgid "Visual Options" +msgid "Customization" msgstr "" msgctxt "#70128" -msgid "Infoplus visual option" -msgstr "" +msgid "Infoplus Animation" +msgstr "Animazione Infoplus" msgctxt "#70129" msgid "Without animation" @@ -3679,15 +3699,15 @@ msgid "File location" msgstr "" msgctxt "#70230" -msgid " - Add completed downloads to the video library " +msgid "Add completed downloads to the video library " msgstr "" msgctxt "#70231" -msgid " - Move the downloaded file to the video library" +msgid "Move the downloaded file to the video library" msgstr "" msgctxt "#70232" -msgid " - View files downloaded from downloads" +msgid "View files downloaded from downloads" msgstr "" msgctxt "#70233" @@ -3715,7 +3735,7 @@ msgid "- Order of servers" msgstr "" msgctxt "#70240" -msgid " - Preferred quality" +msgid "Preferred quality" msgstr "" msgctxt "#70241" @@ -3723,7 +3743,7 @@ msgid "The highest" msgstr "" msgctxt "#70242" -msgid " - Choose the fastest servers" +msgid "Choose the fastest servers" msgstr "" msgctxt "#70243" @@ -5562,7 +5582,7 @@ msgid "Use your custom channel URLs" msgstr "" msgctxt "#70706" -msgid "autostart KOD at Kodi boot" +msgid "Autostart KOD at Kodi boot" msgstr "" msgctxt "#70707" @@ -5598,7 +5618,7 @@ msgid "Customize Homepage" msgstr "" msgctxt "#70716" -msgid "Choose menus you wanna in homepage" +msgid "Select the elements you want to display on the Homepage" msgstr "" msgctxt "#70717" @@ -5761,6 +5781,38 @@ msgctxt "#70757" msgid "Compact" msgstr "" +msgctxt "#70758" +msgid "Buffer size to download before playback" +msgstr "" + +msgctxt "#70759" +msgid "Limit (in Kb's) of background download speed (DOES NOT affect RAR)" +msgstr "" + +msgctxt "#70760" +msgid "Do you want the RAR and ZIP files to be decompressed for playback?" +msgstr "" + +msgctxt "#70761" +msgid "Uncompressing RARs in the background?" +msgstr "" + +msgctxt "#70762" +msgid "Do you want to convert Magnets to Torrents to see sizes and store them?" +msgstr "" + +msgctxt "#70763" +msgid "HD 1080" +msgstr "" + +msgctxt "#70764" +msgid "HD 720" +msgstr "" + +msgctxt "#70765" +msgid "SD" +msgstr "" + # DNS start [ settings and declaration ] msgctxt "#707401" msgid "Enable DNS Check Alert" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 07c70c6b..d127d555 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -106,13 +106,33 @@ msgid "NO" msgstr "NO" msgctxt "#30024" -msgid "Contextual Menu" -msgstr "Menu Contestuale" +msgid "Select the elements you want to display on the Contextual Menu" +msgstr "Seleziona gli elementi che vuoi visualizzare nel Menu Contestuale" msgctxt "#30025" msgid "KoD Preferences" msgstr "Preferenze KoD" +msgctxt "#30026" +msgid "Direct" +msgstr "Direct" + +msgctxt "#30027" +msgid "SetResolvedUrl" +msgstr "SetResolvedUrl" + +msgctxt "#30028" +msgid "Built-In" +msgstr "Built-In" + +msgctxt "#30029" +msgid "Download and Play" +msgstr "Download and Play" + +msgctxt "#30030" +msgid "Advanced Options" +msgstr "Opzioni Avanzate" + msgctxt "#30043" msgid "Force view mode:" msgstr "Forza modalità di visualizzazione:" @@ -2326,11 +2346,11 @@ msgid "Videolibrary options" msgstr "Opzioni della videoteca" msgctxt "#60567" -msgid " Overwrite the entire video library (strm, nfo and json)" +msgid "Overwrite the entire video library (strm, nfo and json)" msgstr "Sovrascrivi l'intera videoteca (strm, nfo e json)" msgctxt "#60568" -msgid " Search for new episodes and update the video library" +msgid "Search for new episodes and update the video library" msgstr "Cerca nuovi episodi e aggiorna la videoteca" msgctxt "#60569" @@ -3266,12 +3286,12 @@ msgid "Movie|Tv Shows|Anime|Children|Documentary|Horror|Castellan|Latin|Torrent" msgstr "Fim|Serie TV|Anime|Bambini|Documentari|Horror|Castigliano|Latino|Torrent" msgctxt "#70126" -msgid "Visual Options" -msgstr "Opzioni Vista" +msgid "Customization" +msgstr "Personalizzazione" msgctxt "#70128" -msgid "Infoplus visual option" -msgstr "Opzioni Vista Infoplus" +msgid "Infoplus Animation" +msgstr "Animazione Infoplus" msgctxt "#70129" msgid "Without animation" @@ -3678,16 +3698,16 @@ msgid "File location" msgstr "Posizione dei files" msgctxt "#70230" -msgid " - Add completed downloads to the video library " -msgstr " - Aggiungi download completi alla videoteca" +msgid "Add completed downloads to the video library " +msgstr "Aggiungi download completi alla videoteca" msgctxt "#70231" -msgid " - Move the downloaded file to the video library" -msgstr " - Sposta i files scaricati nella videoteca" +msgid "Move the downloaded file to the video library" +msgstr "Sposta i files scaricati nella videoteca" msgctxt "#70232" -msgid " - View files downloaded from downloads" -msgstr " - Visualizzare i files scaricati da Downloads" +msgid "View files downloaded from downloads" +msgstr "Visualizzare i files scaricati da Downloads" msgctxt "#70233" msgid " - Size per block" @@ -3714,16 +3734,16 @@ msgid "- Order of servers" msgstr " - Ordine dei servers" msgctxt "#70240" -msgid " - Preferred quality" -msgstr " - Qualità preferita" +msgid "Preferred quality" +msgstr "Qualità preferita" msgctxt "#70241" msgid "The highest" msgstr "La più alta" msgctxt "#70242" -msgid " - Choose the fastest servers" -msgstr " - Scegli i servers più veloci" +msgid "Choose the fastest servers" +msgstr "Scegli i servers più veloci" msgctxt "#70243" msgid "Download" @@ -5562,8 +5582,8 @@ msgid "Use your custom channel URLs" msgstr "Utilizza URL personalizzati per i canali" msgctxt "#70706" -msgid "autostart KOD at Kodi boot" -msgstr "avvio automatico di KOD al boot di Kodi" +msgid "Autostart KOD at Kodi boot" +msgstr "Avvio automatico di KOD al boot di Kodi" msgctxt "#70707" msgid "Enable" @@ -5598,8 +5618,8 @@ msgid "Customize Homepage" msgstr "Personalizza Homepage" msgctxt "#70716" -msgid "Choose menus you wanna in homepage" -msgstr "Seleziona gli elementi che vuoi visualizzare nella homepage" +msgid "Select the elements you want to display on the Homepage" +msgstr "Seleziona gli elementi che vuoi visualizzare nella Homepage" msgctxt "#70717" msgid "Are all the special episodes present?" @@ -5765,6 +5785,38 @@ msgctxt "#70757" msgid "Compact" msgstr "Compatta" +msgctxt "#70758" +msgid "Buffer size to download before playback" +msgstr "Dimensione del buffer da scaricare prima della riproduzione" + +msgctxt "#70759" +msgid "Limit (in Kb's) of background download speed (DOES NOT affect RAR)" +msgstr "Limite (in Kb) della velocità di download in background (NON influisce su RAR)" + +msgctxt "#70760" +msgid "Do you want the RAR and ZIP files to be decompressed for playback?" +msgstr "Vuoi che i file RAR e ZIP vengano decompressi per la riproduzione?" + +msgctxt "#70761" +msgid "Uncompressing RARs in the background?" +msgstr "Decomprimere i RAR in secondo piano?" + +msgctxt "#70762" +msgid "Do you want to convert Magnets to Torrents to see sizes and store them?" +msgstr "Vuoi convertire i Magnets to Torrents per vedere le dimensioni e memorizzarle?" + +msgctxt "#70763" +msgid "HD 1080" +msgstr "HD 1080" + +msgctxt "#70764" +msgid "HD 720" +msgstr "HD 720" + +msgctxt "#70765" +msgid "SD" +msgstr "SD" + # DNS start [ settings and declaration ] msgctxt "#707401" msgid "Enable DNS Check Alert" diff --git a/resources/settings.xml b/resources/settings.xml index d41e9395..8f9588a7 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -2,29 +2,96 @@ - - - - + + + + - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33,102 +100,72 @@ + + + + + + + - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + - + - + - + - - - - - - + - - - - - - + + + + + + + diff --git a/servers/animeworld.json b/servers/animeworld_server.json similarity index 92% rename from servers/animeworld.json rename to servers/animeworld_server.json index 87c879a0..5cd743d4 100644 --- a/servers/animeworld.json +++ b/servers/animeworld_server.json @@ -10,8 +10,8 @@ ] }, "free": true, - "id": "animeworld", - "name": "animeworld", + "id": "animeworld_server", + "name": "Animeworld", "settings": [ { "default": false, diff --git a/servers/animeworld.py b/servers/animeworld_server.py similarity index 100% rename from servers/animeworld.py rename to servers/animeworld_server.py diff --git a/specials/downloads.json b/specials/downloads.json index 263ba9af..966eab98 100644 --- a/specials/downloads.json +++ b/specials/downloads.json @@ -8,36 +8,6 @@ "movie" ], "settings": [ - { - "type": "label", - "label": "@70229", - "enabled": true, - "visible": true - }, - { - "id": "library_add", - "type": "bool", - "label": "@70230", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "library_move", - "type": "bool", - "label": "@70231", - "default": false, - "enabled": "eq(-1,true)", - "visible": true - }, - { - "id": "browser", - "type": "bool", - "label": "@70232", - "default": true, - "enabled": true, - "visible": true - }, { "type": "label", "label": "@70243", @@ -122,28 +92,6 @@ "enabled": true, "visible": true }, - { - "id": "quality", - "type": "list", - "label": "@70240", - "lvalues": [ - "@70241", - "HD 1080", - "HD 720", - "SD" - ], - "default": 0, - "enabled": true, - "visible": true - }, - { - "id": "server_speed", - "type": "bool", - "label": "@70242", - "default": true, - "enabled": true, - "visible": true - }, { "id": "server_reorder", "type": "list", @@ -161,10 +109,10 @@ "type": "list", "label": "@70246", "lvalues": [ - "Ita, Sub, Eng, Vos, Vosi", - "Eng, Ita, Sub, Vos, Vosi", - "Sub, Ita, Eng, Vos, Vosi", - "Eng, Sub, Ita, Vos, Vosi" + "Ita, Sub, Eng", + "Eng, Ita, Sub", + "Sub, Ita, Eng", + "Eng, Sub, Ita" ], "default": 0, "enabled": "eq(-1,'@70245')", diff --git a/specials/downloads.py b/specials/downloads.py index 2f42dcf9..b5840116 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -112,7 +112,7 @@ def mainlist(item): contentType=item.contentType, contentChannel=item.contentChannel, contentSerieName=item.contentSerieName)) - if not item.contentType == "tvshow" and config.get_setting("browser", "downloads") == True: + if not item.contentType == "tvshow" and config.get_setting("browser") == True: itemlist.insert(0, Item(channel=item.channel, action="browser", title=support.typo(config.get_localized_string(70222),'bold'),url=DOWNLOAD_PATH)) if not item.contentType == "tvshow": @@ -285,7 +285,7 @@ def move_to_libray(item): library_path = filetools.join(move_path, *filetools.split(item.downloadFilename)) final_path = download_path - if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == True: + if config.get_setting("library_add") == True and config.get_setting("library_move") == True: if not filetools.isdir(filetools.dirname(library_path)): filetools.mkdir(filetools.dirname(library_path)) @@ -322,7 +322,7 @@ def move_to_libray(item): xbmc.sleep(500) xbmc_videolibrary.clean() - if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == False: + if config.get_setting("library_add") == True and config.get_setting("library_move") == False: if filetools.isfile(final_path): if item.contentType == "movie" and item.infoLabels["tmdb_id"]: library_item = Item(title=config.get_localized_string(70228) % item.downloadFilename, channel="downloads", @@ -471,7 +471,7 @@ def sort_method(item): "VOSI": ["VOSI"]} order_list_calidad = ["BLURAY", "FULLHD", "HD", "480P", "360P", "240P"] - order_list_calidad = quality_orders[int(config.get_setting("quality", "downloads"))] + order_list_calidad = quality_orders[int(config.get_setting("quality"))] match_list_calidad = {"BLURAY": ["BR", "BLURAY", '4K'], "FULLHD": ["FULLHD", "FULL HD", "1080", "HD1080", "HD 1080", "1080p"], "HD": ["HD", "HD REAL", "HD 720", "720", "HDTV", "720p"], @@ -482,7 +482,7 @@ def sort_method(item): value = (get_match_list(item.title, match_list_idimas, order_list_idiomas, ignorecase=True, only_ascii=True).index, \ get_match_list(item.title, match_list_calidad, order_list_calidad, ignorecase=True, only_ascii=True).index) - if config.get_setting("server_speed", "downloads"): + if config.get_setting("server_speed"): value += tuple([get_server_position(item.server)]) return value @@ -723,8 +723,8 @@ def start_download(item): def get_episodes(item): - logger.info("contentAction: %s | contentChannel: %s | contentType: %s" % ( - item.contentAction, item.contentChannel, item.contentType)) + logger.info("contentAction: %s | contentChannel: %s | contentType: %s" % (item.contentAction, item.contentChannel, item.contentType)) + if 'dlseason' in item: season = True season_number = item.dlseason @@ -782,13 +782,13 @@ def get_episodes(item): episode.contentTitle = re.sub("\[[^\]]+\]|\([^\)]+\)|\d*x\d*\s*-", "", episode.title).strip() episode.downloadFilename = filetools.validate_path(filetools.join(item.downloadFilename, "%dx%0.2d - %s" % (episode.contentSeason, episode.contentEpisodeNumber, episode.contentTitle.strip()))) - itemlist.append(episode) - - if season: - if scrapertools.find_single_match(episode.title, r'(\d+)x') == season_number: - itemlist.append(episode) + if season: + if scrapertools.find_single_match(episode.title, r'(\d+)x') == season_number: + itemlist.append(episode) else: itemlist.append(episode) + + # Cualquier otro resultado no nos vale, lo ignoramos else: logger.info("Omitiendo item no válido: %s" % episode.tostring()) diff --git a/specials/filmontv.py b/specials/filmontv.py index e4bc8972..ad3479f8 100644 --- a/specials/filmontv.py +++ b/specials/filmontv.py @@ -82,7 +82,7 @@ def mainlist(item): return itemlist def server_config(item): - return platformtools.show_channel_settings(channelpath=filetools.join(config.get_runtime_path(), "specials", item.config)) + return platformtools.show_channel_settings(channelpath=filetools.join(config.get_runtime_path(), "server", item.config)) def now_on_misc_film(item): logger.info("filmontv tvoggi") diff --git a/specials/infoplus.py b/specials/infoplus.py index cf873699..b62fa432 100644 --- a/specials/infoplus.py +++ b/specials/infoplus.py @@ -56,6 +56,8 @@ if xinfoplus_set == config.get_localized_string(70129): set_animation = False if xinfoplus_set == config.get_localized_string(70130): set_animation = True +else: + set_animation = xinfoplus_set def start(item, recomendaciones=[], from_window=False): if from_window: diff --git a/specials/news.py b/specials/news.py index dd9f6eef..1405f09e 100644 --- a/specials/news.py +++ b/specials/news.py @@ -591,8 +591,8 @@ def menu_opciones(item): # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=config.get_localized_string(70213), # thumbnail=get_thumb("channels_documentary.png"), folder=False)) - itemlist.append(Item(channel=item.channel, action="setting_channel", extra="Torrent", title=config.get_localized_string(70214), - thumbnail=get_thumb("channels_documentary.png"), folder=False)) + # itemlist.append(Item(channel=item.channel, action="setting_channel", extra="torrent", title=config.get_localized_string(70214), + # thumbnail=get_thumb("channels_documentary.png"), folder=False)) itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales", title=config.get_localized_string(60530), diff --git a/specials/nextep.py b/specials/nextep.py index 90425d66..0c861221 100644 --- a/specials/nextep.py +++ b/specials/nextep.py @@ -57,7 +57,9 @@ def next_ep(item): time_over = False time_limit = time() + 30 time_steps = [20,30,40,50,60,70,80,90,100,110,120] - TimeFromEnd = time_steps[config.get_setting('next_ep_seconds')] + time_setting = config.get_setting('next_ep_seconds') + TimeFromEnd = time_setting if time_setting > 10 else time_steps[time_setting] + # wait until the video plays while not platformtools.is_playing() and time() < time_limit: diff --git a/specials/search.py b/specials/search.py index a95e9ae3..f181c59e 100644 --- a/specials/search.py +++ b/specials/search.py @@ -47,7 +47,7 @@ def mainlist(item): Item(channel=item.channel, title=typo(config.get_localized_string(59994), 'color kod bold'), action='opciones', thumbnail=get_thumb('setting_0.png')), - Item(channel=item.channel, title=typo(config.get_localized_string(30100), 'color kod bold'), action='settings', thumbnail=get_thumb('setting_0.png'))] + Item(channel='shortcuts', title=typo(config.get_localized_string(30100), 'color kod bold'), action='SettingOnPosition', category=3, thumbnail=get_thumb('setting_0.png'))] itemlist = set_context(itemlist) @@ -114,7 +114,8 @@ def new_search(item): logger.info() itemlist = [] - if channeltools.get_channel_setting('last_search', 'search'): + if config.get_setting('last_search'): + # if channeltools.get_channel_setting('last_search', 'search'): last_search = channeltools.get_channel_setting('Last_searched', 'search', '') else: last_search = '' @@ -253,7 +254,7 @@ def channel_search(item): if it in valid: continue if mode == 'all' or (it.contentType and mode == it.contentType): - if config.get_setting('result_mode', 'search') != 0: + if config.get_setting('result_mode') != 0: if config.get_localized_string(30992) not in it.title: it.title += typo(ch_name,'_ [] color kod bold') results.append(it) @@ -267,7 +268,7 @@ def channel_search(item): if not grouped: continue # to_temp[key] = grouped - if config.get_setting('result_mode', 'search') == 0: + if config.get_setting('result_mode') == 0: if not config.get_setting('unify'): title = typo(ch_name,'bold') + typo(str(len(grouped)), '_ [] color kod bold') else: @@ -371,9 +372,8 @@ def settings(item): return platformtools.show_channel_settings(caption=config.get_localized_string(59993)) def set_workers(): - list_mode=[None,1,2,4,6,8,16,24,32,64] - index = config.get_setting('thread_number', 'search') - return list_mode[index] + workers = config.get_setting('thread_number') if config.get_setting('thread_number') > 0 else None + return workers def setting_channel_new(item): import xbmcgui @@ -723,7 +723,7 @@ def get_from_temp(item): def save_search(text): if text: - saved_searches_limit = int((10, 20, 30, 40)[int(config.get_setting("saved_searches_limit", "search"))]) + saved_searches_limit = config.get_setting("saved_searches_limit") current_saved_searches_list = config.get_setting("saved_searches_list", "search") if current_saved_searches_list is None: diff --git a/specials/setting.py b/specials/setting.py index da5bd917..782b582f 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -155,7 +155,7 @@ def setting_torrent(item): { "id": "mct_buffer", "type": "text", - "label": "MCT - Tamaño del Buffer a descargar antes de la reproducción", + "label": "MCT - " + config.get_localized_string(70758), "default": BUFFER, "enabled": True, "visible": "eq(-1,%s)" % torrent_options[2] @@ -163,7 +163,7 @@ def setting_torrent(item): { "id": "mct_download_path", "type": "text", - "label": "MCT - Ruta de la carpeta de descarga", + "label": "MCT - " + config.get_localized_string(30017), "default": DOWNLOAD_PATH, "enabled": True, "visible": "eq(-2,%s)" % torrent_options[2] @@ -171,7 +171,7 @@ def setting_torrent(item): { "id": "bt_buffer", "type": "text", - "label": "BT - Tamaño del Buffer a descargar antes de la reproducción", + "label": "BT - " + config.get_localized_string(70758), "default": BUFFER_BT, "enabled": True, "visible": "eq(-3,%s)" % torrent_options[1] @@ -179,7 +179,7 @@ def setting_torrent(item): { "id": "bt_download_path", "type": "text", - "label": "BT - Ruta de la carpeta de descarga", + "label": "BT - " + config.get_localized_string(30017), "default": DOWNLOAD_PATH_BT, "enabled": True, "visible": "eq(-4,%s)" % torrent_options[1] @@ -187,7 +187,7 @@ def setting_torrent(item): { "id": "mct_download_limit", "type": "text", - "label": "Límite (en Kb's) de la velocidad de descarga en segundo plano (NO afecta a RAR)", + "label": config.get_localized_string(70759), "default": DOWNLOAD_LIMIT, "enabled": True, "visible": "eq(-5,%s) | eq(-5,%s)" % (torrent_options[1], torrent_options[2]) @@ -195,7 +195,7 @@ def setting_torrent(item): { "id": "mct_rar_unpack", "type": "bool", - "label": "¿Quiere que se descompriman los archivos RAR y ZIP para su reproducción?", + "label": config.get_localized_string(70760), "default": RAR, "enabled": True, "visible": True @@ -203,7 +203,7 @@ def setting_torrent(item): { "id": "mct_background_download", "type": "bool", - "label": "¿Se procesa la descompresión de RARs en segundo plano?", + "label": config.get_localized_string(70761), "default": BACKGROUND, "enabled": True, "visible": True @@ -211,7 +211,7 @@ def setting_torrent(item): { "id": "magnet2torrent", "type": "bool", - "label": "¿Quiere convertir los Magnets a Torrents para ver tamaños y almacenarlos?", + "label": config.get_localized_string(70762), "default": MAGNET2TORRENT, "enabled": True, "visible": True diff --git a/specials/shortcuts.py b/specials/shortcuts.py index 423181f1..d48064ad 100644 --- a/specials/shortcuts.py +++ b/specials/shortcuts.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from platformcode import logger + def context(): from platformcode import config context = [] @@ -20,4 +22,125 @@ def shortcut_menu(item): def settings_menu(item): from platformcode import config - config.open_settings() \ No newline at end of file + config.open_settings() + +def servers_menu(item): + # from core.support import dbg; dbg() + from core import servertools + from core.item import Item + from platformcode import config, platformtools + from specials import setting + + names = [] + ids = [] + + if item.type == 'debriders': + action = 'server_debrid_config' + server_list = list(servertools.get_debriders_list().keys()) + for server in server_list: + server_parameters = servertools.get_server_parameters(server) + if server_parameters['has_settings']: + names.append(server_parameters['name']) + ids.append(server) + + select = platformtools.dialog_select(config.get_localized_string(60552), names) + ID = ids[select] + + it = Item(channel = 'settings', + action = action, + config = ID) + return setting.server_debrid_config(it) + else: + action = 'server_config' + server_list = list(servertools.get_servers_list().keys()) + for server in sorted(server_list): + server_parameters = servertools.get_server_parameters(server) + if server_parameters["has_settings"] and [x for x in server_parameters["settings"] if x["id"] not in ["black_list", "white_list"]]: + names.append(server_parameters['name']) + ids.append(server) + + select = platformtools.dialog_select(config.get_localized_string(60538), names) + ID = ids[select] + + it = Item(channel = 'settings', + action = action, + config = ID) + + return setting.server_config(it) + +def channels_menu(item): + import channelselector + from core import channeltools + from core.item import Item + from platformcode import config, platformtools + from specials import setting + + names = [] + ids = [] + + channel_list = channelselector.filterchannels("all") + for channel in channel_list: + if not channel.channel: + continue + channel_parameters = channeltools.get_channel_parameters(channel.channel) + if channel_parameters["has_settings"]: + names.append(channel.title) + ids.append(channel.channel) + + select = platformtools.dialog_select(config.get_localized_string(60537), names) + ID = ids[select] + + it = Item(channel='settings', + action="channel_config", + config=ID) + + return setting.channel_config(it) + +def check_channels(item): + from specials import setting + from platformcode import config, platformtools + # from core.support import dbg; dbg() + item.channel = 'setting' + item.extra = 'lib_check_datajson' + itemlist = setting.conf_tools(item) + text = '' + for item in itemlist: + text += item.title + '\n' + + platformtools.dialog_textviewer(config.get_localized_string(60537), text) + + +def SettingOnPosition(item): + # addonId is the Addon ID + # item.category is the Category (Tab) offset (0=first, 1=second, 2...etc) + # item.setting is the Setting (Control) offse (0=first, 1=second, 2...etc) + # This will open settings dialog focusing on fourth setting (control) inside the third category (tab) + + import xbmc + + xbmc.executebuiltin('Addon.OpenSettings(plugin.video.kod)') + category = item.category if item.category else 0 + setting = item.setting if item.setting else 0 + logger.info('SETTING= ' + str(setting)) + xbmc.executebuiltin('SetFocus(%i)' % (category - 100)) + xbmc.executebuiltin('SetFocus(%i)' % (setting - 80)) + + +def select(item): + from platformcode import config, platformtools + # item.id = setting ID + # item.type = labels or values + # item.values = values separeted by | + # item.label = string or string id + + label = config.get_localized_string(int(item.label)) if item.label.isdigit() else item.label + values = [] + + if item.type == 'labels': + for val in item.values.split('|'): + values.append(config.get_localized_string(int(val))) + else: + values = item.values.split('|') + + select = platformtools.dialog_select(label, values) + config.set_setting(item.id, values[select]) \ No newline at end of file