wip: working 'download selected' button

This commit is contained in:
2025-07-24 16:47:08 -05:00
parent a27fcf334a
commit 65acd5d21b
3 changed files with 28 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
H265_CODECS = ['h265', 'h.265', 'x265', 'hevc']
#downloadBtnEl;
#selectEpisodeInputEl;
url;
size;
@@ -37,8 +38,10 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
this.season = this.getAttribute('season') ?? null;
this.episode = this.getAttribute('episode') ?? null;
this.episodeId = this.getAttribute('episode-id') ?? null;
this.#downloadBtnEl = this.querySelector('.download-btn');
this.#selectEpisodeInputEl = this.querySelector('input[type="checkbox"]');
console.log(this.#selectEpisodeInputEl)
this.#downloadBtnEl.addEventListener('click', () => this.download());
// document.addEventListener('filterDownloadOptions', this.filter.bind(this));
}
@@ -46,6 +49,14 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
}
get isSelected() {
return this.#selectEpisodeInputEl.checked;
}
set isSelected(value) {
this.#selectEpisodeInputEl.checked = value;
}
// attribute change
attributeChangedCallback(property, oldValue, newValue) {
if (oldValue === newValue) return;