[video] Preserve special characters in default names of extras #25136
+0
−3
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.
Description
Use filenames as is as default name of extras added to movies.
Removed the StringUtils::ReplaceSpecialCharactersWithSpace() call.
The database storage/retrieval has proper escaping of the characters and works fine without.
Maybe worth a backport as this is very self-contained change, though technically it's not a bug fix.
Motivation and context
Noticed by forum user https://forum.kodi.tv/showthread.php?tid=337992&pid=3195791#pid3195791
The default name generated when adding an extra to a movie (through library scan or manual addition) has the special characters replaced with spaces;
special characters: .-_+,!'"/*?#$%&@()[]{} and tab
That's not intuitive and I didn't find a good reason for that filter.
How has this been tested?
sqlite and mariadb.
Since some of those characters cannot be naturally found in filenames (ex /), I changed the CGUIDialogVideoManagerExtras::GenerateVideoExtra() function to set a filename containing some normal text + all the special characters.
What is the effect on users?
Screenshots (if appropriate):
with filename "test .- _ +, !'"\t/\*?#$%&@()[]{} test" injected directly in GenerateVideoExtra
Before PR:
After PR:
Types of change
Checklist: