Commit Graph

175 Commits

Author SHA1 Message Date
wjones eccb1359c8 Add placeholder item handling and related unit test for deletion 2026-04-13 11:01:59 -04:00
wjones 45dc885cd5 Update publish profile to Linux x64; refresh scenario time
Changed the last used publish profile in Jellyfin.Server.csproj.user from Windows x64 to Linux x64. Also updated the lastUpdateTime in scenario.json to reflect recent activity.
2026-03-10 17:08:43 -04:00
wjones 73d3c0f733 Add jellyfin-ffmpeg requirements and recommendations to README 2026-03-10 14:54:05 -04:00
wjones 2183ed4d63 Add comprehensive README with Linux dependencies and PostgreSQL configuration guide 2026-03-10 14:20:16 -04:00
wjones e6e7c49888 Fix EnsureDatabaseExistsAsync to respect ConnectionString from configuration - was still using localhost default 2026-03-10 13:47:50 -04:00
wjones 7deb7c1432 Fix SA1513 StyleCop error - add blank line after closing brace 2026-03-10 13:01:12 -04:00
wjones 077f10a4af Fix connection configuration - respect ConnectionString and individual options from database.xml 2026-03-10 12:55:49 -04:00
wjones a872ebc640 commit 2026-03-09 15:24:01 -04:00
wjones 43e866f446 Add schema directories to gitignore - ignore database dumps recursively 2026-03-09 15:16:06 -04:00
wjones e790f84ace Re-enable database creation check to prevent crash when database doesn't exist 2026-03-08 11:31:08 -04:00
wjones caa30d8b88 Remove CREATE DATABASE from schema script - database already created via config 2026-03-08 11:27:30 -04:00
wjones bb9329736f Fix password masking error - password not in args anyway 2026-03-08 11:19:28 -04:00
wjones d4426fe0f6 Use psql subprocess to execute schema script - handles psql meta-commands 2026-03-08 11:13:39 -04:00
wjones 7657caa960 Fix database initialization detection - check for TABLES not just schemas 2026-03-08 11:07:16 -04:00
wjones ac1c2c6c82 CRITICAL FIX: Also disable database migrations in JellyfinMigrationService - was running InitialCreate 2026-03-08 10:50:00 -04:00
wjones 2209f0e1c0 COMPLETE REWRITE: Remove ALL migration code, implement pure SQL script initialization 2026-03-07 13:29:23 -05:00
wjones 7e2c08499b Document automatic empty database initialization feature 2026-03-07 13:08:28 -05:00
wjones 75acefe989 Add automatic SQL script execution for empty database initialization 2026-03-07 13:07:44 -05:00
wjones c4127e7749 Update README paths and disable EnsureCreatedAsync to prevent automatic schema creation 2026-03-07 13:03:10 -05:00
wjones 2d6e10e163 CRITICAL: Also disable EnsureCreatedAsync - it was bypassing migration tracking and creating schema 2026-03-07 13:01:33 -05:00
wjones 5c711bc235 Add database setup documentation for .NET 11 preview manual migration workflow 2026-03-07 12:52:52 -05:00
wjones 091114657b Disable EF Core migrations for .NET 11 preview - use manual SQL scripts instead 2026-03-07 12:52:05 -05:00
wjones 5202d72999 Fix ActivityLogs index creation - remove DO block for CONCURRENTLY support 2026-03-07 12:37:46 -05:00
wjones f47a544c7a Add manual SQL script for applying supplementary indexes migration 2026-03-07 12:35:00 -05:00
wjones a3d76901ed Merge pull request 'Remove fallback code for database index creation' (#19) from upgrade-to-NET11 into main
Reviewed-on: #19
2026-03-07 11:53:45 -05:00
wjones f2ddde1747 Remove fallback code for database index creation 2026-03-07 11:52:55 -05:00
wjones 14964da5e8 Merge pull request 'upgrade-to-NET11' (#18) from upgrade-to-NET11 into main
Reviewed-on: #18
2026-03-07 11:38:10 -05:00
wjones e7aa3024cb Refactor BaseItemRepository for ordered DTO materialization
Refactored BaseItemRepository to use a new helper method, MaterializeOrderedDtos, ensuring DTOs are returned in the order of precomputed IDs and improving code reuse. Updated comments to clarify ordering. Cleaned up scenario.json properties and reformatted rebuild-solution.ps1 without changing its logic.
2026-03-07 11:32:56 -05:00
wjones 2ba3335ca0 add .github directory to ignore file 2026-03-07 10:31:09 -05:00
wjones 3c5f94c242 Fix TV shows and movies listing - add default alphabetical ordering 2026-03-07 10:11:07 -05:00
wjones a1c9488c6c Fix library ordering - use ID-based lookup for reliable alphabetical sorting 2026-03-06 18:08:53 -05:00
wjones 26791b568b Fix TV show season ordering - use IndexNumber instead of SortName 2026-03-06 17:52:47 -05:00
wjones 7c032fe4e2 Complete .NET 11.0 upgrade and solution validation
All 41 projects now target .NET 11.0 (PREVIEW). Updated tasks.md to reflect 100% completion of upgrade and validation, including build, test, manual smoke tests, performance checks, and deployment verification. Updated execution-log.md and scenario.json with final validation results and timestamps. Changed Jellyfin.Server.csproj.user to use SelfContained-Win-x64 publish profile. No code changes required for this tier; all tests pass except integration tests pending PostgreSQL infrastructure.
2026-03-06 10:00:45 -05:00
wjones ff89f36120 Complete .NET 11.0 upgrade - all tiers validated 2026-03-06 09:42:36 -05:00
wjones a695189734 Fix EmbeddedImageProviderTests mock setup for async GetMediaAttachmentsAsync 2026-03-06 09:08:44 -05:00
wjones aa57e311ab Fix duplicate dictionary key in PasswordHashTests test data 2026-03-06 08:48:18 -05:00
wjones 3b161b4731 Add .NET 11.0 upgrade plan, assessment, and risk docs
Added a detailed .NET 11.0 (PREVIEW) upgrade plan (plan.md) outlining a bottom-up migration strategy, dependency analysis, risk management, testing, and success criteria for the Jellyfin solution. Introduced assessment.md, assessment.json, and assessment.csv with comprehensive compatibility analysis for all 41 projects, confirming no blocking issues. Added Risk Management Strategies.md detailing mitigation and rollback procedures. Also included scenario.json describing the upgrade scenario and selected strategy. No existing files were changed.
2026-03-05 21:29:18 -05:00
wjones 8b0503f398 Fix EF Core DistinctBy query translation errors
Refactor all item query methods to avoid untranslatable DistinctBy
in IQueryable expressions. Replace ApplyGroupingFilter with a
two-phase pattern: load IDs and grouping keys to memory, apply
grouping and paging in-memory, then reload full entities by ID.
Add ApplyGroupingInMemory<T> and ApplyPagingToIds helpers.
Use AsEnumerable() before DistinctBy in GetItemValues to force
client-side evaluation. Resolves InvalidOperationException on
/Items, /Items/Filters, /Users/{id}/Items/Latest, and /Studios
endpoints across all supported databases. See
EF_CORE_QUERY_TRANSLATION_FIX.md for details.
2026-03-05 17:17:16 -05:00
wjones a5f5bbe4a6 Merge pull request 'pgsql_testing_branch' (#17) from pgsql_testing_branch into main
Reviewed-on: #17
2026-03-05 09:01:56 -05:00
wjones 7eb2b445cb Postgres perf, path migration, and shutdown race fixes
- Major query performance boost: replaced correlated subqueries with DistinctBy() in BaseItemRepository, added episode deduplication index, and increased default command timeout to 120s.
- Fixed LibraryMonitor shutdown race: added disposal checks and exception handling in FileRefresher to prevent ObjectDisposedException.
- Added PowerShell and SQL utilities for fixing Linux paths in config files and database; new scripts for WebDir and path migration.
- Auto-fix for WebDir in startup.json on load; new helper scripts and docs.
- Added automated weekly DB performance monitoring scripts and reporting.
- Expanded documentation and README for all fixes, scripts, and migration steps.
- Updated SQL scripts for index creation and diagnostics; improved output handling.
- Updated db-config defaults and added new diagnostic/report files.
2026-03-05 08:56:42 -05:00
wjones 0eb44818ff Update config file logic and unify webDir path to wwwroot
- Prevent overwriting existing config files by only copying example files if the target does not exist.
- Set webDir to "wwwroot" for all OSes for consistency.
- Update last used publish profile to SelfContained-Win-x64.
2026-03-04 17:23:58 -05:00
wjones 667c3768a9 Enhanced logging & error handling for auth and pg backups
- Add detailed debug/warning logs to authentication flows (AuthService, AuthorizationContext, WebSocketManager) for better traceability of auth attempts and failures.
- Log WebSocket authentication attempts, including IP, path, and token preview.
- Introduce PostgresVersionMismatchException for pg_dump/pg_restore version mismatches; parse and log server/client versions, clean up failed backups, and provide upgrade guidance.
- Add helper for parsing version mismatch errors.
- Update using directives and minor code cleanups.
- Update .csproj.user with new publish profile path.
2026-03-04 12:37:39 -05:00
wjones 89d4a3d18a Merge pull request 'Move scripts to scripts directory and remove odcs no longer needed.' (#16) from pgsql_testing_branch into main
Reviewed-on: #16
2026-03-03 17:11:37 -05:00
wjones 895372fe98 Move scripts to scripts directory and remove odcs no longer needed. 2026-03-03 17:10:46 -05:00
wjones 319c309be9 Merge pull request 'pgsql_testing_branch' (#15) from pgsql_testing_branch into main
Reviewed-on: #15
2026-03-03 16:52:46 -05:00
wjones c76853a442 PostgreSQL: Production fixes—UPSERT, remote backup, auth logs
- Fix: Atomic UPSERT for BaseItemProviders (resolves duplicate key errors during concurrent metadata refresh; clears navigation property to prevent EF Core tracking conflicts)
- Add: Remote PostgreSQL backup support (removes localhost-only restriction; works with pg_dump/pg_restore for both local and remote DBs)
- Add: Configurable backup disable option (`disable-backups`)
- Fix: Query timeout and performance (documented `command-timeout` config, added performance index scripts)
- Fix: Authentication errors now log as warnings with clear messages (ExceptionMiddleware), reducing log noise
- Fix: SyncPlay authorization handler validates user before lookup, logs warnings for unauthenticated/unknown users (returns 403/404)
- Fix: Database deadlock detection logs warnings and allows EF Core auto-retry
- Add: Configurable LibraryMonitorDelay (min 30s, default 60s)
- Fix: SQLite migration filtering—skip SQLite-only migrations on PostgreSQL
- Chore: Suppress StyleCop warnings (SA1137, etc.) for project consistency
- Docs: 21 documentation files added/updated (config, backup, performance, troubleshooting, session summary)
- All changes are backward compatible and production-ready
2026-03-03 16:35:27 -05:00
wjones 163a037642 Fix: skip SQLite backup requirements for non-SQLite DBs
Previously, the migration system would attempt to back up the legacy SQLite library.db file even when running with non-SQLite providers (e.g., PostgreSQL), causing startup errors. This was due to SQLite-specific migrations not being filtered out during backup requirement aggregation. This commit adds filtering to exclude migrations marked as RequiresSqlite from backup processing unless the provider is actually SQLite (currently unsupported). This prevents erroneous backup attempts and ensures only relevant migrations and backups are processed. Documentation has been updated to explain the issue and solution.
2026-03-02 10:12:20 -05:00
wjones 623af06e46 Optimize BaseItemRepository docs for grouping performance
Extensively document query grouping performance issues and optimization attempts in BaseItemRepository. Add guides on PostgreSQL UUID aggregation limitations, recommended indexes, increasing database timeouts, and monitoring query performance. Current code reverts to original (slow) implementation due to EF Core/Npgsql limitations, with detailed comments and references to new docs. Provides clear workarounds and upgrade path for future `.DistinctBy()` support.
2026-03-01 11:33:16 -05:00
wjones 23ed81b6b1 Improve build reliability, query perf, and documentation
- Add build-error-resolution.md guide for CS0006 and IDE analyzer issues
- Add rebuild-solution.ps1 script for clean/reliable builds
- Suppress noisy IDE/StyleCop warnings in .editorconfig
- Optimize BaseItemRepository grouping queries to use Min(Id) instead of FirstOrDefault, avoiding correlated subqueries and greatly improving DB performance
- Add database-query-optimization.md explaining query changes and tuning
- Enable EF Core SQL query logging, sensitive data, and detailed errors when log level is Debug (ServiceCollectionExtensions, logging.json)
- Update readme with SQL logging instructions
- Clarify git commit/ignore guidance and improve inline documentation
2026-03-01 09:49:30 -05:00
wjones dec2e5ac08 Add platform-specific startup config files for Linux/Windows
Remove old startup config references and add startup.json.linux and startup.json.windows with default directory paths for each platform. These files are now copied to output and publish directories, and include documentation on override priority.
2026-02-28 17:53:57 -05:00