From 1aec27bc839b0ddcdeb3bd2ad1f5b938d42d4f8e Mon Sep 17 00:00:00 2001 From: vapormusic Date: Fri, 18 Feb 2022 21:38:30 +0700 Subject: [PATCH] fix #474 --- src/renderer/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index e208b8e4..cb2ed420 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -3253,8 +3253,8 @@ 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 (item.id.startsWith("i.")) { + let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id) + if (item.id && item.id.startsWith("i.")) { if (!type.startsWith("library-")) { type = "library-" + type } @@ -3270,8 +3270,8 @@ 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 (item.id.startsWith("i.")) { + let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id) + if (item.id && item.id.startsWith("i.")) { if (!type.startsWith("library-")) { type = "library-" + type } @@ -3291,8 +3291,8 @@ 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 (item.id.startsWith("i.")) { + let id = item.attributes?.playParams?.catalogId ? item.attributes.playParams.catalogId : (item.attributes?.playParams?.id ?? item.id) + if (item.id && item.id.startsWith("i.")) { if (!type.startsWith("library-")) { type = "library-" + type }