diff options
| author | Tim Eisele <Ghost_of_Stone@web.de> | 2025-05-05 05:21:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-04 21:21:44 -0600 |
| commit | d976f13970e034a24c1d0f69384501e31475a127 (patch) | |
| tree | 8b04bfba52b06c2c8f762beeaa3f7efebc7d6584 /Jellyfin.Server.Implementations/MediaSegments | |
| parent | 0c3ba30de214eddcd6118c3b695b08e5482bf7ed (diff) | |
Recognize file changes and remove data on change (#13839)
Diffstat (limited to 'Jellyfin.Server.Implementations/MediaSegments')
| -rw-r--r-- | Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs b/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs index d6eeafacc..5a2032c1f 100644 --- a/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs +++ b/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs @@ -10,10 +10,10 @@ using Jellyfin.Database.Implementations.Entities; using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.MediaSegments; using MediaBrowser.Controller.Providers; using MediaBrowser.Model; using MediaBrowser.Model.MediaSegments; @@ -140,6 +140,13 @@ public class MediaSegmentManager : IMediaSegmentManager } /// <inheritdoc /> + public async Task DeleteSegmentsAsync(Guid itemId) + { + using var db = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false); + await db.MediaSegments.Where(e => e.ItemId.Equals(itemId)).ExecuteDeleteAsync().ConfigureAwait(false); + } + + /// <inheritdoc /> public async Task<IEnumerable<MediaSegmentDto>> GetSegmentsAsync(Guid itemId, IEnumerable<MediaSegmentType>? typeFilter, bool filterByProvider = true) { var baseItem = _libraryManager.GetItemById(itemId); |
