From 2a71d7341571d0a4bdf65faba072dda3fe4c223f Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 27 Jan 2021 00:36:41 +0100 Subject: [PATCH] Add settings and library maintenance --- .../resource.language.en_gb/strings.po | 36 +++++++++++++++++++ .../resource.language.nl_nl/strings.po | 36 +++++++++++++++++++ resources/lib/addon.py | 22 +++++++++++- resources/settings.xml | 10 ++++++ 4 files changed, 103 insertions(+), 1 deletion(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index f7045f237..00ccea9bd 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -745,6 +745,42 @@ msgctxt "#30835" msgid "De Warmste Week" msgstr "" +msgctxt "#30840" +msgid "Kodi Library" +msgstr "" + +msgctxt "#30841" +msgid "Indexing" +msgstr "" + +msgctxt "#30843" +msgid "Add video locations to the Kodi Library… [COLOR gray](See README.md)[/COLOR]" +msgstr "" + +msgctxt "#30845" +msgid "Index documentaries also" +msgstr "" + +msgctxt "#30847" +msgid "Index music videos also" +msgstr "" + +msgctxt "#30849" +msgid "Index only TV shows you follow" +msgstr "" + +msgctxt "#30851" +msgid "Maintenance" +msgstr "" + +msgctxt "#30853" +msgid "Refresh Library…" +msgstr "" + +msgctxt "#30855" +msgid "Clean Library…" +msgstr "" + msgctxt "#30860" msgid "Integration" msgstr "" diff --git a/resources/language/resource.language.nl_nl/strings.po b/resources/language/resource.language.nl_nl/strings.po index b56986e0a..01ea8f10c 100644 --- a/resources/language/resource.language.nl_nl/strings.po +++ b/resources/language/resource.language.nl_nl/strings.po @@ -745,6 +745,42 @@ msgctxt "#30835" msgid "De Warmste Week" msgstr "De Warmste Week" +msgctxt "#30840" +msgid "Kodi Library" +msgstr "Kodi-bibliotheek" + +msgctxt "#30841" +msgid "Indexing" +msgstr "Indexeren" + +msgctxt "#30843" +msgid "Add video locations to the Kodi Library… [COLOR gray](See README.md)[/COLOR]" +msgstr "Videolocaties toevoegen aan de Kodi-bibliotheek… [COLOR gray](Zie README.md)[/COLOR]" + +msgctxt "#30845" +msgid "Index documentaries also" +msgstr "Index ook documentaires" + +msgctxt "#30847" +msgid "Index music videos also" +msgstr "Indexeer ook muziek video's" + +msgctxt "#30849" +msgid "Index only TV shows you follow" +msgstr "Indexeer enkel tv-programma's die je volgt" + +msgctxt "#30851" +msgid "Maintenance" +msgstr "Onderhoud" + +msgctxt "#30853" +msgid "Refresh Library…" +msgstr "Verniew bibliotheek…" + +msgctxt "#30855" +msgid "Clean Library…" +msgstr "Bibliotheek opkuisen…" + msgctxt "#30860" msgid "Integration" msgstr "Integratie" diff --git a/resources/lib/addon.py b/resources/lib/addon.py index 8a4e78de0..4cfa93229 100644 --- a/resources/lib/addon.py +++ b/resources/lib/addon.py @@ -10,7 +10,7 @@ except ImportError: # Python 2 from urllib import unquote_plus -from kodiutils import end_of_directory, execute_builtin, get_global_setting, localize, log_access, notification, ok_dialog, refresh_caches +from kodiutils import end_of_directory, execute_builtin, get_global_setting, jsonrpc, localize, log_access, notification, ok_dialog, refresh_caches from utils import from_unicode, to_unicode plugin = Plugin() # pylint: disable=invalid-name @@ -355,6 +355,26 @@ def library_tvshows(program=None): VRTPlayer().show_library_tvshows() +@plugin.route('/library/configure') +def library_configure(): + """Configure the library integration""" + # There seems to be no way to add sources automatically + # → https://forum.kodi.tv/showthread.php?tid=228840 + execute_builtin('ActivateWindow(Videos,sources://video/)') + + +@plugin.route('/library/update') +def library_update(): + """Refresh the library""" + jsonrpc(method='VideoLibrary.Scan') + + +@plugin.route('/library/clean') +def library_clean(): + """Clean the library""" + jsonrpc(method='VideoLibrary.Clean') + + @plugin.route('/update/repos') def update_repos(): """Force an update of the repositories""" diff --git a/resources/settings.xml b/resources/settings.xml index ebb942206..d9af0f363 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -51,6 +51,16 @@ + + + + + + + + + +