Improve media detection and support more TV filename formats#34
Improve media detection and support more TV filename formats#34mozartsempiano wants to merge 2 commits intojamerst:masterfrom
Conversation
mozartsempiano
commented
Mar 18, 2026
- Improve media detection, TMDB fallback, and CLI key handling
- Support absolute TV episode filenames and more video formats
jamerst
left a comment
There was a problem hiding this comment.
Thanks for the PR! Some good improvements here, just a few minor comments
| } | ||
|
|
||
| private static bool IsAlternateProcessorRetryableStatus(string status) | ||
| => status.StartsWith("Error: Failed to parse required information from filename", StringComparison.OrdinalIgnoreCase) |
There was a problem hiding this comment.
Using the status strings to determine the reason for failure doesn't feel great
Could update ProcessAsync to return a status enum instead (e.g. Success, ParseFailure, NotFound etc)?
| if (config.RenameFiles && IsAlreadyNamedCorrectly(taggingFile, targetFileName)) | ||
| { | ||
| ui.SetStatus("File skipped - already named correctly", MessageType.Information); | ||
| return true; |
There was a problem hiding this comment.
This will skip tagging the file as well as renaming if the name is already correct. We should probably still tag even if the name is correct, or at least make it configurable if you think that's a useful feature?
|
|
||
| private async Task<MovieFileMetadata> GetMovieMetadataAsync(SearchMovie selectedResult, bool fileIsTaggable) | ||
| { | ||
| TMDbMovie movie = await tmdb.GetMovieAsync(selectedResult.Id); |
There was a problem hiding this comment.
Do we need to refetch the movie here? Or is this to support the search language option since the SearchMovie could be in a different language from the desired tag language?
If so could optimise slightly to avoid the extra call if the languages match?
| { | ||
| var fullPath = Path.GetFullPath(file.Path); | ||
| var match = Regex.Match(fullPath, config.ParsePattern, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); | ||
| if (!match.Success && fullPath.Contains(Path.DirectorySeparatorChar)) |
There was a problem hiding this comment.
What's the purpose of this? fullPath will always contain DirectorySeparatorChar?
|
|
||
| public string Language { get; set; } = "en"; | ||
|
|
||
| public List<string> SearchLanguages { get; set; } = []; |
There was a problem hiding this comment.
Should add a command line option for this - it can only be set from the config file currently