mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-26 16:45:09 +00:00
Backport pull request #18107 from jellyfin/release-12.z
Log chapter image extraction once per video
Original-merge: 19338de7ba
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
1 parent
7693488122
commit
017f9ba465
1 file changed
+8
-1
@@ -137,6 +137,7 @@ public class ChapterManager : IChapterManager
|
||||
|
||||
var success = true;
|
||||
var changesMade = false;
|
||||
var extractedCount = 0;
|
||||
|
||||
var runtimeTicks = video.RunTimeTicks ?? 0;
|
||||
|
||||
@@ -178,7 +179,7 @@ public class ChapterManager : IChapterManager
|
||||
Protocol = video.PathProtocol ?? MediaProtocol.File,
|
||||
};
|
||||
|
||||
_logger.LogInformation("Extracting chapter image for {Name} at {Path}", video.Name, inputPath);
|
||||
_logger.LogDebug("Extracting chapter image for {Name} at {Time}", video.Name, time);
|
||||
var tempFile = await _encoder.ExtractVideoImage(inputPath, container, mediaSource, video.GetDefaultVideoStream(), video.Video3DFormat, time, cancellationToken).ConfigureAwait(false);
|
||||
File.Copy(tempFile, path, true);
|
||||
|
||||
@@ -194,6 +195,7 @@ public class ChapterManager : IChapterManager
|
||||
chapter.ImagePath = path;
|
||||
chapter.ImageDateModified = _fileSystem.GetLastWriteTimeUtc(path);
|
||||
changesMade = true;
|
||||
extractedCount++;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -222,6 +224,11 @@ public class ChapterManager : IChapterManager
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedCount > 0)
|
||||
{
|
||||
_logger.LogInformation("Extracted {Count} chapter images for {Name} at {Path}", extractedCount, video.Name, video.Path);
|
||||
}
|
||||
|
||||
if (saveChapters && changesMade)
|
||||
{
|
||||
SaveChapters(video, chapters);
|
||||
|
||||
Reference in new issue
Block a user