mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
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:
@ -13,11 +13,17 @@ export interface ScrobblerPluginConfig {
|
||||
*/
|
||||
scrobbleOtherMedia: boolean;
|
||||
/**
|
||||
* Use alternative titles for scrobbling (Useful for non-roman song titles)
|
||||
* Use alternative titles for scrobbling (Useful for non-roman song titles, e.g. (Not) A Devil -> デビルじゃないもん)
|
||||
*
|
||||
* @default false
|
||||
* @default true
|
||||
*/
|
||||
alternativeTitles: boolean;
|
||||
/**
|
||||
* Use alternative artist for scrobbling (e.g., DECO27 & (or) PinocchioP -> DECO27 / marasy -> まらしぃ)
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
alternativeArtist: boolean;
|
||||
scrobblers: {
|
||||
lastfm: {
|
||||
/**
|
||||
@ -77,7 +83,8 @@ export interface ScrobblerPluginConfig {
|
||||
export const defaultConfig: ScrobblerPluginConfig = {
|
||||
enabled: false,
|
||||
scrobbleOtherMedia: true,
|
||||
alternativeTitles: false,
|
||||
alternativeTitles: true,
|
||||
alternativeArtist: true,
|
||||
scrobblers: {
|
||||
lastfm: {
|
||||
enabled: false,
|
||||
|
||||
@ -105,6 +105,15 @@ export const onMenu = async ({
|
||||
setConfig(config);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('plugins.scrobbler.menu.scrobble-alternative-artist'),
|
||||
type: 'checkbox',
|
||||
checked: Boolean(config.alternativeArtist),
|
||||
click(item) {
|
||||
config.alternativeArtist = item.checked;
|
||||
setConfig(config);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Last.fm',
|
||||
submenu: [
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user