feat: updates option count for each episode when filter changes

This commit is contained in:
2025-04-22 13:54:37 -05:00
parent 5c3aa595bf
commit 88851169f9
4 changed files with 28 additions and 29 deletions

View File

@@ -29,6 +29,7 @@
{{ stimulus_action('result_filter', 'filter', 'change') }}
data-result-filter-media-type-value="{{ results.media.mediaType }}"
data-result-filter-movie-results-outlet=".results"
data-result-filter-tv-results-outlet=".results"
>
<label for="resolution">
Resolution
@@ -36,7 +37,7 @@
<option {{ filter.resolution == "n/a" ? "selected" }}
value="">n/a</option>
<option {{ filter.resolution == "720p" ? "selected" }}
value="720p">780p</option>
value="720p">720p</option>
<option {{ filter.resolution == "1080p" ? "selected" }}
value="1080p">1080p</option>
<option {{ filter.resolution == "2160p" ? "selected" }}
@@ -91,7 +92,7 @@
{% for season, episodes in results.media.episodes %}
{% set active = (season == '1') ? true : false %}
{% for episode in episodes %}
<div class="{{ (active == false) ? 'hidden' }}"
<div class="results {{ (active == false) ? 'hidden' }}"
data-tv-results-loading-icon-outlet=".loading-icon"
{{ stimulus_controller('tv_results', {
tmdbId: results.media.tmdbId,

View File

@@ -7,7 +7,7 @@
<span>
<small class="py-1 px-1.5 grow-0 font-bold bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white"
{{ stimulus_action('tv-results', 'toggleList', 'click') }}
>{{ results.results|length }} results</small>
><span {{ stimulus_target('tv-results', 'count') }}>{{ results.results|length }}</span> results</small>
</span>
</div>
<div class="flex flex-col items-end hover:cursor-pointer"
@@ -55,28 +55,28 @@
<tbody>
{% for result in results.results %}
<tr class="bg-white border-b dark:bg-slate-700 dark:border-gray-600 border-gray-200">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="size" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.size }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="resolution" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.resolution }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="codec" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.codec }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="seeders" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.seeders }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="provider" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.provider }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
<td id="language" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.languageFlags }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-end text-gray-800 dark:text-gray-50 flex flex-row gap-2 items-center justify-end">
<span class="p-1.5 bg-green-600 rounded-md text-gray-50">
Download
</span>
<span class="p-1.5 bg-green-600 rounded-md text-gray-50">
Download
</span>
<label for="select">
<input id="select" type="checkbox" name="select" />
</label>