diff options
| author | JPVenson <github@jpb.email> | 2025-06-16 00:19:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-15 15:19:57 -0600 |
| commit | 4cd0a2ed8d2a0a81a77b80310e75371e72602eea (patch) | |
| tree | 4bf97508d46880a8c27a76ff637bfef8ec9d1908 /Jellyfin.Server.Implementations | |
| parent | aa05185917339d3c80183b8304302d3c8433cfbb (diff) | |
Always set update action when item does not exist (#14304)
Diffstat (limited to 'Jellyfin.Server.Implementations')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index 6e6c47ae0..c6eda26af 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; } + + /// <inheritdoc/> + public async Task<bool> 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); + } + } } |
