From 4cd0a2ed8d2a0a81a77b80310e75371e72602eea Mon Sep 17 00:00:00 2001 From: JPVenson Date: Mon, 16 Jun 2025 00:19:57 +0300 Subject: Always set update action when item does not exist (#14304) --- Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Jellyfin.Server.Implementations') diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 6e6c47ae04..c6eda26afc 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -14,6 +14,7 @@ using System.Reflection; using System.Text; using System.Text.Json; using System.Threading; +using System.Threading.Tasks; using Jellyfin.Data.Enums; using Jellyfin.Database.Implementations; using Jellyfin.Database.Implementations.Entities; @@ -2353,4 +2354,14 @@ public sealed class BaseItemRepository return baseQuery; } + + /// + public async Task ItemExistsAsync(Guid id) + { + var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false); + await using (dbContext.ConfigureAwait(false)) + { + return await dbContext.BaseItems.AnyAsync(f => f.Id == id).ConfigureAwait(false); + } + } } -- cgit v1.2.3