fix: n'affiche plus tous les épisodes en train de se telecharger si seulement un fichier est selectionner
This commit is contained in:
1 parent
1b2036b57b
commit
c9534c2011
2 files changed
+11
-1
No files matched your search
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
<!-- Boutons saison -->
|
<!-- Boutons saison -->
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
|
<!-- Pas de pack saison : bouton "Saison" qui déclenche les épisodes individuels -->
|
||||||
<button
|
<button
|
||||||
v-if="!season.torrent && hasDownloadable"
|
v-if="!season.torrent && hasDownloadable"
|
||||||
@click="emit('downloadSeason', season)"
|
@click="emit('downloadSeason', season)"
|
||||||
@@ -38,10 +39,12 @@
|
|||||||
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border bg-accent-muted text-accent border-accent/20 hover:bg-accent/20 transition"
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border bg-accent-muted text-accent border-accent/20 hover:bg-accent/20 transition"
|
||||||
>
|
>
|
||||||
<component :is="downloadingSeason ? loaderIcon : downloadIcon" />
|
<component :is="downloadingSeason ? loaderIcon : downloadIcon" />
|
||||||
{{ downloadingSeason ? 'Envoi…' : 'Tout télécharger' }}
|
{{ downloadingSeason ? 'Envoi…' : 'Saison' }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!-- Pack saison disponible -->
|
||||||
<button
|
<button
|
||||||
|
v-if="season.torrent"
|
||||||
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition"
|
class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition"
|
||||||
:class="canDownloadSeason
|
:class="canDownloadSeason
|
||||||
? 'bg-accent-muted text-accent border-accent/20 hover:bg-accent/20'
|
? 'bg-accent-muted text-accent border-accent/20 hover:bg-accent/20'
|
||||||
@@ -194,6 +197,10 @@ function torrentProgress(hash: string | null | undefined): ActiveTorrent | null
|
|||||||
function isDownloading(key: string) { return props.downloading.includes(key) }
|
function isDownloading(key: string) { return props.downloading.includes(key) }
|
||||||
function isDownloaded(key: string) { return props.downloaded.includes(key) }
|
function isDownloaded(key: string) { return props.downloaded.includes(key) }
|
||||||
function isAlreadyQueued(torrent: any): boolean {
|
function isAlreadyQueued(torrent: any): boolean {
|
||||||
|
// Pour un fichier dans un pack (file_index défini), le hash seul ne suffit pas :
|
||||||
|
// le pack peut être actif sans que CE fichier spécifique soit en téléchargement.
|
||||||
|
// On s'appuie uniquement sur downloading/downloaded pour ces cas.
|
||||||
|
if (torrent?.file_index != null) return false
|
||||||
const hash = extractHash(torrent)
|
const hash = extractHash(torrent)
|
||||||
if (!hash) return false
|
if (!hash) return false
|
||||||
return props.activeTorrents.some(t => t.hash.toLowerCase() === hash.toLowerCase())
|
return props.activeTorrents.some(t => t.hash.toLowerCase() === hash.toLowerCase())
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ function extractHash(torrent: any): string | null {
|
|||||||
return m ? m[1].toLowerCase() : null
|
return m ? m[1].toLowerCase() : null
|
||||||
}
|
}
|
||||||
function isAlreadyQueued(torrent: any): boolean {
|
function isAlreadyQueued(torrent: any): boolean {
|
||||||
|
// Pour un fichier dans un pack (file_index défini), le hash seul ne suffit pas :
|
||||||
|
// le pack peut être actif sans que CE fichier spécifique soit en téléchargement.
|
||||||
|
if (torrent?.file_index != null) return false
|
||||||
const hash = extractHash(torrent)
|
const hash = extractHash(torrent)
|
||||||
if (!hash) return false
|
if (!hash) return false
|
||||||
return activeTorrents.value.some(t => t.hash.toLowerCase() === hash.toLowerCase())
|
return activeTorrents.value.some(t => t.hash.toLowerCase() === hash.toLowerCase())
|
||||||
|
|||||||
Reference in new issue
Block a user