mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
Fixed: Default runtime to 45 minutes if unavailable when importing episode files
Closes #7780
This commit is contained in:
@@ -213,5 +213,16 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
|
||||
|
||||
Subject.IsSample(_localEpisode).Should().Be(DetectSampleResult.Sample);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_default_to_45_minutes_if_runtime_is_zero()
|
||||
{
|
||||
GivenRuntime(120);
|
||||
|
||||
_localEpisode.Series.Runtime = 0;
|
||||
_localEpisode.Episodes.First().Runtime = 0;
|
||||
|
||||
Subject.IsSample(_localEpisode).Should().Be(DetectSampleResult.Sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
|
||||
return DetectSampleResult.Indeterminate;
|
||||
}
|
||||
|
||||
if (runtime == 0)
|
||||
{
|
||||
_logger.Debug("Series runtime is 0, defaulting runtime to 45 minutes");
|
||||
runtime = 45;
|
||||
}
|
||||
|
||||
return IsSample(localEpisode.Path, localEpisode.MediaInfo.RunTime, runtime);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user