#82 - Utilisateur artists plutôt que artists_sort

This commit is contained in:
Damien Broqua 2023-03-23 14:30:40 +01:00
parent c743f0d3a4
commit b630e73c79
4 changed files with 33 additions and 12 deletions

View file

@ -21,7 +21,7 @@ Vue.createApp({
showModalDelete: false,
showModalShare: false,
// eslint-disable-next-line no-undef
shareLink: `${protocol}//${host}/collection/${userId}`,
shareLink: `/collection/${userId}`,
// eslint-disable-next-line no-undef
isPublicCollection,
// eslint-disable-next-line no-undef
@ -67,7 +67,7 @@ Vue.createApp({
let url = `/api/v1/albums?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if (this.artist) {
url += `&artists_sort=${this.formatParams(this.artist)}`;
url += `&artist=${this.formatParams(this.artist)}`;
}
if (this.format) {
url += `&format=${this.formatParams(this.format)}`;
@ -218,5 +218,20 @@ Vue.createApp({
this.toggleModalShare();
});
},
renderAlbumTitle(item) {
let render = '';
for ( let i = 0 ; i < item.artists.length ; i += 1 ) {
const {
name,
join,
} = item.artists[i];
render += `${name} ${join ? `${join} ` : ''}`;
}
render += `- ${item.title}`;
return render;
}
},
}).mount("#collection");