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

{Custom Format:Format} Rename Token #6585

Merged
merged 5 commits into from
Mar 10, 2024

Conversation

Alanoll
Copy link
Contributor

@Alanoll Alanoll commented Mar 2, 2024

Description

Implementing the {Custom Format:Format} rename token to allow position of Custom Formats when renaming.

This re-implements #4453 for Custom Formats, and would satisfy Radarr/Radarr#6801 if it gets cherry-picked to over there.

It is a smaller change because it's really just allowing exact placement of the Format Name instead of the old Preferred Words implementation that replaced with the matched values.

Database Migration

NO

Issues Fixed or Closed by this PR

@Alanoll Alanoll mentioned this pull request Mar 2, 2024
1 task
@Alanoll Alanoll requested a review from markus101 March 2, 2024 22:46
Copy link
Member

@markus101 markus101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some tests to verify the behaviour (and prevent breaking changes in the future) in a new fixture in https://github.com/Sonarr/Sonarr/tree/develop/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests

@Alanoll
Copy link
Contributor Author

Alanoll commented Mar 3, 2024

I added Unit Tests for both {Custom Formats} and {Custom Format:Format} tokens.

Something I ran into was that Custom Formats allow for spaces in their Names. Multiple Trash Guide formats have them (example). I tweaked the TitleRegex to support spaces within the format, but to ignore any leading/trailing spaces.

Did some quick tests in an expression tester:
image

All existing FileNameBuilder tests passed after the change as well.

@Alanoll Alanoll requested a review from markus101 March 3, 2024 06:03
Co-authored-by: Mark McDowall <markus.mcd5@gmail.com>
@Alanoll Alanoll requested a review from markus101 March 9, 2024 00:18
@markus101 markus101 merged commit 48cb5d2 into Sonarr:develop Mar 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants