From dec65748db6f85ef060a76719073dcdd3b38e03a Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 19 Jun 2020 05:00:14 +0100 Subject: [PATCH] Change anime "Available groups" to display "No groups listed..." when API is fine with no results instead of blank. Change improve clarity of anime group lists by using terms Allow list and Block list. --- CHANGES.md | 2 + gui/slick/css/style.css | 79 ++++++++++++---------- gui/slick/interfaces/default/config_general.tmpl | 2 +- gui/slick/interfaces/default/displayShow.tmpl | 8 +-- gui/slick/interfaces/default/editShow.tmpl | 4 +- gui/slick/interfaces/default/home_newShow.tmpl | 2 +- .../interfaces/default/inc_addShowOptions.tmpl | 2 +- .../interfaces/default/inc_anigrouplists.tmpl | 68 +++++++++++++++++++ .../interfaces/default/inc_blackwhitelist.tmpl | 68 ------------------- gui/slick/js/anigrouplists.js | 30 ++++++++ gui/slick/js/blackwhite.js | 30 -------- gui/slick/js/editShow.js | 12 ++-- gui/slick/js/newShow.js | 14 ++-- sickbeard/anime.py | 54 +++++++-------- sickbeard/databases/mainDB.py | 60 +++++++++++----- sickbeard/db.py | 3 +- sickbeard/providers/horriblesubs.py | 4 +- sickbeard/search.py | 2 +- sickbeard/show_name_helpers.py | 22 +++--- sickbeard/show_queue.py | 42 ++++++------ sickbeard/tv.py | 20 +++--- sickbeard/webserve.py | 54 ++++++++------- tests/migration_tests.py | 2 +- 23 files changed, 307 insertions(+), 277 deletions(-) create mode 100644 gui/slick/interfaces/default/inc_anigrouplists.tmpl delete mode 100644 gui/slick/interfaces/default/inc_blackwhitelist.tmpl create mode 100644 gui/slick/js/anigrouplists.js delete mode 100644 gui/slick/js/blackwhite.js diff --git a/CHANGES.md b/CHANGES.md index 97644cf..e18171a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,8 @@ * Add overall failure monitoring to History/Connect fails (renamed from "Provider fails") * Change log exception during updateCache in newznab * Change make Py3.9 preparations +* Change anime "Available groups" to display "No groups listed..." when API is fine with no results instead of blank +* Change improve clarity of anime group lists by using terms Allow list and Block list [develop changelog] diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index 33f0b89..6cb00d6 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -1317,16 +1317,16 @@ div.formpaginate{ font-weight:900 } -#addShowForm #blackwhitelist{ +#addShowForm #anigrouplists{ padding:0 0 0 15px } -#edit-show #blackwhitelist, -#edit-show #blackwhitelist h4, -#edit-show #blackwhitelist p, -#addShowForm #blackwhitelist, -#addShowForm #blackwhitelist h4, -#addShowForm #blackwhitelist p{ +#edit-show #anigrouplists, +#edit-show #anigrouplists h4, +#edit-show #anigrouplists p, +#addShowForm #anigrouplists, +#addShowForm #anigrouplists h4, +#addShowForm #anigrouplists p{ font-size:13px } @@ -3042,21 +3042,21 @@ select .selected:before{ border:1px transparent } -#addShowForm #add-white, -#addShowForm #add-black{ +#addShowForm #add-allow, +#addShowForm #add-block{ margin:0 0 10px 30px !important } -#addShowForm #remove-white, -#addShowForm #remove-black{ +#addShowForm #remove-allow, +#addShowForm #remove-block{ margin:0 0 0 30px !important } -#edit-show #add-white, -#edit-show #add-black{ +#edit-show #add-allow, +#edit-show #add-block{ margin:0 0 10px !important } -#edit-show #remove-white, -#edit-show #remove-black{ +#edit-show #remove-allow, +#edit-show #remove-block{ margin:0 !important } @@ -3636,7 +3636,7 @@ option.flag{ } /* Anime section for editShow */ -.bwlWrapper{ +.anigrouplists-wrapper{ height:auto; margin:0 auto } @@ -3658,62 +3658,69 @@ option.flag{ width:95% } -div.blackwhitelist h4{ +div.anigrouplists h4{ margin-top:0 } -div.blackwhitelist{ +#addShowForm .anigrouplists.pool h4{ + margin-right:20px !important +} +div.anigrouplists{ text-align:center } -div.blackwhitelist.white input, -div.blackwhitelist.black input, -div.blackwhitelist.pool input{ +div.anigrouplists.allow input, +div.anigrouplists.block input, +div.anigrouplists.pool input{ margin:5px 0 !important } -div.blackwhitelist select{ +div.anigrouplists select{ margin:0 !important } -div.blackwhitelist .inuse{ +div.anigrouplists .inuse{ margin-right:5px; width:243px; float:left } -div.blackwhitelist.white, -div.blackwhitelist.black{ +div.anigrouplists.allow, +div.anigrouplists.block{ width:243px } -div.blackwhitelist.white select, -div.blackwhitelist.black select{ +div.anigrouplists.allow select, +div.anigrouplists.block select{ margin:0; width:215px /* clear:both*/ } -div.blackwhitelist.white select, -div.blackwhitelist.black select{ +div.anigrouplists.allow select, +div.anigrouplists.block select{ height:110px } -#edit-show div.blackwhitelist.pool{ +#edit-show div.anigrouplists.pool{ width:330px; height:265px; margin-left:248px; float:none } -#edit-show div.blackwhitelist.pool select, -div.blackwhitelist.pool, -div.blackwhitelist.pool select{ +#edit-show div.anigrouplists.pool select, +div.anigrouplists.pool, +div.anigrouplists.pool select{ width:330px; height:265px; float:right } +#addShowForm #pool{ + width:310px; + margin-right:20px !important +} -div.blackwhitelist span{ +div.anigrouplists span{ text-align:center } -div#blackwhitelist, -div.blackwhitelist.manual{ +div#anigrouplists, +div.anigrouplists.manual{ margin:7px 0 } diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index ef984f6..196936f 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -632,7 +632,7 @@

blank for insecure allow all

-

whitelist names that browse the interface (e.g. $request_host, my_hostname)

+

allowed names that browse the interface (e.g. $request_host, my_hostname)

diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 01dcd95..7de97b4 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -380,11 +380,11 @@ #if int($show_obj.is_anime) Anime #end if -#if $bwl and $bwl.whitelist - Wanted group$maybe_plural(len($bwl.whitelist)) +#if $anigroups and $anigroups.allowlist + Wanted group$maybe_plural(len($anigroups.allowlist)) #end if -#if $bwl and $bwl.blacklist - Unwanted group$maybe_plural(len($bwl.blacklist)) +#if $anigroups and $anigroups.blocklist + Unwanted group$maybe_plural(len($anigroups.blocklist)) #end if diff --git a/gui/slick/interfaces/default/editShow.tmpl b/gui/slick/interfaces/default/editShow.tmpl index ee21f6e..290d0e0 100644 --- a/gui/slick/interfaces/default/editShow.tmpl +++ b/gui/slick/interfaces/default/editShow.tmpl @@ -275,8 +275,8 @@ #if $show_obj.is_anime #import sickbeard.anime - #include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_blackwhitelist.tmpl') - + #include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_anigrouplists.tmpl') + #end if diff --git a/gui/slick/interfaces/default/home_newShow.tmpl b/gui/slick/interfaces/default/home_newShow.tmpl index a795877..1d06c00 100644 --- a/gui/slick/interfaces/default/home_newShow.tmpl +++ b/gui/slick/interfaces/default/home_newShow.tmpl @@ -153,7 +153,7 @@ - + diff --git a/gui/slick/interfaces/default/inc_addShowOptions.tmpl b/gui/slick/interfaces/default/inc_addShowOptions.tmpl index ef2532e..74c7836 100644 --- a/gui/slick/interfaces/default/inc_addShowOptions.tmpl +++ b/gui/slick/interfaces/default/inc_addShowOptions.tmpl @@ -135,7 +135,7 @@ #if $enable_anime_options #import sickbeard.anime -#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_blackwhitelist.tmpl') +#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_anigrouplists.tmpl') #else #end if diff --git a/gui/slick/interfaces/default/inc_anigrouplists.tmpl b/gui/slick/interfaces/default/inc_anigrouplists.tmpl new file mode 100644 index 0000000..bea575f --- /dev/null +++ b/gui/slick/interfaces/default/inc_anigrouplists.tmpl @@ -0,0 +1,68 @@ +
+ + + + Fansub groups + + +
+
+ +
+
+
+

Allow list
Only snatch releases by group(s)

+
+ +
+ + +
+
+
+ +
+

Block list
Ignore releases by group(s)

+
+ +
+ + +
+
+
+
+
+

Available groups
Name (Rating) Number of subbed episodes

+ +
+
+ +
 
+
+
+ + + +
+ add a custom item to either the allow or block list +
 
+
+
+
+
+
diff --git a/gui/slick/interfaces/default/inc_blackwhitelist.tmpl b/gui/slick/interfaces/default/inc_blackwhitelist.tmpl deleted file mode 100644 index bf97774..0000000 --- a/gui/slick/interfaces/default/inc_blackwhitelist.tmpl +++ /dev/null @@ -1,68 +0,0 @@ -
- - - - Fansub groups - - -
-
- -
-
-
-

Whitelist
Only snatch releases by group(s)

-
- -
- - -
-
-
- -
-

Blacklist
Ignore releases by group(s)

-
- -
- - -
-
-
-
-
-

Available groups
Name (Rating) Number of subbed episodes

- -
-
- -
 
-
-
- - - -
- add a custom item to either the whitelist or blacklist -
 
-
-
-
-
-
diff --git a/gui/slick/js/anigrouplists.js b/gui/slick/js/anigrouplists.js new file mode 100644 index 0000000..d09b1a0 --- /dev/null +++ b/gui/slick/js/anigrouplists.js @@ -0,0 +1,30 @@ +function generateAniGroupList() { + $.each(['allow', 'block'], function(i, list) { + var group_list = []; + + $('#' + list + ' option').each(function(i, option) { + group_list.push($(option).val()); + }); + + $('#' + list + 'list').val(group_list.join(',')); + }); +} + +$('#add-allow, #add-block').click(function() { + !$('#pool option:selected').remove().appendTo('#' + $(this).attr('id').replace(/add[-]/i, '')); +}); + +$('#remove-allow, #remove-block').click(function() { + !$('#' + $(this).attr('id').replace(/remove[-]/i, '') + ' option:selected').remove().appendTo('#pool'); +}); + +$('#new-allow, #new-block').click(function() { + var group = $('#addToPoolText').val(); + if ('' != group) { + var option = $('