From d797d307040df7a42dd1c30643bee40b381e5c24 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sun, 28 May 2023 07:33:41 +0200 Subject: [PATCH 1/2] Fix add show "TheTVDB via Trakt" --- sickgear/webserve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sickgear/webserve.py b/sickgear/webserve.py index 97fe1b3a..f4b0f42b 100644 --- a/sickgear/webserve.py +++ b/sickgear/webserve.py @@ -4227,7 +4227,7 @@ class AddShows(Home): show['ids'][(tvid, TVINFO_TVDB)[TVINFO_TRAKT == tvid]]) + ('', '&lid=%s' % sickgear.TVInfoAPI().config.get('langabbv_to_id', {}).get(lang, lang))[ TVINFO_TVDB == tvid], - int(show['id']), + (int(show['id']), show['ids'][TVINFO_TVDB])[TVINFO_TRAKT == tvid], show['seriesname'], helpers.xhtml_escape(show['seriesname']), show['firstaired'], (isinstance(show['firstaired'], string_types) and show['firstaired'] and SGDatetime.sbfdate(_parse_date(show['firstaired'])) or ''), From 59f83064b9e7daaba46800eabd98020f08c2fa62 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 28 May 2023 07:41:31 +0100 Subject: [PATCH 2/2] Fix find show results returned as newest/oldest that are then sorted z to a. --- CHANGES.md | 8 +++++++- sickgear/webserve.py | 29 +++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8179d407..fc99521f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,10 @@ -### 3.29.1 (2023-05-26 06:10:00 UTC) +### 3.29.2 (2023-05-28 07:45:00 UTC) + +* Fix find show results returned as newest/oldest that are then sorted z to a +* Fix add show "TheTVDB via Trakt" + + +### 3.29.1 (2023-05-26 06:10:00 UTC) * Fix IMDB fetch from TheTVDb API diff --git a/sickgear/webserve.py b/sickgear/webserve.py index f4b0f42b..e18da957 100644 --- a/sickgear/webserve.py +++ b/sickgear/webserve.py @@ -4297,19 +4297,24 @@ class AddShows(Home): return (grouped, combined)[as_combined] - if 'az' == sickgear.RESULTS_SORTBY[:2]: - sort_results = [sort_oldest, sort_newest, sort_rel, sort_za, sort_az] - elif 'za' == sickgear.RESULTS_SORTBY[:2]: - sort_results = [sort_oldest, sort_newest, sort_rel, sort_az, sort_za] - elif 'newest' == sickgear.RESULTS_SORTBY[:6]: - sort_results = [sort_az, sort_rel, sort_oldest, sort_newest] - elif 'oldest' == sickgear.RESULTS_SORTBY[:6]: - sort_results = [sort_az, sort_rel, sort_newest, sort_oldest] - else: - sort_results = [sort_za, sort_az, sort_oldest, sort_newest, sort_rel] + sort_methods = [sort_oldest, sort_newest, sort_za, sort_az, sort_rel] + if re.match('az|za|ne|ol', sickgear.RESULTS_SORTBY[:2]): + if 'az' == sickgear.RESULTS_SORTBY[:2]: + new_default = sort_az + elif 'za' == sickgear.RESULTS_SORTBY[:2]: + new_default = sort_za + elif 'newest' == sickgear.RESULTS_SORTBY[:6]: + new_default = sort_newest + else: # 'oldest' == sickgear.RESULTS_SORTBY[:6]: + new_default = sort_oldest - for n, func in enumerate(sort_results): - final_results = func(final_results, n == len(sort_results) - 1, 'nogroup' == sickgear.RESULTS_SORTBY[-7:]) + sort_methods.remove(new_default) + sort_methods += [new_default] + + idx_last_sort = len(sort_methods) - 1 + sort_nogroup = 'nogroup' == sickgear.RESULTS_SORTBY[-7:] + for n, cur_method in enumerate(sort_methods): + final_results = cur_method(final_results, n == idx_last_sort, sort_nogroup) return json_dumps({'results': final_results})