From 3a65a4bb39c2e002e8a74fe0d64669d0489f1780 Mon Sep 17 00:00:00 2001 From: MasutaYunikon Date: Thu, 16 Apr 2026 18:49:21 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20le=20bouton=20"tous=20t=C3=A9l=C3=A9char?= =?UTF-8?q?ger"=20ne=20s'affiche=20plus=20si=20la=20series=20de=20contient?= =?UTF-8?q?=20que=20des=20integrales=20comme=20torrent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/SerieView.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/views/SerieView.vue b/src/views/SerieView.vue index 090f1d2..afa51c1 100644 --- a/src/views/SerieView.vue +++ b/src/views/SerieView.vue @@ -19,7 +19,7 @@ :serie="data.serie" :torrents-integrale="data.torrents_integrale" :organized-by-episode="organizedByEpisode" - :has-downloadable-torrents="hasDownloadableTorrents" + :has-downloadable-torrents="hasNonIntegraleDownloadables" :downloading-all="downloadingAll" :active-torrents="activeTorrents" :downloading="downloading" @@ -181,6 +181,24 @@ function collectDownloadables() { const hasDownloadableTorrents = computed(() => collectDownloadables().length > 0) +// "Tout télécharger" ne s'affiche que s'il y a des torrents saison/épisode à lancer +// (les intégrales ont déjà leurs propres boutons dédiés dans le hero) +const hasNonIntegraleDownloadables = computed(() => { + if (!data.value) return false + const covered = new Set() + data.value.torrents_integrale.forEach((t: any, i: number) => { + if (!isAlreadyQueued(t) && !isDownloaded(`integrale-${i}`)) + for (const season of data.value!.seasons) for (const ep of season.episodes) covered.add(ep.id) + }) + for (const season of data.value.seasons) { + if (season.torrent && !isAlreadyQueued(season.torrent) && !isDownloaded(`season-${season.id}`) && season.organized_state !== 'complete') return true + for (const ep of season.episodes) { + if (ep.torrent && ep.available && !ep.organized && !isAlreadyQueued(ep.torrent) && !isDownloaded(`ep-${ep.id}`) && !covered.has(ep.id)) return true + } + } + return false +}) + async function downloadAll() { downloadingAll.value = true const torrents = collectDownloadables()