fix(discord-rpc, scrobbler): Align artist and title with the last.fm's de facto standard

- Display only the main artist.
- Display the title in its original language without romanization.

- fix #3358
- fix #3641
This commit is contained in:
JellyBrick
2025-09-06 10:25:54 +09:00
parent 555817e2f5
commit 26fa1f85b2
10 changed files with 61 additions and 39 deletions

View File

@ -3,7 +3,8 @@ import { fileURLToPath } from 'node:url';
import { globSync } from 'glob';
import { Project } from 'ts-morph';
import { Platform } from '../src/types/plugins'
import { Platform } from '../src/types/plugins';
const kebabToCamel = (text: string) =>
text.replace(/-(\w)/g, (_, letter: string) => letter.toUpperCase());
@ -75,7 +76,7 @@ export const pluginVirtualModuleGenerator = (
}
writer.blankLine();
if (mode === "main" || mode === "preload") {
if (mode === 'main' || mode === 'preload') {
writer.writeLine("import * as is from 'electron-is';");
writer.writeLine('globalThis.electronIs = is;');
}
@ -137,7 +138,7 @@ export const pluginVirtualModuleGenerator = (
};
function supportsPlatform({ platform }: { platform: string }) {
if (typeof platform !== "number") return true;
if (typeof platform !== 'number') return true;
const is = globalThis.electronIs;