diff --git a/src/library/album/AlbumDetails.vue b/src/library/album/AlbumDetails.vue
index db5e27d..591bea6 100644
--- a/src/library/album/AlbumDetails.vue
+++ b/src/library/album/AlbumDetails.vue
@@ -7,21 +7,42 @@
-
- by
-
- ,
- {{ artist.name }}
-
- • {{ album.year }}
- •
-
- ,
- {{ genre }}
-
+
+
+ by
+
+ ,
+
+ {{ artist.name }}
+
+
+
+
• {{ album.year }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ •
+
+ {{ genre }}
+
-
-
+
+
+
+ {{ album.description }}
+
+
+
Play
@@ -50,9 +71,15 @@
import TrackList from '@/library/track/TrackList.vue'
import { Album } from '@/shared/api'
import { useFavouriteStore } from '@/library/favourite/store'
+ import IconLastFm from '@/shared/components/IconLastFm.vue'
+ import IconMusicBrainz from '@/shared/components/IconMusicBrainz.vue'
+ import OverflowFade from '@/shared/components/OverflowFade.vue'
export default defineComponent({
components: {
+ OverflowFade,
+ IconMusicBrainz,
+ IconLastFm,
TrackList,
},
props: {
diff --git a/src/shared/api.ts b/src/shared/api.ts
index 59a2b63..e854a6a 100644
--- a/src/shared/api.ts
+++ b/src/shared/api.ts
@@ -33,11 +33,14 @@ export interface Genre {
export interface Album {
id: string
name: string
+ description?: string
artists: {name: string, id: string}[]
year: number
favourite: boolean
genres: Genre[]
image?: string
+ lastFmUrl?: string
+ musicBrainzUrl?: string
tracks?: Track[]
}
@@ -244,8 +247,11 @@ export class API {
async getAlbumDetails(id: string): Promise
{
const params = { id }
- const data = await this.fetch('rest/getAlbum', params)
- return this.normalizeAlbum(data.album)
+ const [info, info2] = await Promise.all([
+ this.fetch('rest/getAlbum', params),
+ this.fetch('rest/getAlbumInfo2', params),
+ ])
+ return this.normalizeAlbum({ ...info.album, ...info2.albumInfo })
}
async getPlaylists() {
@@ -549,6 +555,7 @@ export class API {
return {
id: item.id,
name: item.name,
+ description: (item.notes || '').replace(/]*>.*?<\/a>/gm, ''),
artists: item.artists?.length
? item.artists
: [{ id: item.artistId, name: item.artist }],
@@ -556,6 +563,10 @@ export class API {
year: item.year || 0,
favourite: !!item.starred,
genres: this.normalizeGenres(item),
+ lastFmUrl: item.lastFmUrl,
+ musicBrainzUrl: item.musicBrainzId
+ ? `https://musicbrainz.org/album/${item.musicBrainzId}`
+ : undefined,
tracks: (item.song || []).map(this.normalizeTrack, this)
}
}