Skip sample check for .flv files, also log error for runtime 0

This commit is contained in:
Mark McDowall
2013-08-08 18:50:11 -07:00
parent 470182e397
commit 47e7805cf9
2 changed files with 34 additions and 2 deletions

View File

@@ -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);