Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add simple mode for less menus #287

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ msgctxt "#30224"
msgid "Interaction"
msgstr "Interaction"

msgctxt "#30225"
msgid "Interface Mode"
msgstr "Interface Mode"

msgctxt "#30226"
msgid "Default"
msgstr "Default"

msgctxt "#30227"
msgid "Simple"
msgstr "Simple"

msgctxt "#30229"
msgid "TV Shows"
msgstr "TV Shows"
Expand Down
25 changes: 25 additions & 0 deletions resources/lib/menu_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from six import ensure_binary, ensure_text
from six.moves.urllib.parse import quote

from .dir_functions import get_content
from .jellyfin import api
from .kodi_utils import add_menu_directory_item, HomeWindow
from .lazylogger import LazyLogger
Expand Down Expand Up @@ -573,6 +574,10 @@ def display_main_menu():
handle = int(sys.argv[1])
xbmcplugin.setContent(handle, 'files')

if settings.getSetting("interface_mode") == "1":
display_library_views(None)
return

add_menu_directory_item(translate_string(30406),
"plugin://plugin.video.jellycon/?mode=SHOW_ADDON_MENU&type=library")
add_menu_directory_item(translate_string(30407),
Expand Down Expand Up @@ -709,6 +714,11 @@ def display_tvshow_type(menu_params, view):
if view is not None:
base_params["ParentId"] = view.get("Id")
path = get_jellyfin_url("/Users/{userid}/Items", base_params)

if settings.getSetting("interface_mode") == "1":
get_content(path, { "media_type": "tvshows" })
return

url = sys.argv[0] + "?url=" + quote(path) + "&mode=GET_CONTENT&media_type=tvshows"
add_menu_directory_item(view_name + translate_string(30405), url)

Expand Down Expand Up @@ -808,6 +818,11 @@ def display_music_type(menu_params, view):
"IncludeItemTypes": "MusicAlbum"
}
path = get_jellyfin_url("/Users/{userid}/Items", params)

if settings.getSetting("interface_mode") == "1":
get_content(path, { "media_type": "MusicAlbums" })
return

url = sys.argv[0] + "?url=" + quote(path) + "&mode=GET_CONTENT&media_type=MusicAlbums"
add_menu_directory_item(view_name + translate_string(30320), url)

Expand Down Expand Up @@ -976,6 +991,11 @@ def display_movies_type(menu_params, view):

# All Movies
path = get_jellyfin_url("/Users/{userid}/Items", base_params)

if settings.getSetting("interface_mode") == "1":
get_content(path, { "media_type": "movies" })
return

url = sys.argv[0] + "?url=" + quote(path) + "&mode=GET_CONTENT&media_type=movies"
add_menu_directory_item('{}{}'.format(view_name, translate_string(30405)), url)

Expand Down Expand Up @@ -1113,6 +1133,11 @@ def display_mixed_type(params, view):
if view is not None:
base_params["ParentId"] = view.get("Id")
path = get_jellyfin_url("/Users/{userid}/Items", base_params)

if settings.getSetting("interface_mode") == "1":
get_content(path, { "media_type": "mixed" })
return

url = sys.argv[0] + "?url=" + quote(path) + "&mode=GET_CONTENT&media_type=mixed"
add_menu_directory_item(view_name + translate_string(30405), url)

Expand Down
3 changes: 2 additions & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<setting label="30388" type="lsep"/>
<setting label="30011" type="action" action="RunScript(plugin.video.jellycon,0,?mode=DETECT_SERVER_USER)" option="close"/>
<setting id="ipaddress" type="text" label="30000" default="" visible="false" enable="false" />
<setting id="protocol" type="select" label="30390" lvalues="30391|30392" default="0" visible="false"/>
<setting id="protocol" type="select" label="30390" lvalues="30391|30392" default="0" visible="false"/>
<setting id="port" type="text" label="30001" default="8096" visible="false" enable="false" />
<setting id="server_address" type="text" label="30000" default="" visible="true" enable="true" />
<setting id="verify_cert" type="bool" label="30003" default="true" visible="true" enable="true" />
Expand Down Expand Up @@ -103,6 +103,7 @@
<setting label="30224" type="lsep"/>
<setting type="sep" />
<setting id="widget_select_action" type="select" label="30026" lvalues="30313|30314" default="0" visible="true"/>
<setting id="interface_mode" type="select" label="30225" lvalues="30226|30227" default="0" visible="true"/>

</category>
<category label="30111">
Expand Down