-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
feat(starr): expand dual audio regex #1979
base: master
Are you sure you want to change the base?
feat(starr): expand dual audio regex #1979
Conversation
Another thought: it would be nice if this could also be captured in the {custom formats} for renaming, to better track which files have dual audio and which don't. But that would require it having a shorter name like |
Ah, nevermind—I realized that's already accounted for in the |
@rg9400 could I get you to take a look at this given the regex changes |
5783172
to
97a0780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably be improved further but this seems to do the same job.
not sure why the varyg is case sensitive, that seems like its unnecessary - when would this be lowercase and not be a match?
Fair enough—I think I was just trying to be super safe, but you make a good point. And I appreciate the additional refactor! Changes accepted. |
still needs review from anime team - my changes have been committed
Co-authored-by: zakary <[email protected]>
Co-authored-by: zakary <[email protected]>
370a931
to
41b551e
Compare
Sorry, was on vacation for the last few weeks. Can you share some test cases against this regex? The VARYG format has The regex itself looks good, but sometimes it's hard to identify potential issues, so just trying to do a bit of due diligence to validate the changes are solving a problem. |
@rg9400 given your recent changes is this still valid/needed? |
Pull Request
Purpose
Two common conventions for indicating dual audio releases are not currently captured by the regex:
DUAL-VARYG
DUAL {Resolution}
or{Resolution} DUAL
I attempted to add a pattern which was flexible, while having a low risk of false positives.
Approach
The following patterns have been added into the regex:
(?-i)DUAL-VARYG(?i)
(?-i)
disables case-insensitivity for the rest of the patternDUAL-VARYG
matches literally(?i)
turns case-insensitivity back on for the rest of the patterndual[ ._-]?(\d{3,4}p|ultrahd|4k)
dual[ ._-]
matchesdual
(case insensitive) plus common separator characters\d{3,4}p|ultrahd|4k
matches any 3-4 digits followed byp
(1080p
,720p
, etc.) or4K
orUltraHD
(\d{3,4}p|ultrahd|4k)[ ._-]?dual
1080p.DUAL
,4K UltraHD DUAL
, etc.Notes:
dual
is a dictionary word, we want to prevent matching on any uppercase, hyphen-delimited filename that contains it. This is the same reason I chose to encode the release group directly. Without both, there could be too many false positives.Regex
https://regex101.com/r/p1Rt67/6
Open Questions and Pre-Merge TODOs
Requirements