mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-04-23 22:07:07 -04:00
Fixed: Default runtime to 45 minutes if unavailable when importing episode files
Closes #7780
This commit is contained in:
parent
b103005aa2
commit
cc83eb3d88
2 changed files with 17 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue