mirror of
https://github.com/Sonarr/Sonarr
synced 2025-12-06 08:28:37 +01:00
Fixed: Default runtime to 45 minutes if unavailable when importing episode files
Closes #7780
This commit is contained in:
parent
9bd619ccfe
commit
ac1bb497ef
2 changed files with 17 additions and 0 deletions
|
|
@ -213,5 +213,16 @@ public void should_use_runtime_from_episode_over_series()
|
|||
|
||||
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 @@ public DetectSampleResult IsSample(LocalEpisode localEpisode)
|
|||
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…
Reference in a new issue