mirror of
https://github.com/Radarr/Radarr
synced 2026-05-08 16:11:04 +02:00
New: Don't try to analyze disk image files (iso, img, etc)
(cherry picked from commit 764c08498783865834e607bd41feaaedf69a254a)
This commit is contained in:
parent
f54a5388a0
commit
8a496cbdae
2 changed files with 7 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ static MediaFileExtensions()
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashSet<string> Extensions => new HashSet<string>(_fileExtensions.Keys, StringComparer.OrdinalIgnoreCase);
|
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)
|
public static Quality GetQualityForExtension(string extension)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FFMpegCore;
|
using FFMpegCore;
|
||||||
|
using FFMpegCore.Enums;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
|
@ -55,6 +56,11 @@ public MediaInfoModel GetMediaInfo(string filename)
|
||||||
throw new FileNotFoundException("Media file does not exist: " + filename);
|
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
|
// TODO: Cache media info by path, mtime and length so we don't need to read files multiple times
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue