From 5c519270b84cc07928bd45a14f38f9b1add24d01 Mon Sep 17 00:00:00 2001 From: Tim Eisele Date: Mon, 13 Oct 2025 20:32:41 +0200 Subject: Remove chapters on file change (#14984) --- .../Chapters/ChapterManager.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'Emby.Server.Implementations/Chapters') diff --git a/Emby.Server.Implementations/Chapters/ChapterManager.cs b/Emby.Server.Implementations/Chapters/ChapterManager.cs index b4daa2a143..fea05931d7 100644 --- a/Emby.Server.Implementations/Chapters/ChapterManager.cs +++ b/Emby.Server.Implementations/Chapters/ChapterManager.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading; @@ -251,23 +250,9 @@ public class ChapterManager : IChapterManager } /// - public void DeleteChapterImages(Video video) + public async Task DeleteChapterDataAsync(Guid itemId, CancellationToken cancellationToken) { - var path = _pathManager.GetChapterImageFolderPath(video); - try - { - if (Directory.Exists(path)) - { - _logger.LogInformation("Removing chapter images for {Name} [{Id}]", video.Name, video.Id); - Directory.Delete(path, true); - } - } - catch (Exception ex) - { - _logger.LogWarning("Failed to remove chapter image folder for {Item}: {Exception}", video.Id, ex); - } - - _chapterRepository.DeleteChapters(video.Id); + await _chapterRepository.DeleteChaptersAsync(itemId, cancellationToken).ConfigureAwait(false); } private IReadOnlyList GetSavedChapterImages(Video video, IDirectoryService directoryService) -- cgit v1.2.3