From d0e0cc8775e5ab33a9dfc305f66ed14337fb3d83 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 10 May 2024 14:16:20 +0800 Subject: [PATCH] Update --- mbz_generate_opencd_info.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mbz_generate_opencd_info.js b/mbz_generate_opencd_info.js index 77f7b11..031aeda 100644 --- a/mbz_generate_opencd_info.js +++ b/mbz_generate_opencd_info.js @@ -1,7 +1,7 @@ // ==UserScript== // @name MusicBrainZ 生成 OpenCD 信息 // @namespace https://github.com/lifegpc/userscript -// @version 0.0.1 +// @version 0.0.2 // @description MusicBrainZ 生成 OpenCD 所需信息 // @author lifegpc // @match https://musicbrainz.org/release/* @@ -11,18 +11,24 @@ const typeI18n = { album: '专辑', single: '单曲', + soundtrack: '原声带', } const areaI18n = { japan: '日本', } const languageI18n = { japanese: '日语', + '[multiple languages]': '[多种语言]', } /**@param {string} type */ function getTypeI18n(type) { - const t = type.toLowerCase(); - const i = typeI18n[t]; - return i ?? type; + const li = []; + const tmp = type.split(" + "); + for (const t of tmp) { + const i = typeI18n[t.toLowerCase()]; + li.push(i ?? t); + } + return li.join(" + ") } function getAreaI18n(area) { const a = area.toLowerCase();