mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Skip sample check for .flv files, also log error for runtime 0
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using NLog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Tv;
|
||||
@@ -41,6 +43,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Path.GetExtension(localEpisode.Path).Equals(".flv", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
_logger.Trace("Skipping smaple check for .flv file");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (localEpisode.Size > SampleSizeLimit)
|
||||
{
|
||||
return true;
|
||||
@@ -48,6 +56,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
||||
|
||||
var runTime = _videoFileInfoReader.GetRunTime(localEpisode.Path);
|
||||
|
||||
if (runTime.TotalMinutes.Equals(0))
|
||||
{
|
||||
_logger.Error("[{0}] has a runtime of 0, is it a valid video file?", localEpisode);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (runTime.TotalMinutes < 3)
|
||||
{
|
||||
_logger.Trace("[{0}] appears to be a sample. Size: {1} Runtime: {2}", localEpisode.Path, localEpisode.Size, runTime);
|
||||
|
Reference in New Issue
Block a user