aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-11-27 07:53:18 -0700
committerGitHub <noreply@github.com>2022-11-27 07:53:18 -0700
commitd4bd72049b4609582fb57f63134bee58327bc0cc (patch)
treecf9fd4473ee337f74de01ee9ed02e5b583f5c5b7 /MediaBrowser.Providers
parentc9f8b8a7c7b871938e10dbe94c51b2bd885a915c (diff)
parentb58d6e5b83c05dd61be165b6e8aa16f04b99cb96 (diff)
Merge pull request #8137 from negulici-r-barnabas/master
Diffstat (limited to 'MediaBrowser.Providers')
-rw-r--r--MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
index f00023947d..7412a10d02 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
@@ -48,8 +48,6 @@ namespace MediaBrowser.Providers.MediaInfo
private readonly SubtitleResolver _subtitleResolver;
private readonly IMediaSourceManager _mediaSourceManager;
- private readonly long _dummyChapterDuration = TimeSpan.FromMinutes(5).Ticks;
-
public FFProbeVideoInfo(
ILogger<FFProbeVideoInfo> logger,
IMediaSourceManager mediaSourceManager,
@@ -651,6 +649,7 @@ namespace MediaBrowser.Providers.MediaInfo
private ChapterInfo[] CreateDummyChapters(Video video)
{
var runtime = video.RunTimeTicks ?? 0;
+ long dummyChapterDuration = TimeSpan.FromSeconds(_config.Configuration.DummyChapterDuration).Ticks;
if (runtime < 0)
{
@@ -662,13 +661,13 @@ namespace MediaBrowser.Providers.MediaInfo
runtime));
}
- if (runtime < _dummyChapterDuration)
+ if (runtime < dummyChapterDuration)
{
return Array.Empty<ChapterInfo>();
}
- // Limit to 100 chapters just in case there's some incorrect metadata here
- int chapterCount = (int)Math.Min(runtime / _dummyChapterDuration, 100);
+ // Limit the chapters just in case there's some incorrect metadata here
+ int chapterCount = (int)Math.Min(runtime / dummyChapterDuration, _config.Configuration.DummyChapterCount);
var chapters = new ChapterInfo[chapterCount];
long currentChapterTicks = 0;
@@ -679,7 +678,7 @@ namespace MediaBrowser.Providers.MediaInfo
StartPositionTicks = currentChapterTicks
};
- currentChapterTicks += _dummyChapterDuration;
+ currentChapterTicks += dummyChapterDuration;
}
return chapters;