Skip to content

Commit

Permalink
Handle empty parental guide filter selections as 'Disable' to align w…
Browse files Browse the repository at this point in the history
…ith the user's intention
  • Loading branch information
mhdzumair committed Jan 18, 2025
1 parent 882de09 commit 364e840
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions resources/js/config_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,16 @@ function getUserData() {
const showTorrentLanguageFlag = document.getElementById('showTorrentLanguageFlag').checked;

// Collect nudity filter data
const selectedNudityFilters = Array.from(document.querySelectorAll('input[name="nudity_filter"]:checked')).map(el => el.value);
let selectedNudityFilters = Array.from(document.querySelectorAll('input[name="nudity_filter"]:checked')).map(el => el.value);
if (selectedNudityFilters.length === 0) {
selectedNudityFilters = ['Disable'];
}

// Collect certification filter data
const selectedCertificationFilters = Array.from(document.querySelectorAll('input[name="certification_filter"]:checked')).map(el => el.value);
let selectedCertificationFilters = Array.from(document.querySelectorAll('input[name="certification_filter"]:checked')).map(el => el.value);
if (selectedCertificationFilters.length === 0) {
selectedCertificationFilters = ['Disable'];
}

// Collect language sorting order
const languageSorting = Array.from(document.querySelectorAll('input[name="selected_languages"]:checked')).map(el => el.value || null);
Expand Down

0 comments on commit 364e840

Please sign in to comment.