mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
feat(music): support album subscription semantics
This commit is contained in:
@@ -81,6 +81,17 @@ describe('music utils', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('does not build a resource route for an artist browsing entity', () => {
|
||||
expect(
|
||||
buildMusicResourceRoute({
|
||||
source: 'musicbrainz',
|
||||
media_id: 'artist-1',
|
||||
music_type: 'artist',
|
||||
title: 'Queen',
|
||||
} as never),
|
||||
).toBeUndefined()
|
||||
})
|
||||
|
||||
it('keeps the entity type inside the list key so albums and tracks never collide', () => {
|
||||
const track = getMusicKey({ source: 'musicbrainz', media_id: 'same-id' })
|
||||
const album = getMusicKey({ source: 'musicbrainz', media_id: 'same-id', music_type: 'album' })
|
||||
|
||||
@@ -63,6 +63,8 @@ export function buildMusicResourceRoute(
|
||||
item: MediaInfo | MusicAlbumInfo,
|
||||
sites: number[] = [],
|
||||
): RouteLocationRaw | undefined {
|
||||
// 艺术家是浏览入口,不是可直接下载的媒体实体。
|
||||
if ((item as MusicRouteTarget).music_type === 'artist') return undefined
|
||||
const source = getMusicSource(item as MusicRouteTarget)
|
||||
if (!source || !item.media_id) return undefined
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user