Refetch missing media from catalog source
This commit is contained in:
@@ -57,6 +57,8 @@ beforeAll(async () => {
|
||||
backupDir: join(root, 'backups'),
|
||||
adminHtmlPath: htmlPath,
|
||||
workerToken: 'w'.repeat(32),
|
||||
catalog: { getSourceUrl: async id => /^[\w-]{11}$/.test(id) ? `https://www.youtube.com/watch?v=${id}` : null },
|
||||
media: { redownload: async id => ({ status: `queued:${id}` }) },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -278,5 +280,7 @@ test('admin song list includes metadata-only phone songs for lyrics lookup', asy
|
||||
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' });
|
||||
expect(song).toMatchObject({ title: 'Phone song', channel: 'Phone artist', duration: 240, cacheStatus: 'failed', sourceUrl: 'https://www.youtube.com/watch?v=phoneSong01' });
|
||||
expect((await app.request(`/api/admin/media/${id}/redownload`, { method: 'POST', headers: { Cookie: cookie } })).status).toBe(202);
|
||||
expect((await app.request('/api/admin/media/phoneSong01/redownload', { method: 'POST' })).status).toBe(401);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user