Repository navigation
Fix #500: Genius, Musixmatch and LRCLIB receive malformed response - #508
victorwon2001 wants to merge 2 commits into
Conversation
|
You mention it fixes lrclib, genius and muximatch but have not changed the code for musixmatch or genius and have not explained how your change fixes those. You've also haven't provided tests to cover the case you're attempting to fix. |
|
Genius, Musixmatch, and LRCLIB do not need separate locale fixes because build/foo_openlyrics.vcxproj compiles the shared 3rdparty/cJSON/cJSON.c implementation with ENABLE_LOCALES, and all three sources use that same implementation through cJSON_Parse or cJSON_ParseWithLength. The regression test cjson_parses_source_responses_with_comma_decimal_locale in src/sources/lrclib.cpp directly covers representative responses for all three sources under a comma-decimal locale and restores LC_NUMERIC afterward. The x86/x64 Build & test checks on GitHub head 1fb54f2 were successful; this later follow-up has not yet received those GitHub runs. Separately, the independent local comma-locale cJSON harness passed. |
|
I see, although I find your commit messages pretty non-descriptive. So I gather your problem is that the parsing functions used by cJSON are locale-aware by default and you want it to not be locale-aware so that it will always correctly parse Also, a quick search is not finding me any documentation on |
|
Almost, but the direction is the opposite: Upstream references:
That is also why Genius and Musixmatch do not need separate changes: this project compiles one shared |
|
Aha, I see ok awesome. Sure that's fine. The only thing I'd like to see added is a comment explaining what you just explained here (but in the code so its easy to find in future). The problem is just that I'm not sure where the best place to put it is, because really the comment applies to the macro in the build config. I forget off the top of my head, does the build for cjson also include the precompiled headers? If it does then maybe its better to put the |
|
I didn't even stop to think that issue I had could be connected to the locale! I do have a locale that uses a comma for decimal. Hopefully this gets merged, the plugin is basically unusable without it (haven't seen it fetch a single lyric from the web in a long while). |
Fixes #500
Implementation summary
Enabled locale-aware cJSON parsing and added regression coverage for Genius, Musixmatch, and LRCLIB-shaped responses under a comma-decimal locale.
Changes
Testing