0.16.1-7 Release-Bugfixes
This commit is contained in:
@@ -28,7 +28,6 @@ const GENERAL_TOOL_KEYS = new Set([
|
||||
'mkvmerge_command',
|
||||
'ffprobe_command',
|
||||
'handbrake_restart_delete_incomplete_output',
|
||||
'handbrake_pre_metadata_scan_enabled',
|
||||
'script_test_timeout_ms'
|
||||
]);
|
||||
|
||||
@@ -58,7 +57,8 @@ const ALWAYS_HIDDEN_SETTING_KEYS = new Set([
|
||||
'makemkv_rip_mode',
|
||||
'makemkv_rip_mode_bluray',
|
||||
'makemkv_rip_mode_dvd',
|
||||
'makemkv_backup_mode'
|
||||
'makemkv_backup_mode',
|
||||
'handbrake_pre_metadata_scan_enabled'
|
||||
]);
|
||||
const EXPERT_ONLY_SETTING_KEYS = new Set([
|
||||
'pushover_device',
|
||||
@@ -78,6 +78,9 @@ const EXPERT_ONLY_SETTING_KEYS = new Set([
|
||||
'cdparanoia_command',
|
||||
'script_test_timeout_ms'
|
||||
]);
|
||||
const EXPERT_ONLY_CATEGORY_NAMES = new Set([
|
||||
'logging'
|
||||
]);
|
||||
|
||||
function toBoolean(value) {
|
||||
if (typeof value === 'boolean') {
|
||||
@@ -436,6 +439,14 @@ function filterSettingsByVisibility(settings, expertModeEnabled) {
|
||||
return list.filter((setting) => !shouldHideSettingByExpertMode(setting?.key, expertModeEnabled));
|
||||
}
|
||||
|
||||
function shouldHideCategoryByExpertMode(categoryName, expertModeEnabled) {
|
||||
const normalizedCategory = normalizeText(categoryName);
|
||||
if (!normalizedCategory) {
|
||||
return false;
|
||||
}
|
||||
return !expertModeEnabled && EXPERT_ONLY_CATEGORY_NAMES.has(normalizedCategory);
|
||||
}
|
||||
|
||||
function buildToolSections(settings) {
|
||||
const list = Array.isArray(settings) ? settings : [];
|
||||
const generalBucket = {
|
||||
@@ -1118,6 +1129,7 @@ export default function DynamicSettingsForm({
|
||||
const safeCategories = Array.isArray(categories) ? categories : [];
|
||||
const expertModeEnabled = toBoolean(values?.[EXPERT_MODE_SETTING_KEY]);
|
||||
const visibleCategories = safeCategories
|
||||
.filter((category) => !shouldHideCategoryByExpertMode(category?.category, expertModeEnabled))
|
||||
.map((category) => ({
|
||||
...category,
|
||||
settings: filterSettingsByVisibility(category?.settings, expertModeEnabled)
|
||||
|
||||
Reference in New Issue
Block a user