TheQwertiest / foo_discord_rich

foobar2000 component for integration with Discord Rich Presence
https://theqwertiest.github.io/foo_discord_rich/
MIT License
405 stars 40 forks source link

Chinese characters in metadata returns 'error 4000' and does not update status #54

Closed SoSheolH closed 1 month ago

SoSheolH commented 2 months ago

Have an album where metadata fields include both the original Mandarin and English versions in brackets, and despite enabling UTF-8 in Windows, the plugin refuses to update my status and spits out the following in the console:

Opening track for playback: "C:\Users\flam1\Music\假假條 (JaJaTao)\時代在召喚 (The Rite of Spring)\05 年 (Year).flac" Discord Rich Presence Integration v1.3.0-beta+f6c78e4: error 4000 child "activity" fails because [child "assets" fails because [child "large_image" fails because ["large_image" length must be less than or equal to 256 characters long]]]

TheQwertiest commented 1 month ago

Can you provide the problematic track please? So that I can catch and debug the issue.

s0hv commented 1 month ago

@TheQwertiest If this is the same bug I've fixed, it has to do with multi byte characters.

This commit should point you to the right direction. https://github.com/s0hv/foo_discord_rich/commit/2140d2c08907c878d812f892657232eab5294493

TheQwertiest commented 1 month ago

@s0hv could you please describe the problem that you were fixing with your commit? I've tried using various multibyte UTF8 chars (e.g. emoji) and it worked fine for me (discord didn't reject it, that is)

s0hv commented 1 month ago

@TheQwertiest I might've misremembered the thing I fixed. It was related to the text being too short instead of too long. Discussion related to that can be found here but I'm currently unable to test if the character mentioned in the thread causes problems for long strings as well https://github.com/s0hv/foo_discord_rich/discussions/6#discussioncomment-4947883

TheQwertiest commented 1 month ago

Thanks! This actually reproduced the issue for me - seems that emoji handling is different from kanji...

TheQwertiest commented 1 month ago

@SoSheolH Reading your description more carefully, it seems that the problem is not with the original version of foo_discord_rich (this repo), but with s0hv's fork (perhaps in image upload implementation?).

Thus I'm closing this issue as invalid, since there's nothing to be done.