Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple album artists #115

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Expand Up @@ -77,12 +78,12 @@
methods: {
playNow() {
return this.$store.dispatch('player/playNow', {
tracks: this.album!.tracks,

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

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
})
},
shuffleNow() {
return this.$store.dispatch('player/shuffleNow', {
tracks: this.album!.tracks,

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

View workflow job for this annotation

GitHub Actions / build

Forbidden non-null assertion
})
},
setNextInQueue() {
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
Loading