diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 164cf03..0c1db11 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -350,6 +350,10 @@ msgctxt "#30254" msgid "Show Settings" msgstr "" +msgctxt "#30255" +msgid "TV Show (A-Z)" +msgstr "" + msgctxt "#30256" msgid "Movies - All" msgstr "" @@ -390,6 +394,10 @@ msgctxt "#30265" msgid "Episodes - Next Up" msgstr "" +msgctxt "#30266" +msgid "Movie (Pages)" +msgstr "" + msgctxt "#30267" msgid " - In Progress" msgstr "" diff --git a/resources/lib/functions.py b/resources/lib/functions.py index 6d11cee..3a3bd21 100644 --- a/resources/lib/functions.py +++ b/resources/lib/functions.py @@ -26,7 +26,7 @@ from .clientinfo import ClientInformation from .datamanager import DataManager from .server_detect import checkServer from .simple_logging import SimpleLogging -from .menu_functions import displaySections, showMovieAlphaList, showGenreList, showWidgets, show_search, showMoviePages +from .menu_functions import displaySections, showMovieAlphaList, showTvShowAlphaList, showGenreList, showWidgets, show_search, showMoviePages from .translation import string_load from .server_sessions import showServerSessions from .action_menu import ActionMenu @@ -106,6 +106,8 @@ def mainEntryPoint(): playTrailer(item_id) elif mode == "MOVIE_ALPHA": showMovieAlphaList() + elif mode == "TVSHOW_ALPHA": + showTvShowAlphaList() elif mode == "GENRES": showGenreList(params) elif mode == "MOVIE_PAGES": diff --git a/resources/lib/menu_functions.py b/resources/lib/menu_functions.py index 1df434d..723a138 100644 --- a/resources/lib/menu_functions.py +++ b/resources/lib/menu_functions.py @@ -224,6 +224,57 @@ def showMovieAlphaList(): xbmcplugin.endOfDirectory(int(sys.argv[1])) +def showTvShowAlphaList(): + log.debug("== ENTER: showTvShowAlphaList() ==") + + settings = xbmcaddon.Addon() + server = downloadUtils.getServer() + if server is None: + return + + collections = [] + + item_data = {} + item_data['title'] = "#" + item_data['media_type'] = "tvshows" + item_data['path'] = ('{server}/emby/Users/{userid}/Items' + + '?Fields={field_filters}' + + '&Recursive=true' + + '&NameLessThan=A' + + '&IncludeItemTypes=Series' + + '&ImageTypeLimit=1' + + '&SortBy=Name' + + '&SortOrder=Ascending' + + '&format=json') + collections.append(item_data) + + group_movies = settings.getSetting('group_movies') == "true" + alphaList = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "Y", "Z"] + + for alphaName in alphaList: + item_data = {} + item_data['title'] = alphaName + item_data['media_type'] = "tvshows" + item_data['path'] = ('{server}/emby/Users/{userid}/Items' + + '?Fields={field_filters}' + + '&Recursive=true' + + '&NameStartsWith=' + alphaName + + '&IncludeItemTypes=Series' + + '&ImageTypeLimit=1' + + '&SortBy=Name' + + '&SortOrder=Ascending' + + '&format=json') + collections.append(item_data) + + for collection in collections: + url = (sys.argv[0] + "?url=" + urllib.quote(collection['path']) + + "&mode=GET_CONTENT&media_type=" + collection["media_type"]) + log.debug("addMenuDirectoryItem: {0} ({1})", collection.get('title'), url) + addMenuDirectoryItem(collection.get('title', string_load(30250)), url) + + xbmcplugin.endOfDirectory(int(sys.argv[1])) + + def displaySections(): log.debug("== ENTER: displaySections() ==") xbmcplugin.setContent(int(sys.argv[1]), 'files') @@ -256,9 +307,11 @@ def displaySections(): addMenuDirectoryItem(string_load(30251), "plugin://plugin.video.embycon/?mode=GENRES&item_type=movie") addMenuDirectoryItem(string_load(30252), "plugin://plugin.video.embycon/?mode=MOVIE_ALPHA") - addMenuDirectoryItem("Movie (Pages)", "plugin://plugin.video.embycon/?mode=MOVIE_PAGES") + addMenuDirectoryItem(string_load(30266), "plugin://plugin.video.embycon/?mode=MOVIE_PAGES") addMenuDirectoryItem(string_load(30289), "plugin://plugin.video.embycon/?mode=GENRES&item_type=tvshow") + addMenuDirectoryItem(string_load(30255), "plugin://plugin.video.embycon/?mode=TVSHOW_ALPHA") + addMenuDirectoryItem(string_load(30246), "plugin://plugin.video.embycon/?mode=SEARCH") addMenuDirectoryItem(string_load(30017), "plugin://plugin.video.embycon/?mode=SHOW_SERVER_SESSIONS") @@ -978,7 +1031,6 @@ def getCollections(): item_data = {} item_data['title'] = string_load(30350) + " (" + show_x_filtered_items + ")" - item_data['art'] = art item_data['media_type'] = 'MusicAlbums' item_data['path'] = ('{server}/emby/Users/{userid}/Items/Latest' + '?IncludeItemTypes=Audio' + @@ -992,7 +1044,6 @@ def getCollections(): item_data = {} item_data['title'] = string_load(30351) + " (" + show_x_filtered_items + ")" - item_data['art'] = art item_data['media_type'] = 'MusicAlbum' item_data['path'] = ('{server}/emby/Users/{userid}/Items' + '?SortBy=DatePlayed' + @@ -1008,7 +1059,6 @@ def getCollections(): item_data = {} item_data['title'] = string_load(30352) + " (" + show_x_filtered_items + ")" - item_data['art'] = art item_data['media_type'] = 'MusicAlbum' item_data['path'] = ('{server}/emby/Users/{userid}/Items' + '?SortBy=PlayCount' +