feat: provider filter

This commit is contained in:
2025-04-22 20:21:18 -05:00
parent 7359813bbe
commit 4bbc44f874
3 changed files with 8 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ export default class extends Controller {
}
outlet.options.forEach((option) => {
this.addLanguages(option, option.dataset);
// this.addProviders(option, props);
this.addProviders(option, option.dataset);
// this.addSeasons(option, props);
// this.addEpisodes(option, props);
})
@@ -54,6 +54,7 @@ export default class extends Controller {
}
addProviders(option, props) {
console.log(props);
if (!this.providers.includes(props['provider'])) {
this.providers.push(props['provider']);
}
@@ -96,7 +97,7 @@ export default class extends Controller {
"resolution": this.resolutionTarget.value,
"codec": this.codecTarget.value,
"language": this.languageTarget.value,
// "episodeNumber": this.episodeTarget.value,
"provider": this.providerTarget.value,
}
if ("movies" === this.mediaTypeValue) {
@@ -119,7 +120,7 @@ export default class extends Controller {
const props = {
"resolution": option.querySelector('#resolution').textContent.trim(),
"codec": option.querySelector('#codec').textContent.trim(),
// "provider": option.querySelector('#provider').textContent,
"provider": option.querySelector('#provider').textContent.trim(),
"languages": JSON.parse(option.dataset['languages']),
// "codec": option.querySelector('#codec').textContent,
}

View File

@@ -34,7 +34,7 @@
</thead>
<tbody>
{% for result in results.results %}
<tr class="bg-white border-b dark:bg-slate-700 dark:border-gray-600 border-gray-200" data-languages="{{ result.languages|json_encode }}">
<tr class="bg-white border-b dark:bg-slate-700 dark:border-gray-600 border-gray-200" data-languages="{{ result.languages|json_encode }}" data-provider="{{ result.provider }}">
<td id="size" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.size }}
</td>
@@ -47,7 +47,7 @@
<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 id="provider" 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" data-provider="{{ result.provider }}">
{{ result.provider }}
</td>
<td id="language" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50" data-languages="{{ result.languages|json_encode }}">

View File

@@ -54,7 +54,7 @@
</thead>
<tbody>
{% for result in results.results %}
<tr class="bg-white border-b dark:bg-slate-700 dark:border-gray-600 border-gray-200" data-languages="{{ result.languages|json_encode }}">
<tr class="bg-white border-b dark:bg-slate-700 dark:border-gray-600 border-gray-200" data-languages="{{ result.languages|json_encode }}" data-provider="{{ result.provider }}">
<td id="size" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
{{ result.size }}
</td>
@@ -67,7 +67,7 @@
<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 id="provider" 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" data-provider="{{ result.provider }}">
{{ result.provider }}
</td>
<td id="language" class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50" data-languages="{{ result.languages|json_encode }}">