feat: matchedAlbum.webUrl from subsonic settings; remove stream proxy routes
This commit is contained in:
@@ -51,34 +51,4 @@ describe('last_played_at stamping', () => {
|
||||
expect(row.last_played_at).toBe('2026-09-01T10:00:00Z')
|
||||
await app.close()
|
||||
})
|
||||
|
||||
it('played endpoint stamps now and returns 404 for unknown albums', async () => {
|
||||
const app = await buildTestApp()
|
||||
const cookie = await setupAdmin(app)
|
||||
await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/library/albums/test-seed',
|
||||
...auth(cookie),
|
||||
payload: { albums: [{ subsonicId: 'a1', title: 'Motion', artist: 'TCO' }] },
|
||||
})
|
||||
const before = (
|
||||
app.db.prepare("SELECT last_played_at FROM digital_albums WHERE subsonic_id = 'a1'").get() as {
|
||||
last_played_at: string | null
|
||||
}
|
||||
).last_played_at
|
||||
expect(before).toBeNull()
|
||||
|
||||
const res = await app.inject({ method: 'POST', url: '/api/album/a1/played', ...auth(cookie) })
|
||||
expect(res.statusCode).toBe(200)
|
||||
const after = (
|
||||
app.db.prepare("SELECT last_played_at FROM digital_albums WHERE subsonic_id = 'a1'").get() as {
|
||||
last_played_at: string | null
|
||||
}
|
||||
).last_played_at
|
||||
expect(after).toBeTruthy()
|
||||
|
||||
const missing = await app.inject({ method: 'POST', url: '/api/album/zzz/played', ...auth(cookie) })
|
||||
expect(missing.statusCode).toBe(404)
|
||||
await app.close()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user