Backfill device song metadata and queue guarded server caching

This commit is contained in:
Jonathan Sykes
2026-10-03 17:55:49 +08:00
parent 9e960cf70f
commit 856ddda6a6
8 changed files with 187 additions and 7 deletions

View File

@@ -271,3 +271,12 @@ test('secondary and phonetic lyric fields survive validation without changing ol
const result = N.sanitizeLyrics({ lines:[{t:1,text:'主',kind:'line',secondary:' Your grace\n is enough ',phonetic:' zhǔ\u0007 '},{t:2,text:'Legacy',kind:'line'}] });
expect(result.lines[0].secondary).toBe('Your grace\nis enough'); expect(result.lines[0].phonetic).toBe('zhǔ'); expect(result.lines[1]).toEqual({t:2,text:'Legacy',kind:'line'});
});
test('admin song list includes metadata-only phone songs for lyrics lookup', async () => {
const id = 'phoneSong01';
await dbmod.upsertMedia(id, { status: 'failed', duration: 240, meta: JSON.stringify({ title: 'Phone song', channel: 'Phone artist' }) });
const cookie = await adminCookie();
const res = await app.request('/api/admin/media', { headers: { Cookie: cookie } });
const song = (await res.json()).media.find(x => x.id === id);
expect(song).toMatchObject({ title: 'Phone song', channel: 'Phone artist', duration: 240, cacheStatus: 'failed' });
});