Backfill device song metadata and queue guarded server caching
This commit is contained in:
@@ -687,14 +687,14 @@ export function registerNoteRoutes(app, deps) {
|
||||
// Saved (server-cached) videos with whether each already has lyrics — the
|
||||
// work list for batch lyric injection.
|
||||
app.get('/api/admin/media', requireAdminOrToken, async (c) => {
|
||||
const rows = (await db.listMedia()).filter((r) => r.status === 'ready');
|
||||
const rows = await db.listMedia();
|
||||
const out = [];
|
||||
for (const r of rows) {
|
||||
let meta = {};
|
||||
try { meta = JSON.parse(r.meta || '{}'); } catch { /* corrupt meta */ }
|
||||
const n = await db.getNotes(r.video_id);
|
||||
out.push({
|
||||
id: r.video_id, title: meta.title || '', channel: meta.channel || meta.uploader || '',
|
||||
id: r.video_id, cacheStatus: r.status, title: meta.title || '', channel: meta.channel || meta.uploader || '',
|
||||
duration: Number(r.duration) || 0, lastAccess: Number(r.last_access) || 0,
|
||||
lyricsRev: n.lyrics ? n.lyrics.rev : 0, lyricsLines: n.lyrics ? n.lyrics.data.lines.length : 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user