feat: add configurable mature blur threshold setting

Add new setting 'mature_blur_level' with options PG13/R/X/XXX to control
which NSFW rating level triggers blur filtering when NSFW blur is enabled.

- Backend: update preview selection logic to respect threshold
- Frontend: update UI components to use configurable threshold
- Settings: add validation and normalization for mature_blur_level
- Tests: add coverage for new threshold behavior
- Translations: add keys for all supported languages

Fixes #867
This commit is contained in:
Will Miao
2026-03-26 18:24:47 +08:00
parent 3b001a6cd8
commit ceeab0c998
28 changed files with 320 additions and 59 deletions

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "NSFW-Inhalte unscharf stellen",
"blurNsfwContentHelp": "Nicht jugendfreie (NSFW) Vorschaubilder unscharf stellen",
"showOnlySfw": "Nur SFW-Ergebnisse anzeigen",
"showOnlySfwHelp": "Alle NSFW-Inhalte beim Durchsuchen und Suchen herausfiltern"
"showOnlySfwHelp": "Alle NSFW-Inhalte beim Durchsuchen und Suchen herausfiltern",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "Videos bei Hover automatisch abspielen",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "Blur NSFW Content",
"blurNsfwContentHelp": "Blur mature (NSFW) content preview images",
"showOnlySfw": "Show Only SFW Results",
"showOnlySfwHelp": "Filter out all NSFW content when browsing and searching"
"showOnlySfwHelp": "Filter out all NSFW content when browsing and searching",
"matureBlurThreshold": "Mature Blur Threshold",
"matureBlurThresholdHelp": "Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "PG13 and above",
"r": "R and above (default)",
"x": "X and above",
"xxx": "XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "Autoplay Videos on Hover",
@@ -1758,4 +1766,4 @@
"retry": "Retry"
}
}
}
}

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "Difuminar contenido NSFW",
"blurNsfwContentHelp": "Difuminar imágenes de vista previa de contenido para adultos (NSFW)",
"showOnlySfw": "Mostrar solo resultados SFW",
"showOnlySfwHelp": "Filtrar todo el contenido NSFW al navegar y buscar"
"showOnlySfwHelp": "Filtrar todo el contenido NSFW al navegar y buscar",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "Reproducir videos automáticamente al pasar el ratón",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "Flouter le contenu NSFW",
"blurNsfwContentHelp": "Flouter les images d'aperçu de contenu pour adultes (NSFW)",
"showOnlySfw": "Afficher uniquement les résultats SFW",
"showOnlySfwHelp": "Filtrer tout le contenu NSFW lors de la navigation et de la recherche"
"showOnlySfwHelp": "Filtrer tout le contenu NSFW lors de la navigation et de la recherche",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "Lecture automatique vidéo au survol",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "טשטש תוכן NSFW",
"blurNsfwContentHelp": "טשטש תמונות תצוגה מקדימה של תוכן למבוגרים (NSFW)",
"showOnlySfw": "הצג רק תוצאות SFW",
"showOnlySfwHelp": "סנן את כל התוכן ה-NSFW בעת גלישה וחיפוש"
"showOnlySfwHelp": "סנן את כל התוכן ה-NSFW בעת גלישה וחיפוש",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "נגן וידאו אוטומטית בריחוף",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "NSFWコンテンツをぼかす",
"blurNsfwContentHelp": "成人向けNSFWコンテンツのプレビュー画像をぼかします",
"showOnlySfw": "SFWコンテンツのみ表示",
"showOnlySfwHelp": "閲覧と検索時にすべてのNSFWコンテンツを除外します"
"showOnlySfwHelp": "閲覧と検索時にすべてのNSFWコンテンツを除外します",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "ホバー時に動画を自動再生",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "NSFW 콘텐츠 블러 처리",
"blurNsfwContentHelp": "성인(NSFW) 콘텐츠 미리보기 이미지를 블러 처리합니다",
"showOnlySfw": "SFW 결과만 표시",
"showOnlySfwHelp": "탐색 및 검색 시 모든 NSFW 콘텐츠를 필터링합니다"
"showOnlySfwHelp": "탐색 및 검색 시 모든 NSFW 콘텐츠를 필터링합니다",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "호버 시 비디오 자동 재생",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "Размывать NSFW контент",
"blurNsfwContentHelp": "Размывать превью изображений контента для взрослых (NSFW)",
"showOnlySfw": "Показывать только SFW результаты",
"showOnlySfwHelp": "Фильтровать весь NSFW контент при просмотре и поиске"
"showOnlySfwHelp": "Фильтровать весь NSFW контент при просмотре и поиске",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "Автовоспроизведение видео при наведении",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "模糊 NSFW 内容",
"blurNsfwContentHelp": "模糊成熟NSFW内容预览图片",
"showOnlySfw": "仅显示 SFW 结果",
"showOnlySfwHelp": "浏览和搜索时过滤所有 NSFW 内容"
"showOnlySfwHelp": "浏览和搜索时过滤所有 NSFW 内容",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "悬停时自动播放视频",

View File

@@ -291,7 +291,15 @@
"blurNsfwContent": "模糊 NSFW 內容",
"blurNsfwContentHelp": "模糊成熟NSFW內容預覽圖片",
"showOnlySfw": "僅顯示 SFW 結果",
"showOnlySfwHelp": "瀏覽和搜尋時過濾所有 NSFW 內容"
"showOnlySfwHelp": "瀏覽和搜尋時過濾所有 NSFW 內容",
"matureBlurThreshold": "[TODO: Translate] Mature Blur Threshold",
"matureBlurThresholdHelp": "[TODO: Translate] Set which rating level starts blur filtering when NSFW blur is enabled.",
"matureBlurThresholdOptions": {
"pg13": "[TODO: Translate] PG13 and above",
"r": "[TODO: Translate] R and above (default)",
"x": "[TODO: Translate] X and above",
"xxx": "[TODO: Translate] XXX only"
}
},
"videoSettings": {
"autoplayOnHover": "滑鼠懸停自動播放影片",