fix: improve lyrics fetching and query encoding for special characters #594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve lyrics fetching.
Changelogs
/api/get
instead of/api/search
for searching LRCLIB songs, in accordance with official docs recommendation.instrumental
to the structLrclibSong
. Fix lyrics parser so that it returns an empty array for instrumental songs, which gets "It is instrumental" correctly displayed. Before this change, empty lyrics would trigger a Decode Error.A Small Breaking Change: enhance 'queryString' dictionary extension
Models/Extensions/CharacterSet+Extension.swift
: Added a newCharacterSet
extension to define a stricter set of allowed characters for URL query strings.Models/Extensions/Dictionary+Extension.swift
: Updated thequeryString
property to use the newurlQueryAllowedStrict
character set for encoding keys and values.Issue Reference
Closes #411
Test