|
@ -220,6 +220,7 @@ export const getAlbums = async (options: any, coverArtSize = 150) => { |
|
|
albumId: entry.id, |
|
|
albumId: entry.id, |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
starred: entry.starred || undefined, |
|
|
starred: entry.starred || undefined, |
|
|
|
|
|
type: 'album', |
|
|
index, |
|
|
index, |
|
|
})), |
|
|
})), |
|
|
}; |
|
|
}; |
|
@ -236,6 +237,7 @@ export const getAlbumsDirect = async (options: any, coverArtSize = 150) => { |
|
|
albumId: entry.id, |
|
|
albumId: entry.id, |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
starred: entry.starred || undefined, |
|
|
starred: entry.starred || undefined, |
|
|
|
|
|
type: 'album', |
|
|
index, |
|
|
index, |
|
|
}) |
|
|
}) |
|
|
); |
|
|
); |
|
@ -267,6 +269,7 @@ export const getAllAlbums = ( |
|
|
albumId: entry.id, |
|
|
albumId: entry.id, |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
image: getCoverArtUrl(entry, coverArtSize), |
|
|
starred: entry.starred || undefined, |
|
|
starred: entry.starred || undefined, |
|
|
|
|
|
type: 'album', |
|
|
index, |
|
|
index, |
|
|
})); |
|
|
})); |
|
|
} |
|
|
} |
|
@ -290,6 +293,7 @@ export const getAlbum = async (id: string, coverArtSize = 150) => { |
|
|
return { |
|
|
return { |
|
|
...data.album, |
|
|
...data.album, |
|
|
image: getCoverArtUrl(data.album, coverArtSize), |
|
|
image: getCoverArtUrl(data.album, coverArtSize), |
|
|
|
|
|
type: 'album', |
|
|
song: (data.album.song || []).map((entry: any, index: any) => ({ |
|
|
song: (data.album.song || []).map((entry: any, index: any) => ({ |
|
|
...entry, |
|
|
...entry, |
|
|
streamUrl: getStreamUrl(entry.id), |
|
|
streamUrl: getStreamUrl(entry.id), |
|
@ -328,7 +332,11 @@ export const getArtists = async () => { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
artists.map((artist: any) => |
|
|
artists.map((artist: any) => |
|
|
artistList.push({ ...artist, image: getCoverArtUrl(artist, 150) }) |
|
|
artistList.push({ |
|
|
|
|
|
...artist, |
|
|
|
|
|
image: getCoverArtUrl(artist, 150), |
|
|
|
|
|
type: 'artist', |
|
|
|
|
|
}) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
return artistList; |
|
|
return artistList; |
|
@ -384,7 +392,7 @@ export const getScanStatus = async () => { |
|
|
export const star = async (id: string, type: string) => { |
|
|
export const star = async (id: string, type: string) => { |
|
|
const { data } = await api.get(`/star`, { |
|
|
const { data } = await api.get(`/star`, { |
|
|
params: { |
|
|
params: { |
|
|
id: type === 'song' ? id : undefined, |
|
|
id: type === 'music' ? id : undefined, |
|
|
albumId: type === 'album' ? id : undefined, |
|
|
albumId: type === 'album' ? id : undefined, |
|
|
artistId: type === 'artist' ? id : undefined, |
|
|
artistId: type === 'artist' ? id : undefined, |
|
|
}, |
|
|
}, |
|
@ -396,7 +404,7 @@ export const star = async (id: string, type: string) => { |
|
|
export const unstar = async (id: string, type: string) => { |
|
|
export const unstar = async (id: string, type: string) => { |
|
|
const { data } = await api.get(`/unstar`, { |
|
|
const { data } = await api.get(`/unstar`, { |
|
|
params: { |
|
|
params: { |
|
|
id: type === 'song' ? id : undefined, |
|
|
id: type === 'music' ? id : undefined, |
|
|
albumId: type === 'album' ? id : undefined, |
|
|
albumId: type === 'album' ? id : undefined, |
|
|
artistId: type === 'artist' ? id : undefined, |
|
|
artistId: type === 'artist' ? id : undefined, |
|
|
}, |
|
|
}, |
|
|