WIP: workig download button on movies and episodes

This commit is contained in:
Brock H Caldwell
2026-03-22 23:31:03 -05:00
parent e39cb6e9bd
commit 740bef97b1
9 changed files with 150 additions and 39 deletions

View File

@@ -9,7 +9,7 @@
{% set preferences_form = form %}
{{ form_start(preferences_form) }}
<h3 class="font-bold text-lg mb-2 md:mb-4">Apply a filter to your results</h3>
<h3 class="font-bold text-lg mb-2 md:mb-4">What type of file do you want?</h3>
<div class="flex flex-col md:flex-row gap-2 justify-between">
{{ form_row(preferences_form.resolution) }}
{{ form_row(preferences_form.codec) }}
@@ -37,6 +37,17 @@
</div>
{% endif %}
</div>
{% if results.media.mediaType == "movies" %}
<div class="w-full flex-col md:flex-row justify-between gap-2">
<download-media-button
class="px-2 py-1 bg-green-500 bg-opacity-60 font-medium rounded-lg text-sm cursor-pointer self-end"
title="Download {{ results.media.title }}"
media-type="{{ results.media.mediaType }}"
imdb-id="{{ results.media.imdbId }}">
download
</download-media-button>
</div>
{% endif %}
{{ form_end(preferences_form) }}
<div class="flex flex-col-reverse md:flex-row justify-between">

View File

@@ -53,11 +53,21 @@
</div>
</div>
<div class="flex flex-col gap-4 justify-between">
<div class="flex flex-col items-center">
<input class="episode-selector" type="checkbox"
{{ stimulus_target('tv-results', 'episodeSelector') }}
/>
</div>
<download-media-button
class="px-2 py-2 bg-green-500 bg-opacity-80 font-medium text-center rounded-lg text-sm cursor-pointer items-center self-end"
title="Download season {{ episode.seasonNumber }} episode {{ episode.episodeNumber }} of {{ this.title }}"
media-type="tvshows"
imdb-id="{{ this.imdbId }}"
season="{{ episode.seasonNumber }}"
episode="{{ episode.episodeNumber }}"
>
<twig:ux:icon name="bi:download" width="20" />
</download-media-button>
<input class="episode-selector" type="checkbox"
{{ stimulus_target('tv-results', 'episodeSelector') }}
/>
<button class="dropdown-button flex flex-col items-end transition-transform duration-300 ease-in-out rotate-90" title="Click to expand the results table for season {{ episode.seasonNumber }} episode {{ episode.episodeNumber }}.">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32">
<path