1
0
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:
Mark McDowall
2025-03-31 19:32:35 -07:00
parent 88d56361c4
commit 77a335de30
2 changed files with 17 additions and 0 deletions

View File

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

View File

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