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

@ -132,10 +132,15 @@ export class LastFmScrobbler extends ScrobblerBase {
? songInfo.alternativeTitle
: songInfo.title;
const artist =
config.alternativeArtist && songInfo.tags?.at(0) !== undefined
? songInfo.tags?.at(0)
: songInfo.artist;
const postData: LastFmSongData = {
track: title,
duration: songInfo.songDuration,
artist: songInfo.artist,
artist: artist,
...(songInfo.album ? { album: songInfo.album } : undefined), // Will be undefined if current song is a video
api_key: config.scrobblers.lastfm.apiKey,
sk: config.scrobblers.lastfm.sessionKey,

View File

@ -81,8 +81,13 @@ function createRequestBody(
? songInfo.alternativeTitle
: songInfo.title;
const artist =
config.alternativeArtist && songInfo.tags?.at(0) !== undefined
? songInfo.tags?.at(0)
: songInfo.artist;
const trackMetadata = {
artist_name: songInfo.artist,
artist_name: artist,
track_name: title,
release_name: songInfo.album ?? undefined,
additional_info: {