aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
diff options
context:
space:
mode:
authorNegulici-R. Barnabas <negulici.r.barnabas@outlook.com>2022-07-18 17:50:52 +0300
committerNegulici-R. Barnabas <negulici.r.barnabas@outlook.com>2022-07-18 17:50:52 +0300
commit12ec0e285ddf8a5360859b5c49bb4b7b916569d2 (patch)
treef51cc944daed6731f73eb5560c3a09c3c959ea83 /MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
parentc2902dd1081acd96cf34682ec8a4812ab6146044 (diff)
Chapter Images:
- chapter image extraction intervals, limit count and resolutions can be set by the user from the server general settings;
Diffstat (limited to 'MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs')
-rw-r--r--MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
index 8c08ab30e..c8ff5de69 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 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);
+ 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;