Refactor database configuration and migrations for PostgreSQL support

- Updated default database configuration to use PostgreSQL instead of SQLite when no database.xml exists.
- Removed obsolete migration routines: MigrateUserDb, RemoveDuplicateExtras, ReseedFolderFlag.
- Introduced new read-only view projections for PostgreSQL: ItemPersonView, ItemProviderView, LibrarySummaryView, MediaStreamInfoView, UserPlaybackHistoryView, VideoItemView.
- Registered view mappings in PostgresDatabaseProvider to ensure proper handling of read-only views.
- Cleaned up unused SQLite cache size configuration in ConfigurationExtensions.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-30 18:47:48 -04:00
parent 9fc10226c9
commit e1f7a4bee9
15 changed files with 637 additions and 429 deletions
@@ -0,0 +1,33 @@
// <copyright file="LibrarySummaryView.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Views;
#pragma warning disable CS1591
#pragma warning disable SA1600
/// <summary>
/// Read-only projection of the library."LibrarySummary_v" view.
/// One row per item type with aggregate statistics across the whole library.
/// </summary>
public class LibrarySummaryView
{
public string? Type { get; set; }
public long? ItemCount { get; set; }
public long? WithYear { get; set; }
public int? OldestYear { get; set; }
public int? NewestYear { get; set; }
public decimal? AvgCommunityRating { get; set; }
public decimal? TotalRunTimeTicks { get; set; }
public decimal? TotalRuntimeHours { get; set; }
public decimal? TotalSizeBytes { get; set; }
public decimal? TotalSizeGB { get; set; }
public long? Count4K { get; set; }
public long? Count1080p { get; set; }
public long? Count720p { get; set; }
public long? CountSD { get; set; }
public long? CountDolbyVision { get; set; }
public long? CountHDR10Plus { get; set; }
public long? CountHDR10 { get; set; }
}