From fbcfb079375401337eb923719e9496f74a85bae2 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Wed, 5 Jan 2022 07:57:25 -0800 Subject: [PATCH] another ratings fix --- src/renderer/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 51181508..524fee04 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2592,10 +2592,11 @@ const app = new Vue({ async getRating(item) { let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id - if (id.startsWith("i.")) { + if (item.id.startsWith("i.")) { if(!type.startsWith("library-")) { type = "library-" + type } + id = item.id } let response = await this.mk.api.v3.music(`/v1/me/ratings/${type}?platform=web&ids=${id}`) if(response.data.data.length != 0) { @@ -2608,10 +2609,11 @@ const app = new Vue({ love(item) { let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id - if (id.startsWith("i.")) { + if (item.id.startsWith("i.")) { if(!type.startsWith("library-")) { type = "library-" + type } + id = item.id } this.mk.api.v3.music(`/v1/me/ratings/${type}/${id}`, {}, { fetchOptions: @@ -2631,10 +2633,11 @@ const app = new Vue({ dislike(item) { let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id - if (id.startsWith("i.")) { + if (item.id.startsWith("i.")) { if(!type.startsWith("library-")) { type = "library-" + type } + id = item.id } this.mk.api.v3.music(`/v1/me/ratings/${type}/${id}`, {}, { fetchOptions: @@ -2654,10 +2657,11 @@ const app = new Vue({ unlove(item) { let type = item.type.slice(-1) === "s" ? item.type : item.type + "s" let id = item.attributes.playParams.catalogId ? item.attributes.playParams.catalogId : item.id - if (id.startsWith("i.")) { + if (item.id.startsWith("i.")) { if(!type.startsWith("library-")) { type = "library-" + type } + id = item.id } this.mk.api.v3.music(`/v1/me/ratings/${type}/${id}`, {}, { fetchOptions: