Skip to content

Commit

Permalink
Add settings and library maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Mar 2, 2021
1 parent b00fa33 commit 699f85a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
36 changes: 36 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
36 changes: 36 additions & 0 deletions resources/language/resource.language.nl_nl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 21 additions & 1 deletion resources/lib/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
Expand Down
10 changes: 10 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@
<setting label="30834" type="bool" id="vrtnxt" default="true"/> <!-- VRT NXT -->
<setting label="30835" type="bool" id="de-warmste-week" default="false"/> <!-- De Warmste Week -->
</category>
<category label="30840"> <!-- Kodi Library -->
<setting label="30841" type="lsep"/> <!-- Indexing -->
<setting label="30843" type="action" action="RunPlugin(plugin://plugin.video.vrt.nu/library/configure)" option="close"/>
<setting label="30845" type="bool" id="library_include_docu" default="true"/>
<setting label="30847" type="bool" id="library_include_music" default="true"/>
<setting label="30849" type="bool" id="library_use_favorites" default="true"/>
<setting label="30851" type="lsep"/> <!-- Maintenance -->
<setting label="30853" type="action" action="RunPlugin(plugin://plugin.video.vrt.nu/library/update)"/>
<setting label="30855" type="action" action="RunPlugin(plugin://plugin.video.vrt.nu/library/clean)"/>
</category>
<category label="30860"> <!--Integration -->
<setting label="30861" type="lsep"/> <!-- Integration with other add-ons -->
<!-- YouTube -->
Expand Down

0 comments on commit 699f85a

Please sign in to comment.