The Free Software Media System - Server Backend & API
fix
ExpctING127d924c5bd0
diff --git a/Emby.Server.Implementations/Chapters/ChapterManager.cs b/Emby.Server.Implementations/Chapters/ChapterManager.csindex f24c975c14..a2d7d7d7fb 100644--- a/Emby.Server.Implementations/Chapters/ChapterManager.cs+++ b/Emby.Server.Implementations/Chapters/ChapterManager.cs@@ -108,7 +108,7 @@ public class ChapterManager : IChapterManagersum += chapters[i].StartPositionTicks - chapters[i - 1].StartPositionTicks;}- return sum / (chapters.Count - 1);+ return sum / chapters.Count;}/// <inheritdoc />diff --git a/tests/Jellyfin.Providers.Tests/MediaInfo/FFProbeVideoInfoTests.cs b/tests/Jellyfin.Providers.Tests/MediaInfo/FFProbeVideoInfoTests.csindex 7cb3e61724..a7491f42e9 100644--- a/tests/Jellyfin.Providers.Tests/MediaInfo/FFProbeVideoInfoTests.cs+++ b/tests/Jellyfin.Providers.Tests/MediaInfo/FFProbeVideoInfoTests.cs@@ -59,4 +59,20 @@ public class FFProbeVideoInfoTestsAssert.Equal(chaptersCount, chapters.Length);}++ [Theory]+ [InlineData(1L)]+ [InlineData(TimeSpan.TicksPerMinute * 3)]+ [InlineData(TimeSpan.TicksPerMinute * 5)]+ [InlineData((TimeSpan.TicksPerMinute * 5) + 1)]+ [InlineData((TimeSpan.TicksPerMinute * 50) + 1)]+ public void CreateDummyChapters_PositiveRuntime_NoChapterBeyondRuntime(long runtime)+ {+ var chapters = _fFProbeVideoInfo.CreateDummyChapters(new Video()+ {+ RunTimeTicks = runtime+ });++ Assert.All(chapters, chapter => Assert.True(chapter.StartPositionTicks < runtime));+ }}