Add scripts for PostgreSQL migration and SQLite removal; update project references
- Introduced `publish-with-sql.ps1` to publish Jellyfin with SQL files. - Added `remove-sqlite.ps1` to facilitate the removal of SQLite dependencies for PostgreSQL-only deployment. - Created `rollback-to-net10.ps1` to revert .NET 11 changes back to .NET 10. - Implemented `test_api.py` for testing API interactions. - Added `verify-migration.ps1` to verify PostgreSQL migration steps. - Updated various `.csproj` files to include `Microsoft.Kiota.Abstractions` package. - Enhanced `JellyfinDbContext` to handle concurrency exceptions during save operations. - Updated tests to include new package references and ensure compatibility with changes.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -350,6 +350,21 @@ public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILog
|
||||
}).ConfigureAwait(false);
|
||||
return result;
|
||||
}
|
||||
catch (DbUpdateConcurrencyException ex)
|
||||
{
|
||||
// When marking items as played in quick succession, concurrency conflicts can occur.
|
||||
// To resolve this, we'll reload the conflicting entities from the database and retry.
|
||||
logger.LogWarning(ex, "Concurrency exception, retrying operation.");
|
||||
|
||||
foreach (var entry in ex.Entries)
|
||||
{
|
||||
// Reload the entity from the database to get the latest version
|
||||
await entry.ReloadAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
// Retry saving changes after resolving conflicts
|
||||
return await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (DbUpdateException ex)
|
||||
{
|
||||
// Check if it's a constraint violation (works across all database providers)
|
||||
|
||||
+1
@@ -12,6 +12,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<PackageReference Include="BlurHashSharp.SkiaSharp" />
|
||||
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" />
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
<PackageReference Include="SkiaSharp" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux" />
|
||||
<PackageReference Include="SkiaSharp.HarfBuzz" />
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AsyncKeyedLock" />
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<PackageReference Include="Diacritics" />
|
||||
<PackageReference Include="ICU4N.Transliterator" />
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<PackageReference Include="AsyncKeyedLock" />
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Jellyfin.XmlTv" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Sdk" />
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
<PackageReference Include="NEbml" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
<Compile Include="..\..\SharedVersion.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Kiota.Abstractions" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
|
||||
<ProjectReference Include="..\..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user