From 6cf137eaf0418409a8d1b419d0ebf2890137edba Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 3 Mar 2024 22:29:22 +0000 Subject: [PATCH] Fix menu Shows/"Next Episode Cards" --- CHANGES.md | 7 +++++- .../interfaces/default/home_browseShows.tmpl | 3 ++- gui/slick/interfaces/default/inc_top.tmpl | 2 +- sickgear/webserve.py | 24 +++++++++++-------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bf05bece..3debf425 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 3.30.11 (2024-02-29 01:20:00 UTC) +### 3.30.12 (2024-03-03 22:30:00 UTC) + +* Fix menu Shows/"Next Episode Cards" + + +### 3.30.11 (2024-02-29 01:20:00 UTC) * Update UnRar x64 for Windows 6.24 to 7.00 diff --git a/gui/slick/interfaces/default/home_browseShows.tmpl b/gui/slick/interfaces/default/home_browseShows.tmpl index e3b02f74..5429bdb2 100644 --- a/gui/slick/interfaces/default/home_browseShows.tmpl +++ b/gui/slick/interfaces/default/home_browseShows.tmpl @@ -450,7 +450,8 @@ $(document).ready(function(){ - + + diff --git a/gui/slick/interfaces/default/inc_top.tmpl b/gui/slick/interfaces/default/inc_top.tmpl index 2853a85d..91a2f9dd 100644 --- a/gui/slick/interfaces/default/inc_top.tmpl +++ b/gui/slick/interfaces/default/inc_top.tmpl @@ -208,7 +208,7 @@ #set $tvc_mode = $tvc_modes.get($sg_var('TVC_MRU'), 'new shows')
  • TV Calendar Cards
  • -#set $ne_modes = dict(ne_newpop='new popular', ne_newtop='new top rated', ne_upcoming='upcoming', ne_trending='trending') +#set $ne_modes = dict(ne_newpop='new popular', ne_newtop='new top rated', ne_upcoming='upcoming S01', ne_upcoming2='upcoming s02', ne_trending='trending') #set $ne_mode = $ne_modes.get($sg_var('NE_MRU'), 'new popular')
  • Next Episode Cards
  • diff --git a/sickgear/webserve.py b/sickgear/webserve.py index 361b1660..bcffd2e3 100644 --- a/sickgear/webserve.py +++ b/sickgear/webserve.py @@ -5149,19 +5149,23 @@ class AddShows(Home): def ne_newpop(self, **kwargs): return self.browse_ne( - 'hotshowsfilter', 'Popular recent premiered at Next Episode', mode='newpop', **kwargs) + 'hot', 'Popular recent premiered at Next Episode', mode='newpop', **kwargs) def ne_newtop(self, **kwargs): return self.browse_ne( - 'hotshowsfilter', 'Top rated recent premiered at Next Episode', mode='newtop', **kwargs) + 'hot', 'Top rated recent premiered at Next Episode', mode='newtop', **kwargs) def ne_upcoming(self, **kwargs): return self.browse_ne( - 'upcomingshowsfilter', 'Upcoming at Next Episode', mode='upcoming', **kwargs) + 'upcoming', 'Upcoming Season 1 at Next Episode', mode='upcoming', **kwargs) + + def ne_upcoming2(self, **kwargs): + return self.browse_ne( + 'upcoming2', 'Upcoming Season 2 at Next Episode', mode='upcoming2', **kwargs) def ne_trending(self, **kwargs): return self.browse_ne( - 'trendingshowsfilter', 'Trending at Next Episode', mode='trending', **kwargs) + 'trends', 'Trending at Next Episode', mode='trending', **kwargs) def browse_ne(self, url_path, browse_title, **kwargs): @@ -5181,17 +5185,17 @@ class AddShows(Home): started_past = True if 'upcoming' in url_path: started_past = False - url = '%s.php?t=1&s=1&inwl=0&user_id=' % url_path + params = f'premiering_period={("1", "2")["2" in url_path]}&sort=2' + url_path = 'upcoming' elif 'trending' in url_path: - url = '%s.php?t=1&a=1&b=1&uid=&status=0&c=1' % url_path + params = 'trending_within=2' else: - url = '%s.php?a=1&b=1&uid=0&status=0&c=2&sortOrder=%s' % (url_path, (0, 1)['Top' in browse_title]) - url = 'https://next-episode.net/PAGES/misc/%s&g=6&channel=0&actors=0&page=%s' % (url, page) - + params = f'chart_type={("most_popular", "top_rated")["Top" in browse_title]}&premiered_within=2' + url = f'https://next-episode.net/{url_path}/?{params}&page={page}' html = helpers.get_url(url, headers={'User-Agent': browser_ua.get_ua()}) if html: try: - if re.findall(r'(?i)(]+gopage\([^>]+)', html)[0]: + if re.findall(r'(?i)id="paginationDiv"', html)[0]: kwargs.update(dict(more=1)) except (BaseException, Exception): pass