feat: updates option count for each episode when filter changes

This commit is contained in:
2025-04-22 13:54:37 -05:00
parent 5c3aa595bf
commit 88851169f9
4 changed files with 28 additions and 29 deletions

View File

@@ -14,16 +14,18 @@ export default class extends Controller {
active: Boolean,
};
static targets = ['list']
static targets = ['list', 'count']
static outlets = ['loading-icon']
options = []
connect() {
if (true === this.activeValue) {
fetch(`/torrentio/tvshows/${this.tmdbIdValue}/${this.imdbIdValue}/${this.seasonValue}/${this.episodeValue}`)
.then(res => res.text())
.then(response => {
this.element.innerHTML = response;
this.options = this.element.querySelectorAll('tbody tr');
this.loadingIconOutlet.increaseCount();
});
}