Commit Graph

14 Commits

Author SHA1 Message Date
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 61c71c1882 Update installer: add docs, scripts, and Start Menu tools
- Expanded [Files] section to include key documentation and PowerShell/batch scripts for database management
- Fixed INSTALLER_GUIDE.md path and improved file organization in installer script
- Added Start Menu shortcuts for documentation and database tools
- Updated .gitignore to track wwwroot/*
- Changed .csproj.user to use a relative publish profile name
- Added INSTALLER_NEEDS_UPDATE.md and INSTALLER_UPDATE_COMPLETE.md for documentation and change tracking
- Improves user onboarding, support, and maintainability
2026-02-28 16:45:58 -05:00
wjones 78c8d4256c Docs reorg, config refactor, and ItemValues index fix
- Moved all documentation to docs/ and updated README with categorized links and new docs/INDEX.md
- Added HOW_TO_SWITCH_DATABASE.md and several new analysis/action docs
- Introduced db-config.ps1 for centralized DB config; all scripts now use it for easy DB switching
- Added db-quick.ps1 for interactive diagnostics and index management
- Updated Add-All-Indexes.bat to use db-config.ps1
- Added Fix-ItemValues-Performance.ps1 to create 3 critical indexes on ItemValues, addressing 1.3B row seq scan issue
- Updated performance_indexes.sql with new ItemValues indexes and ANALYZE
- Updated diagnostics.sql and database_report.txt for improved output and clarity
- All scripts and docs now reference the new config and index optimization workflow
2026-02-28 16:23:43 -05:00
wjones 33d7c010fb Jellyfin 11.0.0-PostgreSQL PREVIEW: version bump & defaults
- Update version to 11.0.0-PostgreSQL-PREVIEW in assemblies, installer, and build scripts
- Default web directory is now "wwwroot" across all platforms
- Configuration manager now creates .example files if missing
- Set PostgreSQL as default database with sensible options
- Postgres provider ensures database exists before table checks
- Add docs for marker conflict fixes and startup.json path issues
- Version string in logs/UI uses informational version
- Installer output filename and wizard show PREVIEW suffix
- Documentation summarizes version bump and verification steps
2026-02-27 13:45:09 -05:00
wjones d623cd03a9 Enable EF Core SplitQuery for PostgreSQL provider
Configured QuerySplittingBehavior.SplitQuery in PostgresDatabaseProvider to optimize performance for queries with multiple Include() statements. This prevents cartesian explosion, eliminates EF Core warnings, and aligns with best practices for handling related collections in PostgreSQL.
2026-02-26 17:51:11 -05:00
wjones 5197948fcc Remove SQLite runtime provider; keep for migration only
SQLite provider removed from service collection and runtime database options. Microsoft.Data.Sqlite package added to Jellyfin.Server for migration routines (SQLite → PostgreSQL). Migration service updated to always use PostgreSQL. SqliteExtensions restored for migration helpers. SQLite migration test deleted. Documentation added to explain migration-only support and deployment impact. No breaking changes for users migrating from SQLite; deployment size increases (~68 MB) for cross-platform SQLite DLLs.
2026-02-26 17:14:30 -05:00
wjones 27e4d11b15 Remove SQLite support for PostgreSQL-only deployment
- Removed SQLite provider project reference and NuGet package
- Added remove-sqlite.ps1 script for automated cleanup and verification
- Updated documentation and PR descriptions for PostgreSQL focus
- Provided migration guidance and detailed removal plan
- Reduced build output size and improved maintainability
2026-02-26 16:31:13 -05:00
wjones c51c14efde Docs: overhaul README, centralize docs, update .gitignore
- Rewrote README.md to highlight PostgreSQL features, installer, and migration, with quick start and full docs index
- Moved all markdown documentation files to docs/ for better organization; updated links accordingly
- Added .gitignore rules to exclude all PublishProfiles folders; removed tracked publish profile XMLs
- Preserved original README as README.original.md; added README_GENERATION.md and DOCUMENTATION_ORGANIZATION.md
- Cleaned root directory, improved navigation, and clarified platform-specific instructions
2026-02-26 15:50:19 -05:00
wjones 8f860a8ec3 Centralize build output and generate OS-specific startup.json
- All DLLs now output to lib\[Configuration]\[TargetFramework]\ at repo root (see Directory.Build.props)
- .gitignore updated to exclude /lib/
- On first run, startup.json is auto-generated with OS-appropriate default paths (Windows, Linux, macOS, or portable)
- Removes null/example config; generated config is immediately usable and clearly documented
- Extensive new documentation: build output, startup.json logic, visual guides, and code proofs
- Publish profile now deletes existing files for clean deploys
- No breaking changes: existing startup.json files are preserved
- Improves first-run UX, deployment, and cross-platform consistency
2026-02-26 14:21:26 -05:00
wjones 534b0cde91 Ensure initial user exists before startup wizard completes
Add logic to initialize at least one user if the startup wizard is not completed, both during application startup and in the startup user API. After user creation, reload the user entity with all related navigation properties to ensure the in-memory user object is fully populated. Also update build and publish metadata files.
2026-02-23 15:42:19 -05:00
wjones ede6904433 Add Jellyfin.CodeAnalysis and analyzers to all projects
Integrated Jellyfin.CodeAnalysis as a project reference across core and test projects. Added centrally managed code analysis and style enforcement packages (IDisposableAnalyzers, Microsoft.CodeAnalysis.BannedApiAnalyzers, SerilogAnalyzer, SmartAnalyzers.MultithreadingAnalyzer, StyleCop.Analyzers) to all affected projects. Updated dependency graphs, asset files, and build scripts to ensure analyzers run during builds, enforcing consistent code quality and style rules throughout the codebase. Removed custom warning properties to rely on analyzer enforcement.
2026-02-23 07:03:54 -05:00
wjones a3eb4b1b57 Add automatic PostgreSQL database creation and migration
- Added Jellyfin.Database.Providers.Postgres project with full EF Core migration support for PostgreSQL.
- Implemented automatic database creation and privilege assignment on startup.
- Generated initial migration and model snapshot for PostgreSQL schema.
- Updated build, test, and dependency files to include PostgreSQL provider and Npgsql packages.
- Added PowerShell script for generating and testing PostgreSQL migrations.
- No changes to application logic outside database provider/migration infrastructure.
2026-02-22 18:51:24 -05:00