Skip to content

Commit

Permalink
Fix/bw list default setting (#8687)
Browse files Browse the repository at this point in the history
* post BW_list as an array instead of joined string
like for qualities

* join/split BW_list on save/load config.ini to always have a list obj

* tweak list array

---------

Co-authored-by: miigotu <[email protected]>
Co-authored-by: BKSteve <[email protected]>
  • Loading branch information
3 people authored Feb 1, 2024
1 parent 42670d9 commit d3e270c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 10 additions & 2 deletions sickchill/gui/slick/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4019,6 +4019,14 @@ const SICKCHILL = {
$('#bestQualities option:selected').each((i, d) => {
bestQualArray.push($(d).val());
});
const grpwhitelistArray = [];
const grpblacklistArray = [];
$('#white option').each((i, d) => {
grpwhitelistArray.push($(d).val());
});
$('#black option').each((i, d) => {
grpblacklistArray.push($(d).val());
});
generateBlackWhiteList(); // eslint-disable-line no-undef
$.post(scRoot + '/config/general/saveAddShowDefaults', {
defaultStatus: $('#statusSelect').val(),
Expand All @@ -4029,8 +4037,8 @@ const SICKCHILL = {
anime: $('#anime').is(':checked'),
scene: $('#scene').is(':checked'),
defaultStatusAfter: $('#statusSelectAfter').val(),
whitelist: $('#whitelist').val(),
blacklist: $('#blacklist').val(),
whitelist: grpwhitelistArray,
blacklist: grpblacklistArray,
});

$(this).attr('disabled', true);
Expand Down
8 changes: 4 additions & 4 deletions sickchill/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ def path_leaf(path):
settings.ANIME_DEFAULT = check_setting_bool(settings.CFG, "General", "anime_default")
settings.SCENE_DEFAULT = check_setting_bool(settings.CFG, "General", "scene_default")

settings.WHITELIST_DEFAULT = check_setting_str(settings.CFG, "General", "whitelist_default")
settings.BLACKLIST_DEFAULT = check_setting_str(settings.CFG, "General", "blacklist_default")
settings.WHITELIST_DEFAULT = check_setting_str(settings.CFG, "General", "whitelist_default").split(",")
settings.BLACKLIST_DEFAULT = check_setting_str(settings.CFG, "General", "blacklist_default").split(",")

settings.PROVIDER_ORDER = check_setting_str(settings.CFG, "General", "provider_order").split()

Expand Down Expand Up @@ -1213,8 +1213,8 @@ def save_config():
"indexer_timeout": int(settings.INDEXER_TIMEOUT),
"anime_default": int(settings.ANIME_DEFAULT),
"scene_default": int(settings.SCENE_DEFAULT),
"whitelist_default": settings.WHITELIST_DEFAULT,
"blacklist_default": settings.BLACKLIST_DEFAULT,
"whitelist_default": ",".join(settings.WHITELIST_DEFAULT),
"blacklist_default": ",".join(settings.BLACKLIST_DEFAULT),
"provider_order": " ".join(settings.PROVIDER_ORDER),
"version_notify": int(settings.VERSION_NOTIFY),
"auto_update": int(settings.AUTO_UPDATE),
Expand Down
4 changes: 2 additions & 2 deletions sickchill/views/config/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def saveAddShowDefaults(self):
settings.STATUS_DEFAULT = int(self.get_body_argument("defaultStatus", settings.STATUS_DEFAULT_AFTER))
settings.STATUS_DEFAULT_AFTER = int(self.get_body_argument("defaultStatusAfter", settings.STATUS_DEFAULT_AFTER))

settings.WHITELIST_DEFAULT = self.get_body_arguments("whitelist")
settings.BLACKLIST_DEFAULT = self.get_body_arguments("blacklist")
settings.WHITELIST_DEFAULT = self.get_body_arguments("whitelist[]")
settings.BLACKLIST_DEFAULT = self.get_body_arguments("blacklist[]")

settings.SEASON_FOLDERS_DEFAULT = config.checkbox_to_value(self.get_body_argument("defaultSeasonFolders", settings.SEASON_FOLDERS_DEFAULT))
settings.SUBTITLES_DEFAULT = config.checkbox_to_value(self.get_body_argument("subtitles", settings.SUBTITLES_DEFAULT))
Expand Down

0 comments on commit d3e270c

Please sign in to comment.