fix: uses correct title for directory name

This commit is contained in:
2025-04-23 20:48:01 -05:00
parent d8e8c7f0f0
commit 35718958ee
8 changed files with 14 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ export default class extends Controller {
},
body: JSON.stringify({
url: this.urlValue,
title: this.titleValue,
title: this.element.dataset['title'],
filename: this.filenameValue,
mediaType: this.mediaTypeValue,
imdbId: this.imdbIdValue

View File

@@ -7,6 +7,7 @@ import { Controller } from '@hotwired/stimulus';
/* stimulusFetch: 'lazy' */
export default class extends Controller {
static values = {
title: String,
tmdbId: String,
imdbId: String
};
@@ -26,6 +27,7 @@ export default class extends Controller {
.then(response => {
this.element.innerHTML = response;
this.options = this.element.querySelectorAll('tbody tr');
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
});
}
}

View File

@@ -7,6 +7,7 @@ import { Controller } from '@hotwired/stimulus';
/* stimulusFetch: 'lazy' */
export default class extends Controller {
static values = {
title: String,
tmdbId: String,
imdbId: String,
season: String,
@@ -31,6 +32,7 @@ export default class extends Controller {
.then(response => {
this.element.innerHTML = response;
this.options = this.element.querySelectorAll('tbody tr');
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
this.optionsLoaded = true;
this.loadingIconOutlet.increaseCount();
});

View File

@@ -1,2 +1,2 @@
# $1 = movies/tvshows/etc, $2 = title of media, $3 = URL of download
cd /dl/${1} && if [ ! -d "${2}" ]; then mkdir "${2}"; fi && cd "${2}" && wget "${3}"
cd /var/download/${1} && if [ ! -d "${2}" ]; then mkdir "${2}"; fi && cd "${2}" && wget "${3}"

View File

@@ -21,6 +21,7 @@ services:
build: .
volumes:
- ./:/var/www
- ./var/download:/var/download
command: php ./bin/console messenger:consume async -vvv --time-limit=3600 --limit=10
database:

View File

@@ -3,12 +3,14 @@
namespace App\Torrentio\Action\Handler;
use App\Tmdb\Tmdb;
use App\Torrentio\Action\Command\GetTvShowOptionsCommand;
use App\Torrentio\Action\Result\GetTvShowOptionsResult;
use App\Torrentio\Client\Torrentio;
use OneToMany\RichBundle\Contract\CommandInterface;
use OneToMany\RichBundle\Contract\HandlerInterface;
use OneToMany\RichBundle\Contract\ResultInterface;
/** @implements HandlerInterface<GetTvShowOptionsCommand, GetTvShowOptionsResult> */
class GetTvShowOptionsHandler implements HandlerInterface
{
public function __construct(

View File

@@ -27,7 +27,7 @@
{{ include('search/partial/filter.html.twig') }}
{% if "movies" == results.media.mediaType %}
<div class="results" {{ stimulus_controller('movie_results', {tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}>
<div class="results" {{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}>
</div>
{% elseif "tvshows" == results.media.mediaType %}
{% for season, episodes in results.media.episodes %}
@@ -35,7 +35,9 @@
{% for episode in episodes %}
<div class="results {{ (active == false) ? 'hidden' }}"
data-tv-results-loading-icon-outlet=".loading-icon"
data-download-button-outlet=".download-btn"
{{ stimulus_controller('tv_results', {
title: results.media.title,
tmdbId: results.media.tmdbId,
imdbId: results.media.imdbId,
season: season,

View File

@@ -54,10 +54,10 @@
{{ result.languageFlags|raw }}
</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">
<button class="p-1.5 bg-green-600 rounded-md text-gray-50"
<button class="download-btn p-1.5 bg-green-600 rounded-md text-gray-50"
{{ stimulus_controller('download_button', {
url: result.url,
title: result.title,
title: results.media.title,
filename: result.filename,
mediaType: results.media.mediaType,
imdbId: results.media.imdbId