From 3c51fd3e712ac32cedec772094e338f419636140 Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:41:26 -0400 Subject: [PATCH 01/17] Update service.py --- service.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/service.py b/service.py index d68b84b..eb964f9 100644 --- a/service.py +++ b/service.py @@ -11,7 +11,7 @@ import xbmcgui from resources.lib.lazylogger import LazyLogger from resources.lib.play_utils import Service, PlaybackService, send_progress from resources.lib.kodi_utils import HomeWindow -from resources.lib.widgets import set_background_image, set_random_movies +from resources.lib.widgets import set_background_image, set_random_movies, set_random_tvshows from resources.lib.websocket_client import WebSocketClient from resources.lib.menu_functions import set_library_window_values from resources.lib.server_detect import check_server, check_connection_speed @@ -20,7 +20,6 @@ from resources.lib.datamanager import clear_old_cache_data from resources.lib.tracking import set_timing_enabled from resources.lib.image_server import HttpImageServerThread from resources.lib.playnext import PlayNextService -from resources.lib.intro_skipper import IntroSkipperService settings = xbmcaddon.Addon() @@ -64,6 +63,7 @@ last_progress_update = time.time() last_content_check = time.time() last_background_update = 0 last_random_movie_update = 0 +last_random_tvshow_update = 0 # start the library update monitor library_change_monitor = LibraryChangeMonitor() @@ -88,10 +88,6 @@ if context_menu: context_monitor = ContextMonitor() context_monitor.start() -# Start the skip service monitor -intro_skipper = IntroSkipperService(monitor) -intro_skipper.start() - background_interval = int(settings.getSetting('background_interval')) newcontent_interval = int(settings.getSetting('new_content_check_interval')) random_movie_list_interval = int(settings.getSetting('random_movie_refresh_interval')) @@ -109,6 +105,7 @@ first_run = True home_window.set_property('exit', 'False') while home_window.get_property('exit') == 'False': + try: if xbmc.Player().isPlaying(): last_random_movie_update = time.time() - (random_movie_list_interval - 15) @@ -142,8 +139,12 @@ while home_window.get_property('exit') == 'False': settings.setSetting("server_speed_check_data", server_host + "-skipped") if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_movie_update) > random_movie_list_interval): - last_random_movie_update = time.time() - set_random_movies() + last_random_movie_update = time.time() + set_random_movies() + + if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_tvshow_update) > random_movie_list_interval): + last_random_tvshow_update = time.time() + set_random_tvshows() if user_changed or (newcontent_interval != 0 and (time.time() - last_content_check) > newcontent_interval): last_content_check = time.time() @@ -187,9 +188,6 @@ if play_next_service: # call stop on the context menu monitor if context_monitor: context_monitor.stop_monitor() - -if intro_skipper: - intro_skipper.stop_service() # clear user and token when logging off home_window.clear_property("user_name") From 0ea4a2e2729ee23fc0ae2c4c3a1c908e9cabacc1 Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:42:02 -0400 Subject: [PATCH 02/17] Update widgets.py --- resources/lib/widgets.py | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/resources/lib/widgets.py b/resources/lib/widgets.py index b09a21c..29067f6 100644 --- a/resources/lib/widgets.py +++ b/resources/lib/widgets.py @@ -67,6 +67,50 @@ def set_random_movies(): home_window.set_property("random-movies", movies_list_string) home_window.set_property("random-movies-changed", new_widget_hash) +@timer +def set_random_tvshows(): + log.debug("set_random_tvshows Called") + + settings = xbmcaddon.Addon() + item_limit = settings.getSetting("show_x_filtered_items") + hide_watched = settings.getSetting("hide_watched") == "true" + user_id = get_current_user_id() + + url_params = { + "Recursive": True, + "limit": item_limit, + "SortBy": "Random", + "IncludeItemTypes": "Series", + "ImageTypeLimit": 0 + } + + if hide_watched: + url_params["IsPlayed"] = False + + url = get_jellyfin_url("/Users/{}/Items".format(user_id), url_params) + results = api.get(url) + + random_tvshows_list = [] + if results: + for item in results.get("Items", []): + random_tvshows_list.append(item.get("Id")) + + random.shuffle(random_tvshows_list) + tvshow_list_string = ",".join(random_tvshows_list) + + m = hashlib.md5() + m.update(tvshow_list_string.encode()) + new_widget_hash = m.hexdigest() + + log.debug("set_random_tvshows: {}".format(tvshow_list_string)) + log.debug("set_random_tvshows Hash: {}".format(new_widget_hash)) + + home_window = HomeWindow() + home_window.set_property("random-tvshows", tvshow_list_string) + home_window.set_property("random-tvshows-changed", new_widget_hash) + + log.debug("set_random_tvshows: {0}".format(tvshow_list_string)) + log.debug("set_random_tvshows Hash: {0}".format(new_widget_hash)) def set_background_image(force=False): log.debug("set_background_image Called forced={0}".format(force)) @@ -333,6 +377,12 @@ def get_widget_content(handle, params): xbmcplugin.setContent(handle, 'movies') url_params["Ids"] = home_window.get_property("random-movies") + elif widget_type == "random_tvshows": + home_window = HomeWindow() + xbmcplugin.setContent(handle, 'tvshows') + url_params["Ids"] = home_window.get_property("random-tvshows") + + elif widget_type == "recent_tvshows": xbmcplugin.setContent(handle, 'episodes') url_verb = '/Users/{}/Items/Latest'.format(user_id) From 06c08d76e73711a989b04d3f2e7627ad9a40e2bd Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:42:35 -0400 Subject: [PATCH 03/17] Update menu_functions.py --- resources/lib/menu_functions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index e1c8b1d..15b4ee1 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -1353,9 +1353,10 @@ def show_widgets(): 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_movies') add_menu_directory_item(translate_string(30403) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=movie_recommendations') - add_menu_directory_item(translate_string(30287) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_tvshows') + add_menu_directory_item(translate_string(30455) + item_limit_text, + 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_tvshows') add_menu_directory_item(translate_string(30263) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_episodes') add_menu_directory_item(translate_string(30264) + item_limit_text, From a0c192e5675ef43f82efef4ed71cb874fff16cdf Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:48:30 -0400 Subject: [PATCH 04/17] Update strings.po --- resources/language/resource.language.en_gb/strings.po | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index f7a08a2..c8627eb 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1157,6 +1157,10 @@ msgctxt "#30454" msgid " - Totally Unwatched" msgstr " - Totally Unwatched" +msgctxt "#30455" +msgid "TV Shows - Random" +msgstr "TV Shows - Random" + msgctxt "#30666" msgid "Segment Skipper" msgstr "Segment Skipper" From c7050ac9a1fbc8b6b8cbc4364020053f76df8366 Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:55:26 -0400 Subject: [PATCH 05/17] Update service.py --- service.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service.py b/service.py index eb964f9..4184755 100644 --- a/service.py +++ b/service.py @@ -20,6 +20,7 @@ from resources.lib.datamanager import clear_old_cache_data from resources.lib.tracking import set_timing_enabled from resources.lib.image_server import HttpImageServerThread from resources.lib.playnext import PlayNextService +from resources.lib.intro_skipper import IntroSkipperService settings = xbmcaddon.Addon() @@ -88,6 +89,10 @@ if context_menu: context_monitor = ContextMonitor() context_monitor.start() +# Start the skip service monitor +intro_skipper = IntroSkipperService(monitor) +intro_skipper.start() + background_interval = int(settings.getSetting('background_interval')) newcontent_interval = int(settings.getSetting('new_content_check_interval')) random_movie_list_interval = int(settings.getSetting('random_movie_refresh_interval')) @@ -189,6 +194,9 @@ if play_next_service: if context_monitor: context_monitor.stop_monitor() +if intro_skipper: + intro_skipper.stop_service() + # clear user and token when logging off home_window.clear_property("user_name") home_window.clear_property("AccessToken") From 5015a3b900b206a1478f683928667793b1a32d89 Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:56:07 -0400 Subject: [PATCH 06/17] Update widgets.py From 5cfef6c6c01364299f679a044699fc7a3e1361dc Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:56:31 -0400 Subject: [PATCH 07/17] Update menu_functions.py --- resources/lib/menu_functions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index 15b4ee1..d776812 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -1353,6 +1353,7 @@ def show_widgets(): 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_movies') add_menu_directory_item(translate_string(30403) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=movie_recommendations') +- add_menu_directory_item(translate_string(30287) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_tvshows') add_menu_directory_item(translate_string(30455) + item_limit_text, From 50be0c9bded3d5a04fe40656bfeb9eab0fff860d Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:57:13 -0400 Subject: [PATCH 08/17] Update strings.po --- .../resource.language.en_gb/strings.po | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index c8627eb..fe2a720 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1160,51 +1160,3 @@ msgstr " - Totally Unwatched" msgctxt "#30455" msgid "TV Shows - Random" msgstr "TV Shows - Random" - -msgctxt "#30666" -msgid "Segment Skipper" -msgstr "Segment Skipper" - -msgctxt "#30667" -msgid "Action to take" -msgstr "Action to take" - -msgctxt "#30668" -msgid "Start Offset (seconds)" -msgstr "Start Offset (seconds)" - -msgctxt "#30669" -msgid "End Offset (seconds)" -msgstr "End Offset (seconds)" - -msgctxt "#30670" -msgid "Intro Skipper" -msgstr "Intro Skipper" - -msgctxt "#30671" -msgid "Credit Skipper" -msgstr "Credit Skipper" - -msgctxt "#30672" -msgid "Skip" -msgstr "Skip" - -msgctxt "#30673" -msgid "Ask" -msgstr "Ask" - -msgctxt "#30674" -msgid "Do Nothing" -msgstr "Do Nothing" - -msgctxt "#30675" -msgid "Commercial Skipper" -msgstr "Commercial Skipper" - -msgctxt "#30676" -msgid "Preview Skipper" -msgstr "Preview Skipper" - -msgctxt "#30677" -msgid "Recap Skipper" -msgstr "Recap Skipper" From 2a191a310e55596972bd6cf52a9d369dea38ccbb Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 18:59:12 -0400 Subject: [PATCH 09/17] Update strings.po --- .../resource.language.en_gb/strings.po | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index fe2a720..c8627eb 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1160,3 +1160,51 @@ msgstr " - Totally Unwatched" msgctxt "#30455" msgid "TV Shows - Random" msgstr "TV Shows - Random" + +msgctxt "#30666" +msgid "Segment Skipper" +msgstr "Segment Skipper" + +msgctxt "#30667" +msgid "Action to take" +msgstr "Action to take" + +msgctxt "#30668" +msgid "Start Offset (seconds)" +msgstr "Start Offset (seconds)" + +msgctxt "#30669" +msgid "End Offset (seconds)" +msgstr "End Offset (seconds)" + +msgctxt "#30670" +msgid "Intro Skipper" +msgstr "Intro Skipper" + +msgctxt "#30671" +msgid "Credit Skipper" +msgstr "Credit Skipper" + +msgctxt "#30672" +msgid "Skip" +msgstr "Skip" + +msgctxt "#30673" +msgid "Ask" +msgstr "Ask" + +msgctxt "#30674" +msgid "Do Nothing" +msgstr "Do Nothing" + +msgctxt "#30675" +msgid "Commercial Skipper" +msgstr "Commercial Skipper" + +msgctxt "#30676" +msgid "Preview Skipper" +msgstr "Preview Skipper" + +msgctxt "#30677" +msgid "Recap Skipper" +msgstr "Recap Skipper" From a09379f47b54c15b07877acfb716e81bc6540c01 Mon Sep 17 00:00:00 2001 From: Aydanill <49328173+Aydanill@users.noreply.github.com> Date: Thu, 12 Jun 2025 19:01:00 -0400 Subject: [PATCH 10/17] Update menu_functions.py --- resources/lib/menu_functions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index d776812..15b4ee1 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -1353,7 +1353,6 @@ def show_widgets(): 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_movies') add_menu_directory_item(translate_string(30403) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=movie_recommendations') -- add_menu_directory_item(translate_string(30287) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_tvshows') add_menu_directory_item(translate_string(30455) + item_limit_text, From b5c9ecdf5c3998ba6ed1cef71d3f67b1d61076e5 Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:16:01 -0400 Subject: [PATCH 11/17] updated widgets.py --- resources/lib/widgets.py | 101 ++++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 17 deletions(-) diff --git a/resources/lib/widgets.py b/resources/lib/widgets.py index 29067f6..e926953 100644 --- a/resources/lib/widgets.py +++ b/resources/lib/widgets.py @@ -76,41 +76,76 @@ def set_random_tvshows(): hide_watched = settings.getSetting("hide_watched") == "true" user_id = get_current_user_id() - url_params = { - "Recursive": True, - "limit": item_limit, - "SortBy": "Random", - "IncludeItemTypes": "Series", - "ImageTypeLimit": 0 - } - + url_params = {} + url_params["Recursive"] = True, + url_params["limit"] = item_limit, if hide_watched: url_params["IsPlayed"] = False + url_params["SortBy"] = "Random", + url_params["IncludeItemTypes"] = "Series", + url_params["ImageTypeLimit"] = 0 url = get_jellyfin_url("/Users/{}/Items".format(user_id), url_params) results = api.get(url) random_tvshows_list = [] - if results: - for item in results.get("Items", []): + if results is not none: + items = results.get(item.get("Id")) + for item in items: random_tvshows_list.append(item.get("Id")) random.shuffle(random_tvshows_list) tvshow_list_string = ",".join(random_tvshows_list) - + home_window = HomeWindow() m = hashlib.md5() m.update(tvshow_list_string.encode()) new_widget_hash = m.hexdigest() - log.debug("set_random_tvshows: {}".format(tvshow_list_string)) - log.debug("set_random_tvshows Hash: {}".format(new_widget_hash)) + log.debug("set_random_tvshows: {0}".format(tvshow_list_string)) + log.debug("set_random_tvshows: {0}".format(new_widget_hash)) - home_window = HomeWindow() home_window.set_property("random-tvshows", tvshow_list_string) home_window.set_property("random-tvshows-changed", new_widget_hash) - log.debug("set_random_tvshows: {0}".format(tvshow_list_string)) - log.debug("set_random_tvshows Hash: {0}".format(new_widget_hash)) +@timer +def set_random_all(): + log.debug("set_random_all Called") + + settings = xbmcaddon.Addon() + item_limit = settings.getSetting("show_x_filtered_items") + hide_watched = settings.getSetting("hide_watched") == "true" + user_id = get_current_user_id() + + url_params = {} + url_params["Recursive"] = True + url_params["limit"] = item_limit + if hide_watched: + url_params["IsPlayed"] = False + url_params["SortBy"] = "Random" + url_params["IncludeItemTypes"] = "Movie,Series" + url_params["ImageTypeLimit"] = 0 + + url = get_jellyfin_url("/Users/{}/Items".format(user_id), url_params) + + results = api.get(url) + + random_items = [] + if results is not None: + items = results.get("Items", []) + for item in items: + random_items.append(item.get("Id")) + + random.shuffle(random_items) + item_list_string = ",".join(random_items) + home_window = HomeWindow() + m = hashlib.md5() + m.update(item_list_string.encode()) + new_widget_hash = m.hexdigest() + + log.debug("set_random_all: {0}".format(item_list_string)) + log.debug("set_random_all: {0}".format(new_widget_hash)) + home_window.set_property("random-all", item_list_string) + home_window.set_property("random-all-changed", new_widget_hash) def set_background_image(force=False): log.debug("set_background_image Called forced={0}".format(force)) @@ -382,7 +417,6 @@ def get_widget_content(handle, params): xbmcplugin.setContent(handle, 'tvshows') url_params["Ids"] = home_window.get_property("random-tvshows") - elif widget_type == "recent_tvshows": xbmcplugin.setContent(handle, 'episodes') url_verb = '/Users/{}/Items/Latest'.format(user_id) @@ -486,6 +520,39 @@ def get_widget_content(handle, params): log.debug("Recommended Items : {0}".format(len(ids))) url_params["Ids"] = id_list + elif widget_type == "random_all": + home_window = HomeWindow() + xbmcplugin.setContent(handle, 'movies') + url_params["Ids"] = home_window.get_property("random-all") + + elif widget_type == "recent_all": + xbmcplugin.setContent(handle, 'movies') + url_verb = '/Users/{}/Items/Latest'.format(user_id) + url_params["GroupItems"] = True + url_params["Recursive"] = True + url_params["SortBy"] = "DateCreated" + url_params["SortOrder"] = "Descending" + url_params["Limit"] = 45 + url_params["Filters"] = "IsNotFolder" + url_params["Fields"] = get_default_filters() + if hide_watched: + url_params["IsPlayed"] = False + url_params["IsVirtualUnaired"] = False + url_params["IncludeItemTypes"] = "Episode, Movie" + url_params["ImageTypeLimit"] = 1 + + elif widget_type == "favorites_all": + home_window = HomeWindow() + xbmcplugin.setContent(handle, 'movies') + + url_params.update({ + "Filters": "IsFavorite", + "IncludeItemTypes": "Movie,Series", + "Recursive": True, + "SortBy": "Name", + "SortOrder": "Ascending", + }) + items_url = get_jellyfin_url(url_verb, url_params) if (url_params.get('IncludeItemTypes', '') == 'Episode' or From 3d30fcfc3e7a7c0bdf5ea38d6ad114a770c9b98d Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:25:06 -0400 Subject: [PATCH 12/17] updated service.py --- service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service.py b/service.py index 4184755..73e6ce9 100644 --- a/service.py +++ b/service.py @@ -11,7 +11,7 @@ import xbmcgui from resources.lib.lazylogger import LazyLogger from resources.lib.play_utils import Service, PlaybackService, send_progress from resources.lib.kodi_utils import HomeWindow -from resources.lib.widgets import set_background_image, set_random_movies, set_random_tvshows +from resources.lib.widgets import set_background_image, set_random_movies, set_random_tvshows, set_random_all from resources.lib.websocket_client import WebSocketClient from resources.lib.menu_functions import set_library_window_values from resources.lib.server_detect import check_server, check_connection_speed @@ -65,6 +65,7 @@ last_content_check = time.time() last_background_update = 0 last_random_movie_update = 0 last_random_tvshow_update = 0 +last_random_all_update = 0 # start the library update monitor library_change_monitor = LibraryChangeMonitor() @@ -151,6 +152,10 @@ while home_window.get_property('exit') == 'False': last_random_tvshow_update = time.time() set_random_tvshows() + if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_all_update) > random_movie_list_interval): + last_random_all_update = time.time() + set_random_all() + if user_changed or (newcontent_interval != 0 and (time.time() - last_content_check) > newcontent_interval): last_content_check = time.time() library_change_monitor.check_for_updates() From bc125bb0a3cb3217e21719feab0cdb8c521f23e3 Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:29:02 -0400 Subject: [PATCH 13/17] updated menu_functions.py --- resources/lib/menu_functions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index 15b4ee1..a868fee 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -1363,6 +1363,12 @@ def show_widgets(): 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=inprogress_episodes') add_menu_directory_item(translate_string(30265) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=nextup_episodes') + add_menu_directory_item(translate_string(30457) + item_limit_text, + 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_all') + add_menu_directory_item(translate_string(30458), + 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=favorites_all') + add_menu_directory_item(translate_string(30456) + item_limit_text, + 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_all') xbmcplugin.endOfDirectory(int(sys.argv[1])) From bb1284deff16d7f635cdcfdf85e7129b88e3a3bf Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:30:52 -0400 Subject: [PATCH 14/17] updated strings.po --- .../language/resource.language.en_gb/strings.po | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index c8627eb..843c161 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1161,6 +1161,18 @@ msgctxt "#30455" msgid "TV Shows - Random" msgstr "TV Shows - Random" +msgctxt "#30456" +msgid "All - Random" +msgstr "All - Random" + +msgctxt "#30457" +msgid "All - Recently Added" +msgstr "All - Recently Added" + +msgctxt "#30458" +msgid "All - Favorites" +msgstr "All - Favorites" + msgctxt "#30666" msgid "Segment Skipper" msgstr "Segment Skipper" From b6b19f5a2380375e12553ae152a740914d03f50a Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:36:07 -0400 Subject: [PATCH 15/17] consistant menu_functions.py --- resources/lib/menu_functions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index a868fee..087476d 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -1353,6 +1353,7 @@ def show_widgets(): 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=random_movies') add_menu_directory_item(translate_string(30403) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=movie_recommendations') + add_menu_directory_item(translate_string(30287) + item_limit_text, 'plugin://plugin.video.jellycon/?mode=WIDGET_CONTENT&type=recent_tvshows') add_menu_directory_item(translate_string(30455) + item_limit_text, From 3572dcc5556bd0995359778c8f3256088eca5a30 Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:40:41 -0400 Subject: [PATCH 16/17] consistant service.py --- service.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/service.py b/service.py index 73e6ce9..582585d 100644 --- a/service.py +++ b/service.py @@ -111,7 +111,6 @@ first_run = True home_window.set_property('exit', 'False') while home_window.get_property('exit') == 'False': - try: if xbmc.Player().isPlaying(): last_random_movie_update = time.time() - (random_movie_list_interval - 15) @@ -145,12 +144,12 @@ while home_window.get_property('exit') == 'False': settings.setSetting("server_speed_check_data", server_host + "-skipped") if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_movie_update) > random_movie_list_interval): - last_random_movie_update = time.time() - set_random_movies() + last_random_movie_update = time.time() + set_random_movies() if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_tvshow_update) > random_movie_list_interval): - last_random_tvshow_update = time.time() - set_random_tvshows() + last_random_tvshow_update = time.time() + set_random_tvshows() if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_all_update) > random_movie_list_interval): last_random_all_update = time.time() From 96d837732b3c4a9c199518dc48c38b1c6da73897 Mon Sep 17 00:00:00 2001 From: Sofyill <49328173+Aydanill@users.noreply.github.com> Date: Fri, 13 Jun 2025 21:26:33 -0400 Subject: [PATCH 17/17] hidden cherecter fix --- resources/lib/widgets.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/resources/lib/widgets.py b/resources/lib/widgets.py index e926953..b0aa1b4 100644 --- a/resources/lib/widgets.py +++ b/resources/lib/widgets.py @@ -77,20 +77,21 @@ def set_random_tvshows(): user_id = get_current_user_id() url_params = {} - url_params["Recursive"] = True, - url_params["limit"] = item_limit, + url_params["Recursive"] = True + url_params["limit"] = item_limit if hide_watched: - url_params["IsPlayed"] = False - url_params["SortBy"] = "Random", - url_params["IncludeItemTypes"] = "Series", + url_params["IsPlayed"] = False + url_params["SortBy"] = "Random" + url_params["IncludeItemTypes"] = "Series" url_params["ImageTypeLimit"] = 0 url = get_jellyfin_url("/Users/{}/Items".format(user_id), url_params) + results = api.get(url) random_tvshows_list = [] - if results is not none: - items = results.get(item.get("Id")) + if results is not None: + items = results.get("Items", []) for item in items: random_tvshows_list.append(item.get("Id")) @@ -103,7 +104,6 @@ def set_random_tvshows(): log.debug("set_random_tvshows: {0}".format(tvshow_list_string)) log.debug("set_random_tvshows: {0}".format(new_widget_hash)) - home_window.set_property("random-tvshows", tvshow_list_string) home_window.set_property("random-tvshows-changed", new_widget_hash) @@ -481,6 +481,8 @@ def get_widget_content(handle, params): inprogress_url_params["IncludeItemTypes"] = "Episode" inprogress_url_params["Limit"] = item_limit + + elif widget_type == "movie_recommendations": suggested_items_url_params = {} suggested_items_url_params["userId"] = user_id