Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video] Preserve special characters in default names of extras #25136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CrystalP
Copy link
Contributor

@CrystalP CrystalP commented May 5, 2024

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:
image

After PR:
image

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@CrystalP CrystalP added Type: Improvement non-breaking change which improves existing functionality Component: Video v22 "P" Feature: Video Versions/Extras labels May 5, 2024
@CrystalP CrystalP added this to the "P" 22.0 Alpha 1 milestone May 5, 2024
@CrystalP CrystalP requested a review from ksooo May 5, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Video Feature: Video Versions/Extras Type: Improvement non-breaking change which improves existing functionality v22 "P"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant