New: Don't try to analyze disk image files (iso, img, etc)

Closes #5567
This commit is contained in:
Mark McDowall 2023-04-19 16:05:10 -07:00
parent a989c84260
commit 764c084987
2 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,7 @@ namespace NzbDrone.Core.MediaFiles
}
public static HashSet<string> Extensions => new HashSet<string>(_fileExtensions.Keys, StringComparer.OrdinalIgnoreCase);
public static HashSet<string> DiskExtensions => new HashSet<string>(new[] { ".img", ".iso", ".vob" }, StringComparer.OrdinalIgnoreCase);
public static Quality GetQualityForExtension(string extension)
{

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using FFMpegCore;
using FFMpegCore.Enums;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
@ -55,6 +56,11 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
throw new FileNotFoundException("Media file does not exist: " + filename);
}
if (MediaFileExtensions.DiskExtensions.Contains(Path.GetExtension(filename)))
{
return null;
}
// TODO: Cache media info by path, mtime and length so we don't need to read files multiple times
try