feat: show library entries when searching specific episode while offline

This commit is contained in:
ThaUnknown 2025-06-28 23:48:25 +02:00
parent d611e4662d
commit f9105e5433
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "6.4.7",
"version": "6.4.8",
"license": "BUSL-1.1",
"private": true,
"packageManager": "pnpm@9.14.4",

View file

@ -118,6 +118,14 @@ export const extensions = new class Extensions {
}
}
if (!navigator.onLine) {
const library = await native.library()
const entry = library.find(lib => lib.mediaID === media.id && lib.episode === episode)
if (entry) {
results.push({ accuracy: 'high', date: new Date(entry.date), downloads: 0, hash: entry.hash, extension: new Set(['local']), leechers: 0, link: entry.hash, seeders: 0, size: entry.size, title: entry.name ?? entry.hash, type: entry.files > 1 ? 'batch' : undefined, parseObject: {} as unknown as AnitomyResult })
}
}
debug(`Found ${results.length} results`)
const deduped = this.dedupe(results)