From 73309f2649778e50709388e5208404c2dc71b30a Mon Sep 17 00:00:00 2001 From: Stepan Goremykin Date: Sat, 7 Oct 2023 23:50:45 +0200 Subject: Pass cancellation token --- .../ScheduledTasks/Tasks/ChapterImagesTask.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Emby.Server.Implementations/ScheduledTasks') diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs index 6ad6c4cbd..c4658c32b 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs @@ -115,7 +115,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks { try { - previouslyFailedImages = File.ReadAllText(failHistoryPath) + var failHistoryText = await File.ReadAllTextAsync(failHistoryPath, cancellationToken).ConfigureAwait(false); + previouslyFailedImages = failHistoryText .Split('|', StringSplitOptions.RemoveEmptyEntries) .ToList(); } @@ -156,7 +157,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks } string text = string.Join('|', previouslyFailedImages); - File.WriteAllText(failHistoryPath, text); + await File.WriteAllTextAsync(failHistoryPath, text, cancellationToken).ConfigureAwait(false); } numComplete++; -- cgit v1.2.3 From a773b43a814e6e849bbb5eb0fa1bccf09a4c1945 Mon Sep 17 00:00:00 2001 From: Stepan Goremykin Date: Thu, 12 Oct 2023 21:28:04 +0200 Subject: Merge reading from file and parsing --- Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Emby.Server.Implementations/ScheduledTasks') diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs index c4658c32b..5d15c3a21 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs @@ -115,8 +115,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks { try { - var failHistoryText = await File.ReadAllTextAsync(failHistoryPath, cancellationToken).ConfigureAwait(false); - previouslyFailedImages = failHistoryText + previouslyFailedImages = (await File.ReadAllTextAsync(failHistoryPath, cancellationToken).ConfigureAwait(false)) .Split('|', StringSplitOptions.RemoveEmptyEntries) .ToList(); } -- cgit v1.2.3