add star album
This commit is contained in:
parent
4e0f49792c
commit
a6fab92165
@ -18,6 +18,9 @@
|
|||||||
<b-btn variant="secondary" class="mr-2" @click="play">
|
<b-btn variant="secondary" class="mr-2" @click="play">
|
||||||
<Icon icon="play-fill" /> Play
|
<Icon icon="play-fill" /> Play
|
||||||
</b-btn>
|
</b-btn>
|
||||||
|
<b-btn variant="secondary" class="mr-2" @click="toggleStar">
|
||||||
|
<Icon :icon="album.starred ? 'star-fill' : 'star'" />
|
||||||
|
</b-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,6 +65,15 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleStar() {
|
||||||
|
if (this.album) {
|
||||||
|
const value = !this.album.starred
|
||||||
|
this.album.starred = value
|
||||||
|
return value
|
||||||
|
? this.$api.starAlbum(this.album.id)
|
||||||
|
: this.$api.unstarAlbum(this.album.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -215,6 +215,14 @@ export class API {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
starAlbum(id: string) {
|
||||||
|
return this.star('album', id)
|
||||||
|
}
|
||||||
|
|
||||||
|
unstarAlbum(id: string) {
|
||||||
|
return this.unstar('album', id)
|
||||||
|
}
|
||||||
|
|
||||||
async star(type: 'track' | 'album' | 'artist', id: string) {
|
async star(type: 'track' | 'album' | 'artist', id: string) {
|
||||||
const params = {
|
const params = {
|
||||||
id: type === 'track' ? id : undefined,
|
id: type === 'track' ? id : undefined,
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
BIcon,
|
BIcon,
|
||||||
BIconCardText,
|
BIconCardText,
|
||||||
BIconMusicNoteList,
|
BIconMusicNoteList,
|
||||||
|
BIconStar,
|
||||||
BIconStarFill,
|
BIconStarFill,
|
||||||
BIconCollectionFill,
|
BIconCollectionFill,
|
||||||
BIconList,
|
BIconList,
|
||||||
@ -27,6 +28,7 @@
|
|||||||
BIcon,
|
BIcon,
|
||||||
BIconCardText,
|
BIconCardText,
|
||||||
BIconMusicNoteList,
|
BIconMusicNoteList,
|
||||||
|
BIconStar,
|
||||||
BIconStarFill,
|
BIconStarFill,
|
||||||
BIconCollectionFill,
|
BIconCollectionFill,
|
||||||
BIconList,
|
BIconList,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user