Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a267bab86e | |||
| 9653189bff |
@@ -13,7 +13,6 @@ export default class extends Controller {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static targets = ['list']
|
static targets = ['list']
|
||||||
static outlets = ['loading-icon']
|
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
optionsLoaded = false
|
optionsLoaded = false
|
||||||
@@ -28,7 +27,6 @@ export default class extends Controller {
|
|||||||
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.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
|
||||||
this.resultCountEl.innerText = this.options.length;
|
this.resultCountEl.innerText = this.options.length;
|
||||||
this.loadingIconOutlet.toggleIcon();
|
|
||||||
document.dispatchEvent(new CustomEvent('optionsLoaded', {detail: {options: this.options}}));
|
document.dispatchEvent(new CustomEvent('optionsLoaded', {detail: {options: this.options}}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default class extends Controller {
|
|||||||
defaultOptions = '<option value="-">-</option>';
|
defaultOptions = '<option value="-">-</option>';
|
||||||
|
|
||||||
static outlets = ['tv-episode-list']
|
static outlets = ['tv-episode-list']
|
||||||
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'quality', 'loadingIcon', 'selectAll', 'downloadSelected']
|
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'quality', 'selectAll', 'downloadSelected']
|
||||||
static values = {
|
static values = {
|
||||||
'imdbId': String,
|
'imdbId': String,
|
||||||
'media-type': String,
|
'media-type': String,
|
||||||
@@ -32,7 +32,6 @@ export default class extends Controller {
|
|||||||
|
|
||||||
async connect() {
|
async connect() {
|
||||||
await this.setInitialFilter();
|
await this.setInitialFilter();
|
||||||
this.setTimerToStopLoadingIcon();
|
|
||||||
this.element.filterResults = this.filter.bind(this);
|
this.element.filterResults = this.filter.bind(this);
|
||||||
document.addEventListener('optionsLoaded', this.loadOptions.bind(this));
|
document.addEventListener('optionsLoaded', this.loadOptions.bind(this));
|
||||||
}
|
}
|
||||||
@@ -48,10 +47,6 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimerToStopLoadingIcon() {
|
|
||||||
setTimeout(() => this.loadingIconTarget.hideIcon(), 10000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Event is fired from movies/tvshows controllers to populate this data
|
// Event is fired from movies/tvshows controllers to populate this data
|
||||||
async loadOptions({detail: { options }}) {
|
async loadOptions({detail: { options }}) {
|
||||||
await options.forEach((option) => {
|
await options.forEach((option) => {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export default class extends Controller {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static targets = ['list', 'count', 'episodeSelector',]
|
static targets = ['list', 'count', 'episodeSelector',]
|
||||||
static outlets = ['loading-icon']
|
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
|
|
||||||
@@ -35,6 +34,5 @@ export default class extends Controller {
|
|||||||
this.countTarget.innerText = 0;
|
this.countTarget.innerText = 0;
|
||||||
this.episodeSelectorTarget.disabled = true;
|
this.episodeSelectorTarget.disabled = true;
|
||||||
}
|
}
|
||||||
this.loadingIconOutlet.increaseCount();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,14 +40,8 @@
|
|||||||
{{ form_end(preferences_form) }}
|
{{ form_end(preferences_form) }}
|
||||||
|
|
||||||
<div class="flex flex-col md:flex-row justify-between">
|
<div class="flex flex-col md:flex-row justify-between">
|
||||||
<span
|
|
||||||
{{ stimulus_target('result-filter', 'loadingIcon') }}
|
|
||||||
{{ stimulus_controller('loading_icon', {total: (results.media.mediaType == "tvshows") ? results.media.episodes[1]|length : 1, count: 0}) }}
|
|
||||||
class="loading-icon">
|
|
||||||
<twig:ux:icon name="codex:loader" height="20" width="20" data-loading-icon-target="icon" class="text-end" />
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{% if results.media.mediaType == "tvshows" %}
|
{% if results.media.mediaType == "tvshows" %}
|
||||||
|
<p>Season {{ results.season }}</p>
|
||||||
<div class="flex flex-row gap-2 justify-end px-8">
|
<div class="flex flex-row gap-2 justify-end px-8">
|
||||||
<twig:Modal heading="Back up a sec!" button_text="Download Season" submit_action="{{ stimulus_action('result_filter', 'downloadSeason', 'click')|stimulus_action('dialog', 'close') }}" button_class="px-1.5 py-1 border border-green-500 bg-green-800/60 rounded-ms text-sm font-semibold" show_cancel show_submit>
|
<twig:Modal heading="Back up a sec!" button_text="Download Season" submit_action="{{ stimulus_action('result_filter', 'downloadSeason', 'click')|stimulus_action('dialog', 'close') }}" button_class="px-1.5 py-1 border border-green-500 bg-green-800/60 rounded-ms text-sm font-semibold" show_cancel show_submit>
|
||||||
Downloading an entire season this way will use the filter from your
|
Downloading an entire season this way will use the filter from your
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
{% for episode in this.getEpisodes().items %}
|
{% for episode in this.getEpisodes().items %}
|
||||||
<episode-container id="{{ episode_anchor(episode.seasonNumber, episode.episodeNumber) }}" class="results"
|
<episode-container id="{{ episode_anchor(episode.seasonNumber, episode.episodeNumber) }}" class="results"
|
||||||
show-title="{{ this.title }}"
|
show-title="{{ this.title }}"
|
||||||
data-tv-results-loading-icon-outlet=".loading-icon"
|
|
||||||
data-download-button-outlet=".download-btn"
|
data-download-button-outlet=".download-btn"
|
||||||
{{ stimulus_controller('tv_results', {
|
{{ stimulus_controller('tv_results', {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@@ -32,7 +31,7 @@
|
|||||||
<p>{{ episode.description|truncate }}</p>
|
<p>{{ episode.description|truncate }}</p>
|
||||||
<div class="text-xs font-bold">
|
<div class="text-xs font-bold">
|
||||||
<button class="results-count-badge py-1 px-1.5 mr-1 grow-0 bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white" title="Click to expand the results table for season {{ episode.seasonNumber }} episode {{ episode.episodeNumber }}.">
|
<button class="results-count-badge py-1 px-1.5 mr-1 grow-0 bg-green-600 rounded-lg hover:cursor-pointer hover:bg-green-700 text-white" title="Click to expand the results table for season {{ episode.seasonNumber }} episode {{ episode.episodeNumber }}.">
|
||||||
<span class="results-count-number" {{ stimulus_target('tv-results', 'count') }}>-</span> results
|
<span class="results-count-number" {{ stimulus_target('tv-results', 'count') }}></span> results
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span class="py-1 px-1.5 mr-1 grow-0 bg-gray-700 rounded-lg text-white" title='"{{ episode.name }}" aired on {{ episode.airDate|date(null, 'UTC') }}.'>
|
<span class="py-1 px-1.5 mr-1 grow-0 bg-gray-700 rounded-lg text-white" title='"{{ episode.name }}" aired on {{ episode.airDate|date(null, 'UTC') }}.'>
|
||||||
@@ -72,14 +71,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="results-container inline-block overflow-hidden rounded-lg hidden">
|
<div class="results-container inline-block overflow-hidden rounded-lg hidden">
|
||||||
<twig:Turbo:Frame id="results_{{ episode_id(episode.seasonNumber, episode.episodeNumber) }}" src="{{ path('app_torrentio_tvshows', {
|
<twig:Turbo:Frame loading="lazy" id="results_{{ episode_id(episode.seasonNumber, episode.episodeNumber) }}" src="{{ path('app_torrentio_tvshows', {
|
||||||
tmdbId: this.tmdbId,
|
tmdbId: this.tmdbId,
|
||||||
imdbId: this.imdbId,
|
imdbId: this.imdbId,
|
||||||
season: episode.seasonNumber,
|
season: episode.seasonNumber,
|
||||||
episode: episode.episodeNumber,
|
episode: episode.episodeNumber,
|
||||||
target: 'results_' ~ episode_id(episode.seasonNumber, episode.episodeNumber),
|
target: 'results_' ~ episode_id(episode.seasonNumber, episode.episodeNumber),
|
||||||
block: 'tvshow_results'
|
block: 'tvshow_results'
|
||||||
}) }}" />
|
}) }}">
|
||||||
|
<twig:ux:icon name="codex:loader" height="20" width="20" data-loading-icon-target="icon" class="text-end" />
|
||||||
|
</twig:Turbo:Frame>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</episode-container>
|
</episode-container>
|
||||||
|
|||||||
@@ -125,14 +125,15 @@
|
|||||||
{% if "movies" == results.media.mediaType %}
|
{% if "movies" == results.media.mediaType %}
|
||||||
<movie-container class="results"
|
<movie-container class="results"
|
||||||
{{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}
|
{{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}
|
||||||
data-movie-results-loading-icon-outlet=".loading-icon"
|
|
||||||
>
|
>
|
||||||
<twig:Turbo:Frame id="movie_results_frame" src="{{ path('app_torrentio_movies', {
|
<twig:Turbo:Frame id="movie_results_frame" src="{{ path('app_torrentio_movies', {
|
||||||
tmdbId: results.media.tmdbId,
|
tmdbId: results.media.tmdbId,
|
||||||
imdbId: results.media.imdbId,
|
imdbId: results.media.imdbId,
|
||||||
target: 'movie_results_frame',
|
target: 'movie_results_frame',
|
||||||
block: 'movie_results'
|
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>
|
||||||
{% elseif "tvshows" == results.media.mediaType %}
|
{% elseif "tvshows" == results.media.mediaType %}
|
||||||
<twig:TvEpisodeList
|
<twig:TvEpisodeList
|
||||||
@@ -151,8 +152,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<twig:Card title="Related Media" contentClass="flex flex-col gap-4 text-white">
|
<twig:Card title="Related Media" contentClass="flex flex-col gap-4 text-white">
|
||||||
<p>Results similar to "{{ results.media.title }}" that you may be interested in.</p>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4 md:flex flex-col md:flex-row justify-between w-full">
|
<div class="grid grid-cols-2 gap-4 md:flex flex-col md:flex-row justify-between w-full">
|
||||||
{% for media in results.relatedMedia %}
|
{% for media in results.relatedMedia %}
|
||||||
<twig:Poster imdbId="{{ media.imdbId }}"
|
<twig:Poster imdbId="{{ media.imdbId }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user