Update regex for nfo season matching #147
Merged
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.
The current regex used for extracting season & episode numbers from a filename for NFO creation only works if you use titles at the end of the video filename (channel - s01e01 - title.mp4).
If you strip that off to cut down on excessively long filenames (and potential issues with special characters in video filenames), the regex won't match season/episode info as the trailing dash will be absent.
I've been trying to use "channel - s01e01.mp4" so the filenames are more manageable, and use NFO files to store the titles, which are then read by Jellyfin.
It seems like season & episode numbers would always be numeric, so this simplified regex should be more reliable, unless there's some scenario I'm unaware of. I suppose there could be fringe cases where this causes false matches, but that seems unlikely.