fix: fallback de noms si les noms de torrents se ressemble il fallback sur les noms dans nyaa
This commit is contained in:
1 parent
43de4f8071
commit
86df3054dd
1 file changed
+13
-10
+13
-10
@@ -87,7 +87,7 @@
|
|||||||
@click="downloadAll(i); downloadMenuOpen = false"
|
@click="downloadAll(i); downloadMenuOpen = false"
|
||||||
>
|
>
|
||||||
<svg width="11" height="11" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
<svg width="11" height="11" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
|
||||||
{{ integraleLabel(t, i) }}
|
{{ integraleGroupLabels()[i] }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -171,15 +171,18 @@ const _recentlyOrganized = new Set<string>() // hash:fileIndex ou has
|
|||||||
const data = computed(() => store.currentSerie)
|
const data = computed(() => store.currentSerie)
|
||||||
|
|
||||||
// ── Helpers intégrale ─────────────────────────────────────────
|
// ── Helpers intégrale ─────────────────────────────────────────
|
||||||
function integraleLabel(t: any, i: number): string {
|
function integraleGroupLabels(): string[] {
|
||||||
if (t.torrent_name) return t.torrent_name
|
const torrents = data.value?.torrents_integrale ?? []
|
||||||
const raw = t.raw ?? ''
|
const names = torrents.map((t: any) => t.torrent_name ?? null)
|
||||||
const quality = raw.match(/\b(2160p|4K|1080p|720p|480p)\b/i)?.[1]?.toUpperCase()
|
const allPresent = names.every((n: any) => n !== null && String(n).trim() !== '')
|
||||||
const lang = raw.match(/\b(VOSTFR|MULTI|VF|VO|FR|EN)\b/i)?.[1]?.toUpperCase()
|
const allUnique = allPresent && new Set(names).size === names.length
|
||||||
if (quality && lang) return `Intégrale · ${quality} · ${lang}`
|
if (allUnique) return names as string[]
|
||||||
if (quality) return `Intégrale · ${quality}`
|
// Fallback : titre Nyaa brut
|
||||||
if (lang) return `Intégrale · ${lang}`
|
return torrents.map((t: any, i: number) => {
|
||||||
return `Intégrale ${i + 1}`
|
const raw = t.raw ?? ''
|
||||||
|
if (raw) return raw.length > 65 ? raw.slice(0, 65) + '…' : raw
|
||||||
|
return `Intégrale ${i + 1}`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Épisodes couverts par une intégrale donnée (hash commun)
|
// Épisodes couverts par une intégrale donnée (hash commun)
|
||||||
|
|||||||
Reference in new issue
Block a user