feat(launcher): show cover art icons in rofi history picker

- Add history-art.ts: materializeCoverArt extracts cover blobs from stats DB to ~/.cache/subminer/covers
- Query cover_blob_hash in history-db with fallback via shared anime_id
- Backfill cover hash from older rows of the same series in groupHistoryBySeries
- Pass icons to rofi via null-separator protocol (\0icon\x1f<path>)
This commit is contained in:
2026-07-05 02:14:44 -07:00
parent 2f16df8d17
commit 33d9a7890d
8 changed files with 294 additions and 7 deletions
+13 -2
View File
@@ -30,11 +30,22 @@ export function groupHistoryBySeries(
for (const row of sorted) {
const seriesRoot = resolveSeriesRoot(row.sourcePath);
if (byRoot.has(seriesRoot)) continue;
const existing = byRoot.get(seriesRoot);
if (existing) {
if (existing.coverBlobHash === null && row.coverBlobHash !== null) {
existing.coverBlobHash = row.coverBlobHash;
}
continue;
}
if (!existsFn(seriesRoot)) continue;
const displayName =
row.parsedTitle?.trim() || row.animeTitle?.trim() || path.basename(seriesRoot);
byRoot.set(seriesRoot, { seriesRoot, displayName, lastWatched: row });
byRoot.set(seriesRoot, {
seriesRoot,
displayName,
lastWatched: row,
coverBlobHash: row.coverBlobHash,
});
}
return Array.from(byRoot.values());