Fix broken admin library view if game library contains paths/titles with non-unicode characters#193
Conversation
…on-unicode characters.
…on-unicode characters.
… into fix-non-unicode-titles-in-tasks # Conflicts: # server/internal/library/index.ts
|
Honestly, if you're up for it, a hash (md5/sha256) would be a better option for this. We don't ever need to reverse this, and a hash would make sure we don't get ridiculously long task IDs. |
Thought about this as well, but this requires a third-party library and as I'm not very well versed in the whole js/ts ecosystem with yarn and all that, I felt this was easier. I can try, but that'll take a bit EDIT: was easier than I thought |
|
I'd prefer if we didn't use another package and instead relied on the built-in |
… the ts-md5 library." This reverts commit f98b811.
Sorry, was not aware of that package. Changed it |
|
Allg. Implementation looks good, if the CI passes, I'll merge. |
|
Thanks for the PR! |
* replace btoa with a Buffer implementation, as btoa does not support non-unicode characters. * replace btoa with a Buffer implementation, as btoa does not support non-unicode characters. * fix linting * fix linting * replace buffer implementation with a md5 hash. This also adds the ts-md5 library. * Revert "replace buffer implementation with a md5 hash. This also adds the ts-md5 library." This reverts commit f98b811. * replace buffer implementation with md5 hash from node:crypto * fix linting.. again --------- Co-authored-by: FurbyOnSteroids <codeberg@your-moms-bellybutton.hair>
Fixes #192
Btoa does not support non-unicode characters (https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa#unicode_strings).
This replaces btoa with Buffers to convert utf8 to base64.