fix: working multi-choice filtering

This commit is contained in:
2025-07-26 10:20:37 -05:00
parent 87e72ec55e
commit f9ec089f8b
10 changed files with 216 additions and 75 deletions

View File

@@ -7,69 +7,109 @@
data-action="change->result-filter#filter action-button:downloadSeason@window->result-filter#downloadSeason"
>
<div class="w-full p-4 flex flex-col md:flex-row gap-4 bg-stone-500 text-md text-gray-500 dark:text-gray-50 rounded-lg">
<label for="resolution">
<label for="resolution" class="flex flex-col gap-1">
Resolution
<select id="resolution"
multiple="multiple"
data-result-filter-target="resolution"
class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
value="{{ app.user.userPreferenceValues["resolution"] }}"
class="px-1 py-0.5 bg-stone-100 placeholder-text-gray-50 text-gray-50"
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete', {
create: false,
tomSelectOptions: {
highlight: false,
}
}) }}
>
<option value="">n/a</option>
{% for name, value in this.resolutionOptions %}
<option value="{{ value }}"
{{ value == this.userPreferences['resolution'] ? 'selected' }}
{{ value in this.userPreferences['resolution'] ? 'selected' }}
>{{ name }}</option>
{% endfor %}
</select>
</label>
<label for="codec">
<label for="codec" class="flex flex-col gap-1">
Codec
<select id="codec" data-result-filter-target="codec" class="px-1 py-0.5 bg-stone-100 text-sm text-gray-800 rounded-md">
<select id="codec"
multiple="multiple"
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete', {
create: false,
tomSelectOptions: {
highlight: false,
}
}) }}
data-result-filter-target="codec" class="px-1 py-0.5 bg-stone-100 text-gray-50">
<option value="">n/a</option>
{% for name, value in this.codecOptions %}
<option value="{{ value }}"
{{ value == this.userPreferences['codec'] ? 'selected' }}
{{ value in this.userPreferences['codec'] ? 'selected' }}
>{{ name }}</option>
{% endfor %}
</select>
</label>
<label for="language">
<label for="language" class="flex flex-col gap-1">
Language
<select id="language"
multiple="multiple"
data-result-filter-target="language"
class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete', {
create: false,
tomSelectOptions: {
highlight: false,
}
}) }}
class="px-1 py-0.5 bg-stone-100 text-gray-50"
{% if this.userPreferences['language'] != null %}
data-preferred="{{ this.userPreferences['language'] }}"
data-preferred="{{ this.userPreferences['language']|json_encode }}"
{% endif %}
>
</select>
</label>
<label for="provider">
<label for="provider" class="flex flex-col gap-1">
Provider
<select id="provider"
multiple="multiple"
data-result-filter-target="provider"
class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete', {
create: false,
tomSelectOptions: {
highlight: false,
}
}) }}
class="px-1 py-0.5 bg-stone-100 text-gray-50"
{% if this.userPreferences['provider'] != null %}
data-preferred="{{ this.userPreferences['provider'] }}"
data-preferred="{{ this.userPreferences['provider']|json_encode }}"
{% endif %}
>
</select>
</label>
<label for="quality">
<label for="quality" class="flex flex-col gap-1">
Quality
<select id="quality"
multiple="multiple"
data-result-filter-target="quality"
class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
class="px-1 py-0.5 bg-stone-100 text-gray-50"
{{ stimulus_controller('symfony/ux-autocomplete/autocomplete', {
create: false,
tomSelectOptions: {
highlight: false,
}
}) }}
{% if this.userPreferences['quality'] != null %}
data-preferred="{{ this.userPreferences['quality'] }}"
data-preferred="{{ this.userPreferences['quality']|json_encode }}"
{% endif %}
>
</select>
</label>
{% if results.media.mediaType == "tvshows" %}
<label for="season">
Season
<select id="season" name="season" value="1" data-result-filter-target="season" class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
<select id="season" name="season" value="1" data-result-filter-target="season" class="px-1 py-0.5 bg-stone-100 text-gray-800"
{{ stimulus_action('result_filter', 'setSeason', 'change') }}
{{ stimulus_action('result_filter', 'uncheckSelectAllBtn', 'change') }}
>