From a342ff03191c7cb2391eb62a2960a7374daca3e0 Mon Sep 17 00:00:00 2001 From: mrplow <1490165+mrplow@users.noreply.github.com> Date: Tue, 3 Mar 2026 19:53:38 -0800 Subject: [PATCH] Add option to hide results not found in library --- addon.xml | 3 ++- main.py | 14 +++++++++++--- .../language/resource.language.en_gb/strings.po | 8 ++++++++ resources/settings.xml | 7 +++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/addon.xml b/addon.xml index 0a89d75..1dcc1f3 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,6 +19,7 @@ resources/images/icon.png resources/images/screenshot.jpg + 0.1.13 add option to hide movies not found in local library 0.1.12 add local lists, add genre to movies not found in the library diff --git a/main.py b/main.py index 9f84454..9bd1b17 100644 --- a/main.py +++ b/main.py @@ -256,6 +256,9 @@ def list_movies(movie_list): movies = movie_list["movies"] ordered_by = movie_list["ordered_by"] + # Read the "hide not in library" setting once for the whole list + hide_not_in_library = Addon().getSettingBool('hide_not_in_library') + # Set subtitle xbmcplugin.setPluginCategory(HANDLE, movie_list['title']) # Set plugin content @@ -275,6 +278,14 @@ def list_movies(movie_list): # Iterate through movies. for index, movie in enumerate(movies): + + #try to find the movie in the local database using the tmdb index + local_id = tmdb_index.get(str(movie['id'])) + + # Skip movies not in the local library if the setting is enabled + if local_id is None and hide_not_in_library: + continue + # Create a list item with a text label if ordered_by == "rank": movie_label = str(index+1) + " - " + movie['title'] @@ -300,9 +311,6 @@ def list_movies(movie_list): genres.append(GENRES.get(genre_id, "Unknown")) info_tag.setGenres(genres) info_tag.setPlot(movie['overview']) - - #try to find the movie in the local database using the tmdb index - local_id = tmdb_index.get(str(movie['id'])) #if found, make it playable if local_id != None : diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index a802a35..0752c61 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -30,10 +30,18 @@ msgctxt "#30002" msgid "Server url" msgstr "" +msgctxt "#30010" +msgid "Options" +msgstr "" + msgctxt "#30050" msgid "Use local lists" msgstr "" +msgctxt "#30060" +msgid "Hide movies not in library" +msgstr "" + # Category Integrations msgctxt "#30100" msgid "Integrations" diff --git a/resources/settings.xml b/resources/settings.xml index b0cd6fa..6b28268 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -22,6 +22,13 @@ + + + 0 + false + + +