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

View File

@@ -19,9 +19,11 @@
<div class="w-full flex flex-col">
<div class="mb-4 flex flex-row gap-2 justify-between">
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
{{ results.media.title }} ({{ results.media.year }})
</h3>
<div class="flex flex-row justify-between items-center gap-2 w-full">
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
{{ results.media.title }} ({{ results.media.year }})
</h3>
</div>
{% if results.media.mediaType == "tvshows" %}
<div {{ stimulus_controller('monitor_button', {
@@ -96,9 +98,9 @@
{% if "movies" == results.media.mediaType %}
<div class="flex flex-row justify-start items-end grow text-xs">
<span class="results-count-badge py-1 px-1.5 mr-1 grow-0 font-bold text-xs bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white">
<span class="results-count-number" id="movie_results_count">-</span> results
</span>
{# <span class="results-count-badge py-1 px-1.5 mr-1 grow-0 font-bold text-xs bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white">#}
{# <span class="results-count-number" id="movie_results_count">-</span> results#}
{# </span>#}
<twig:Turbo:Frame id="meb_{{ results.media.imdbId }}" src="{{ path('api.library.search', {
title: results.media.title,
@@ -133,18 +135,18 @@
<twig:Filter results="{{ results }}" filter="{{ filter }}" />
{% if "movies" == results.media.mediaType %}
<movie-container class="results"
{{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}
>
<twig:Turbo:Frame id="movie_results_frame" src="{{ path('app_torrentio_movies', {
tmdbId: results.media.tmdbId,
imdbId: results.media.imdbId,
target: 'movie_results_frame',
block: 'movie_results'
}) }}">
<twig:ux:icon name="codex:loader" height="20" width="20" data-loading-icon-target="icon" class="text-end" title="Loading download options for {{ results.media.title }}" />
</twig:Turbo:Frame>
</movie-container>
{# <movie-container class="results"#}
{# {{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}#}
{# >#}
{# <twig:Turbo:Frame id="movie_results_frame" src="{{ path('app_torrentio_movies', {#}
{# tmdbId: results.media.tmdbId,#}
{# imdbId: results.media.imdbId,#}
{# target: 'movie_results_frame',#}
{# block: 'movie_results'#}
{# }) }}">#}
{# <twig:ux:icon name="codex:loader" height="20" width="20" data-loading-icon-target="icon" class="text-end" title="Loading download options for {{ results.media.title }}" />#}
{# </twig:Turbo:Frame>#}
{# </movie-container>#}
{% elseif "tvshows" == results.media.mediaType %}
<twig:TvEpisodeList
results="results"