UNPKG

@animepaste/bangumi

Version:
23 lines (21 loc) 518 B
function getBgmId(bgm) { for (const site of bgm.sites) { if (site.site === "bangumi") { return site.id; } } } function getBgmDmhy(bgm) { for (const site of bgm.sites) { if (site.site === "dmhy") { return site.id; } } } function getBgmTitle(bgm, locale = "zh-Hans") { return bgm.titleTranslate[locale]?.[0] ?? bgm.title; } function getBgmLink(bgmId) { return "https://bangumi.tv/subject/" + bgmId; } export { getBgmDmhy as a, getBgmTitle as b, getBgmLink as c, getBgmId as g };