Skip to content

Commit

Permalink
fix: filter to only video files before declaring them as videos
Browse files Browse the repository at this point in the history
- Filter the files in the movie directory so we only have video files to
  avoid false positives, because the subtitle files we renamed also have
  the ids set.
  • Loading branch information
revam committed Apr 7, 2024
1 parent aae0707 commit b447f92
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Shokofin/Resolvers/ShokoResolveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,10 @@ private async Task<bool> ShouldFilterFile(string partialPath, string fullPath, b
return FileSystem.GetFiles(dirInfo.FullName)
.AsParallel()
.Select(fileInfo => {
// Only allow the video files, since the subtitle files also have the ids set.
if (!_namingOptions.VideoFileExtensions.Contains(Path.GetExtension(fileInfo.Name)))
return null;

if (!fileInfo.Name.TryGetAttributeValue(ShokoFileId.Name, out var fileId) || !int.TryParse(fileId, out _))
return null;

Expand Down

0 comments on commit b447f92

Please sign in to comment.