Skip to content

Commit

Permalink
https://github.com/bigretromike/nakamori/issues/471
Browse files Browse the repository at this point in the history
  • Loading branch information
bigretromike committed Nov 7, 2021
1 parent 7ec822c commit d24eb4b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.nakamori" name="Nakamori" version="4.0.0-b12" provider-name="BigRetroMike, SteveMavic, da3dsoul">
<addon id="plugin.video.nakamori" name="Nakamori" version="4.0.0-b13" provider-name="BigRetroMike, SteveMavic, da3dsoul">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.routing" version="0.2.3"/>
Expand Down
27 changes: 15 additions & 12 deletions models/kodi_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,23 +548,23 @@ def set_info_for_episode(li: ListItem, x: api2models.Episode, series_title: str)
if ep_type == ThisType.episodes:
pass
elif ep_type == ThisType.specials:
title = 's' + title
sort_title = 's' + sort_title
title = 'S' + title
sort_title = 'S' + sort_title
elif ep_type == ThisType.credits:
title = 'c' + title
sort_title = 'c' + sort_title
title = 'C' + title
sort_title = 'C' + sort_title
elif ep_type == ThisType.parodies:
title = 'p' + title
sort_title = 'p' + sort_title
title = 'P' + title
sort_title = 'P' + sort_title
elif ep_type == ThisType.trailers:
title = 't' + title
sort_title = 't' + sort_title
title = 'T' + title
sort_title = 'T' + sort_title
elif ep_type == ThisType.ova:
title = 'o' + title
sort_title = 'o' + sort_title
title = 'O' + title
sort_title = 'O' + sort_title
elif ep_type == ThisType.webclips:
title = 'w' + title
sort_title = 'w' + sort_title
title = 'W' + title
sort_title = 'W' + sort_title
else:
title = '*' + title
sort_title = '*' + sort_title
Expand Down Expand Up @@ -1079,6 +1079,9 @@ def set_sorting_method(x: ThisType):
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_DATE)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_VIDEO_RATING)
elif x == ThisType.tvepisodes:
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_TITLE)
else:
xbmcplugin.addSortMethod(plugin.handle, xbmcplugin.SORT_METHOD_NONE)

Expand Down
6 changes: 4 additions & 2 deletions nakamoriplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ def open_group_by_group_id_and_filter_id(filter_id: int, group_id: int):

@plugin.route('/f-<filter_id>/s-<series_id>')
def open_series_by_series_id_and_filter_id(filter_id: int, series_id: int):
kodi_models.set_content('episodes')
kodi_models.set_sorting_method(ThisType.episodes)
list_of_ep_types = []
list_of_eps = []

Expand All @@ -129,10 +127,14 @@ def open_series_by_series_id_and_filter_id(filter_id: int, series_id: int):
list_items_to_add = []
if len(list_of_ep_types) > 1 and do_we_want_to_make_eptype_setting:
kodi_models.set_content('seasons')
kodi_models.set_sorting_method(ThisType.tvepisodes)
for ep_type in list_of_ep_types:
li = kodi_models.get_listitem_from_episodetype(ep_type, s.art)
addDirectoryItem(plugin.handle, plugin.url_for(open_eptype_by_eptype_by_series_id_and_filter_id, filter_id, series_id, int(ep_type)), li, True, totalItems=len(list_of_ep_types))
else:
kodi_models.set_content('episodes')
kodi_models.set_sorting_method(ThisType.episodes)

con = kodi_models.add_continue_item(series=s, episode_type=list_of_ep_types[0])

_index = 0 if con is None else 1
Expand Down

0 comments on commit d24eb4b

Please sign in to comment.