Skip to content

Commit

Permalink
Merge pull request #115 from sentriz/master
Browse files Browse the repository at this point in the history
Add support for multiple album artists
  • Loading branch information
tamland committed Sep 11, 2023
2 parents 8d5ee61 + 87a00c5 commit f894d5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/library/album/AlbumDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
</h1>
<p>
by
<router-link :to="{name: 'artist', params: { id: album.artistId }}">
{{ album.artist }}
</router-link>
<template v-for="(artist, index) in album.artists">
<span v-if="index > 0" :key="artist.id" class="text-muted">, </span>
<router-link :key="artist.id" :to="{name: 'artist', params: { id: artist.id }}">{{ artist.name }}</router-link>

Check warning on line 14 in src/library/album/AlbumDetails.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break after opening tag (`<router-link>`), but no line breaks found

Check warning on line 14 in src/library/album/AlbumDetails.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break before closing tag (`</router-link>`), but no line breaks found
</template>
<span v-if="album.year"> • {{ album.year }}</span>
<span v-if="album.genreId"> •
<router-link :to="{name: 'genre', params: { id: album.genreId }}">
Expand Down
7 changes: 4 additions & 3 deletions src/library/album/AlbumList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
:draggable="true" @dragstart="dragstart(item.id, $event)"
>
<template #text>
<router-link :to="{name: 'artist', params: { id: item.artistId } }" class="text-muted">
{{ item.artist }}
</router-link>
<template v-for="(artist, index) in item.artists">
<span v-if="index > 0" :key="artist.id" class="text-muted">, </span>
<router-link :key="artist.id" :to="{name: 'artist', params: { id: artist.id }}" class="text-muted">{{ artist.name }}</router-link>

Check warning on line 13 in src/library/album/AlbumList.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break after opening tag (`<router-link>`), but no line breaks found

Check warning on line 13 in src/library/album/AlbumList.vue

View workflow job for this annotation

GitHub Actions / build

Expected 1 line break before closing tag (`</router-link>`), but no line breaks found
</template>
</template>

<template #context-menu>
Expand Down
8 changes: 4 additions & 4 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export interface Track {
export interface Album {
id: string
name: string
artist: string
artistId: string
artists: {name: string, id: string}[]
year: number
favourite: boolean
genreId?: string
Expand Down Expand Up @@ -414,8 +413,9 @@ export class API {
return {
id: item.id,
name: item.name,
artist: item.artist,
artistId: item.artistId,
artists: item.artists?.length
? item.artists
: [{ id: item.artistId, name: item.artist }],
image: this.getCoverArtUrl(item),
year: item.year || 0,
favourite: !!item.starred,
Expand Down

0 comments on commit f894d5e

Please sign in to comment.