|
|
|
@ -119,33 +119,40 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
|
|
|
|
|
|
|
|
|
var extract = !previouslyFailedImages.Contains(key, StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
var chapters = _itemRepo.GetChapters(video.Id).ToList();
|
|
|
|
|
|
|
|
|
|
var success = await _encodingManager.RefreshChapterImages(new ChapterImageRefreshOptions
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
SaveChapters = true,
|
|
|
|
|
ExtractImages = extract,
|
|
|
|
|
Video = video,
|
|
|
|
|
Chapters = chapters
|
|
|
|
|
var chapters = _itemRepo.GetChapters(video.Id).ToList();
|
|
|
|
|
|
|
|
|
|
}, CancellationToken.None);
|
|
|
|
|
var success = await _encodingManager.RefreshChapterImages(new ChapterImageRefreshOptions
|
|
|
|
|
{
|
|
|
|
|
SaveChapters = true,
|
|
|
|
|
ExtractImages = extract,
|
|
|
|
|
Video = video,
|
|
|
|
|
Chapters = chapters
|
|
|
|
|
|
|
|
|
|
if (!success)
|
|
|
|
|
{
|
|
|
|
|
previouslyFailedImages.Add(key);
|
|
|
|
|
}, CancellationToken.None);
|
|
|
|
|
|
|
|
|
|
var parentPath = Path.GetDirectoryName(failHistoryPath);
|
|
|
|
|
if (!success)
|
|
|
|
|
{
|
|
|
|
|
previouslyFailedImages.Add(key);
|
|
|
|
|
|
|
|
|
|
_fileSystem.CreateDirectory(parentPath);
|
|
|
|
|
var parentPath = Path.GetDirectoryName(failHistoryPath);
|
|
|
|
|
|
|
|
|
|
_fileSystem.WriteAllText(failHistoryPath, string.Join("|", previouslyFailedImages.ToArray()));
|
|
|
|
|
}
|
|
|
|
|
_fileSystem.CreateDirectory(parentPath);
|
|
|
|
|
|
|
|
|
|
numComplete++;
|
|
|
|
|
double percent = numComplete;
|
|
|
|
|
percent /= videos.Count;
|
|
|
|
|
_fileSystem.WriteAllText(failHistoryPath, string.Join("|", previouslyFailedImages.ToArray()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
numComplete++;
|
|
|
|
|
double percent = numComplete;
|
|
|
|
|
percent /= videos.Count;
|
|
|
|
|
|
|
|
|
|
progress.Report(100 * percent);
|
|
|
|
|
progress.Report(100 * percent);
|
|
|
|
|
}
|
|
|
|
|
catch (ObjectDisposedException)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|