fix: uses correct title for directory name
This commit is contained in:
@@ -23,7 +23,7 @@ export default class extends Controller {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: this.urlValue,
|
url: this.urlValue,
|
||||||
title: this.titleValue,
|
title: this.element.dataset['title'],
|
||||||
filename: this.filenameValue,
|
filename: this.filenameValue,
|
||||||
mediaType: this.mediaTypeValue,
|
mediaType: this.mediaTypeValue,
|
||||||
imdbId: this.imdbIdValue
|
imdbId: this.imdbIdValue
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Controller } from '@hotwired/stimulus';
|
|||||||
/* stimulusFetch: 'lazy' */
|
/* stimulusFetch: 'lazy' */
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
static values = {
|
static values = {
|
||||||
|
title: String,
|
||||||
tmdbId: String,
|
tmdbId: String,
|
||||||
imdbId: String
|
imdbId: String
|
||||||
};
|
};
|
||||||
@@ -26,6 +27,7 @@ export default class extends Controller {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
this.element.innerHTML = response;
|
this.element.innerHTML = response;
|
||||||
this.options = this.element.querySelectorAll('tbody tr');
|
this.options = this.element.querySelectorAll('tbody tr');
|
||||||
|
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Controller } from '@hotwired/stimulus';
|
|||||||
/* stimulusFetch: 'lazy' */
|
/* stimulusFetch: 'lazy' */
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
static values = {
|
static values = {
|
||||||
|
title: String,
|
||||||
tmdbId: String,
|
tmdbId: String,
|
||||||
imdbId: String,
|
imdbId: String,
|
||||||
season: String,
|
season: String,
|
||||||
@@ -31,6 +32,7 @@ export default class extends Controller {
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
this.element.innerHTML = response;
|
this.element.innerHTML = response;
|
||||||
this.options = this.element.querySelectorAll('tbody tr');
|
this.options = this.element.querySelectorAll('tbody tr');
|
||||||
|
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
|
||||||
this.optionsLoaded = true;
|
this.optionsLoaded = true;
|
||||||
this.loadingIconOutlet.increaseCount();
|
this.loadingIconOutlet.increaseCount();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# $1 = movies/tvshows/etc, $2 = title of media, $3 = URL of download
|
# $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}"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www
|
- ./:/var/www
|
||||||
|
- ./var/download:/var/download
|
||||||
command: php ./bin/console messenger:consume async -vvv --time-limit=3600 --limit=10
|
command: php ./bin/console messenger:consume async -vvv --time-limit=3600 --limit=10
|
||||||
|
|
||||||
database:
|
database:
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
namespace App\Torrentio\Action\Handler;
|
namespace App\Torrentio\Action\Handler;
|
||||||
|
|
||||||
use App\Tmdb\Tmdb;
|
use App\Tmdb\Tmdb;
|
||||||
|
use App\Torrentio\Action\Command\GetTvShowOptionsCommand;
|
||||||
use App\Torrentio\Action\Result\GetTvShowOptionsResult;
|
use App\Torrentio\Action\Result\GetTvShowOptionsResult;
|
||||||
use App\Torrentio\Client\Torrentio;
|
use App\Torrentio\Client\Torrentio;
|
||||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
use OneToMany\RichBundle\Contract\CommandInterface;
|
||||||
use OneToMany\RichBundle\Contract\HandlerInterface;
|
use OneToMany\RichBundle\Contract\HandlerInterface;
|
||||||
use OneToMany\RichBundle\Contract\ResultInterface;
|
use OneToMany\RichBundle\Contract\ResultInterface;
|
||||||
|
|
||||||
|
/** @implements HandlerInterface<GetTvShowOptionsCommand, GetTvShowOptionsResult> */
|
||||||
class GetTvShowOptionsHandler implements HandlerInterface
|
class GetTvShowOptionsHandler implements HandlerInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
{{ include('search/partial/filter.html.twig') }}
|
{{ include('search/partial/filter.html.twig') }}
|
||||||
|
|
||||||
{% if "movies" == results.media.mediaType %}
|
{% 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>
|
</div>
|
||||||
{% elseif "tvshows" == results.media.mediaType %}
|
{% elseif "tvshows" == results.media.mediaType %}
|
||||||
{% for season, episodes in results.media.episodes %}
|
{% for season, episodes in results.media.episodes %}
|
||||||
@@ -35,7 +35,9 @@
|
|||||||
{% for episode in episodes %}
|
{% for episode in episodes %}
|
||||||
<div class="results {{ (active == false) ? 'hidden' }}"
|
<div class="results {{ (active == false) ? 'hidden' }}"
|
||||||
data-tv-results-loading-icon-outlet=".loading-icon"
|
data-tv-results-loading-icon-outlet=".loading-icon"
|
||||||
|
data-download-button-outlet=".download-btn"
|
||||||
{{ stimulus_controller('tv_results', {
|
{{ stimulus_controller('tv_results', {
|
||||||
|
title: results.media.title,
|
||||||
tmdbId: results.media.tmdbId,
|
tmdbId: results.media.tmdbId,
|
||||||
imdbId: results.media.imdbId,
|
imdbId: results.media.imdbId,
|
||||||
season: season,
|
season: season,
|
||||||
|
|||||||
@@ -54,10 +54,10 @@
|
|||||||
{{ result.languageFlags|raw }}
|
{{ result.languageFlags|raw }}
|
||||||
</td>
|
</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">
|
<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', {
|
{{ stimulus_controller('download_button', {
|
||||||
url: result.url,
|
url: result.url,
|
||||||
title: result.title,
|
title: results.media.title,
|
||||||
filename: result.filename,
|
filename: result.filename,
|
||||||
mediaType: results.media.mediaType,
|
mediaType: results.media.mediaType,
|
||||||
imdbId: results.media.imdbId
|
imdbId: results.media.imdbId
|
||||||
|
|||||||
Reference in New Issue
Block a user