catch disposed error in chapter task

pull/702/head
Luke Pulverenti 9 years ago
parent 807ec8b14e
commit 4d518e2c95

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

Loading…
Cancel
Save