feat: matchedAlbum.webUrl from subsonic settings; remove stream proxy routes
This commit is contained in:
@@ -5,6 +5,12 @@ import { discogsReleaseFixture } from './fixtures.js'
|
||||
function discogsStub(): typeof fetch {
|
||||
return (async (input: any) => {
|
||||
const url = String(input)
|
||||
if (url.includes('/rest/ping')) {
|
||||
return new Response(JSON.stringify({ 'subsonic-response': { status: 'ok' } }), {
|
||||
status: 200,
|
||||
headers: { 'content-type': 'application/json' },
|
||||
})
|
||||
}
|
||||
if (url.includes('/releases/1001')) {
|
||||
return new Response(JSON.stringify(discogsReleaseFixture), {
|
||||
status: 200,
|
||||
@@ -220,6 +226,12 @@ describe('collection routes', () => {
|
||||
const detail = await app.inject({ method: 'GET', url: `/api/collection/${id}`, ...auth(cookie) })
|
||||
expect(detail.json().matchedAlbum).toBeNull()
|
||||
|
||||
await app.inject({
|
||||
method: 'PUT',
|
||||
url: '/api/settings',
|
||||
...auth(cookie),
|
||||
payload: { subsonicUrl: 'http://navidrome.local', subsonicUsername: 'sam', subsonicPassword: 'pass' },
|
||||
})
|
||||
await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/library/albums/test-seed',
|
||||
@@ -227,7 +239,10 @@ describe('collection routes', () => {
|
||||
payload: { albums: [{ subsonicId: 'alb-9', title: 'Motion', artist: 'The Cinematic Orchestra' }] },
|
||||
})
|
||||
const again = await app.inject({ method: 'GET', url: `/api/collection/${id}`, ...auth(cookie) })
|
||||
expect(again.json().matchedAlbum).toMatchObject({ subsonicId: 'alb-9', lastPlayedAt: null })
|
||||
expect(again.json().matchedAlbum).toMatchObject({
|
||||
subsonicId: 'alb-9',
|
||||
webUrl: 'http://navidrome.local/app/#/album/alb-9',
|
||||
})
|
||||
await app.close()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user