This commit is contained in:
booploops 2022-01-05 03:20:21 -08:00
parent e8142f0271
commit 6e033e90aa

View file

@ -2591,9 +2591,12 @@ const app = new Vue({
},
async getRating(item) {
let type = item.type.slice(-1) === "s" ? item.type : item.type + "s"
// if item.id starts with "i." put "library-" in front of the type if type does not already have that
if (item.id.startsWith("i.")) {
if(!type.startsWith("library-")) {
type = "library-" + type
}
}
let response = await this.mk.api.v3.music(`/v1/me/ratings/${type}?platform=web&ids=${item.id}`)
if(response.data.data.length != 0) {
let value = response.data.data[0].attributes.value