Commit Graph

173 Commits

Author SHA1 Message Date
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 5565dc3e05 Add automated PostgreSQL performance index management
- Add scripts and SQL for base and supplementary indexes (total 23)
- Integrate index checks and auto-creation into Jellyfin startup
- Update csproj to include SQL files in build/publish output
- Add diagnostics, publish/copy scripts, and troubleshooting docs
- Provide detailed guides for migration, verification, and merging
- Ensures robust, automated, and well-documented index setup
2026-02-28 15:13:04 -05:00
wjones acc51e6923 Merge pull request 'pgsql_testing_branch' (#14) from pgsql_testing_branch into main
Reviewed-on: #14
2026-02-27 18:20:29 -05:00
wjones 79110d2afd Update DataDir and ConfigDir paths in startup.json
Separated DataDir and ConfigDir into their own subfolders
within C:/ProgramData/jellyfin by updating their paths to
"data" and "config" respectively. This improves organization
of data and configuration files.
2026-02-27 18:12:52 -05:00
wjones 3e6aa54a8c Add Windows startup config and Jellyfin API test script
Added startup.json with Windows-specific default paths and documentation for Jellyfin configuration. Introduced test_api.py, a Python script to authenticate with Jellyfin, create a backup, and list backups using the REST API.
2026-02-27 18:10:36 -05:00
wjones 78bc22db79 Update BaseItemProviders after deletion in repository
Ensure entity.Provider is re-added to context after deleting
existing BaseItemProviders, preserving updated provider info.
2026-02-27 17:09:06 -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 91f4bf1590 Merge pull request 'pgsql_testing_branch' (#13) from pgsql_testing_branch into main
Reviewed-on: #13
2026-02-26 15:55:18 -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 cc870ead29 Add Windows installer scripts, docs, and startup.json fixes
Major improvements to the Jellyfin PostgreSQL Windows installer:
- Added build-installer.ps1 (PowerShell automation)
- Added jellyfin-setup.iss (Inno Setup script) and jellyfin.ico
- Added detailed installer guides and quick start docs
- Fixed startup.json defaults: removed old file, ensured Windows paths
- Updated .gitignore for installer-output and publish profiles
- Installer now supports service install, firewall setup, and PostgreSQL config wizard
- Documentation covers both quick and production-grade workflows
2026-02-26 15:29:12 -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 5bdb7d53c3 Platform config templates & Postgres migration recovery
- Added Linux/Windows startup config templates and README
- Updated default paths to FHS-compliant locations
- Improved publish profiles for platform targeting
- Enhanced Postgres migration: auto-recover on 42P07 errors
- Added RecordMigrationAsAppliedAsync for manual migration history
- Improved migration logging and error handling
- Added detailed documentation for config and migration fixes
2026-02-26 13:44:03 -05:00
wjones 24ae417a39 PostgreSQL migration: schema fixes, docs, and tooling
- Assign all tables to correct PostgreSQL schemas in EF Core migrations
- Fix identifier quoting: replace SQL Server brackets with PostgreSQL double quotes
- Use InsertData for placeholder BaseItems row (no raw SQL)
- Remove obsolete/Windows publish profiles; set Linux as default
- Add detailed migration success and verification reports (Markdown)
- Add idempotent, production-ready SQL migration scripts
- Add PowerShell script for automated migration verification
- Ensures robust, production-ready PostgreSQL migration and documentation
2026-02-26 12:16:47 -05:00
wjones 5b098c3818 Update publish profiles and .gitignore for Windows build
Expanded .gitignore to cover more build artifacts. Updated publish profiles to use "Windows Deployment (Bridge)" and changed publish URLs to "Jellyfin-win". Cleaned up old profile user files and added new Windows deployment profiles. Adjusted test project references to exclude runtime assets and prevent copying.
2026-02-26 09:45:16 -05:00
wjones e345c5c5a7 Update publish profile and web dir config for portability
Changed publish profile path to E: drive and updated publish history. Switched JELLYFIN_WEB_DIR from absolute to relative path ("webroot") in launchSettings.json for improved portability and consistency across environments.
2026-02-26 08:45:04 -05:00
wjones fb18041518 Merge pull request 'Auto-generate startup.json and add database presets' (#12) from pgsql_testing_branch into main
Reviewed-on: #12
2026-02-25 16:29:59 -05:00
wjones 69c213f13c Auto-generate startup.json and add database presets
Introduces automatic creation of a self-documenting startup.json file on first startup, with example path configurations for Linux, Windows, and portable setups. Adds preset database configurations to database.xml for easy switching between SQLite and PostgreSQL. Refactors database config classes for XML serialization compatibility and ensures database.xml is never empty. Comprehensive documentation and migration guides included.
2026-02-25 16:29:08 -05:00
wjones ebcab4e73c Merge pull request 'Add file-based startup config & temp dir option' (#11) from pgsql_testing_branch into main
Reviewed-on: #11
2026-02-25 15:19:38 -05:00
wjones c38adfc0f7 Add file-based startup config & temp dir option
Added support for configuring all major Jellyfin paths (data, config, cache, log, temp, web) via a `startup.json` file, with priority after CLI and environment variables. Introduced a new `TempDir` option, configurable through CLI, env var, or config file, with backward-compatible defaults. Refactored path resolution logic to integrate file-based config and ensure directory creation. Updated constructors and CLI options to support temp directory. Improved EF Core migration error handling and logging. Added comprehensive documentation and example config files. All changes are backward compatible.
2026-02-25 15:18:23 -05:00
wjones eac9e61f1c Merge pull request 'pgsql_testing_branch' (#10) from pgsql_testing_branch into main
Reviewed-on: #10
2026-02-25 14:27:26 -05:00
wjones dad5cbadf5 Stop tracking and ignore unwanted files 2026-02-25 09:17:02 -05:00
wjones 3b883b9361 update gitignore file 2026-02-25 08:13:28 -05:00
wjones 135b6a81b9 Update NuGet paths and add web client directory docs
Added README section describing the web client directory (`wwwroot`) and its configuration options. No code logic changes; only environment and documentation updates.
2026-02-24 12:21:55 -05:00
wjones e1775c5124 update gitingore 2026-02-23 18:43:13 -05:00
wjones ce2a060bd3 clean solution 2026-02-23 18:36:36 -05:00
wjones 88dba54087 Add user-configurable PostgreSQL backup system
Introduced backup/restore via external pg_dump/pg_restore tools, configurable in database.xml. Added DatabaseBackupOptions, PostgresBackupService, and example/config docs. Backup features are enabled only for local databases; remote DBs require manual management. Logging and documentation clarify external tool usage, error handling, and security. Updated provider logic and assembly files accordingly.
2026-02-23 18:31:27 -05:00
wjones 89201f2b94 Merge pull request 'pgsql_testing_branch' (#9) from pgsql_testing_branch into main
Reviewed-on: #9
2026-02-23 18:31:12 -05:00
wjones 43cdbf9b35 Refactor startup user creation and add HomeSection config
Refactored user initialization to always ensure at least one user exists at startup. If no users are present, a default admin user (admin/jellyfin) is created automatically. Updated StartupController endpoints to handle cases where no user exists. Simplified UserManager.InitializeAsync logic. Added HomeSectionConfiguration for EF Core entity mapping. Includes minor project and assembly info updates.
2026-02-23 17:54:53 -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 755a572cfa Merge pull request 'pgsql_testing_branch' (#8) from pgsql_testing_branch into main
Reviewed-on: #8
2026-02-23 12:44:09 -05:00
wjones f833f0ceeb BaseItemRepository: 100% async conversion complete
All 21 public methods in BaseItemRepository are now fully async, including complex query, retrieval, write, delete, and aggregation operations. Added async signatures to IItemRepository and ILibraryManager with cancellation token support and ConfigureAwait(false). Sync wrappers retained for backward compatibility. Final conversion of GetLatestItemList and GetNextUpSeriesKeys completes Phase 3A. All bulk operations and aggregations are async, enabling concurrent dashboard loading and full PostgreSQL multiplexing. Migration routines fixed for Npgsql "command in progress" errors. Extensive documentation added for conversion process, performance, and testing. Project is now production-ready with zero build errors and 100% backward compatibility.
2026-02-23 12:36:29 -05:00
wjones 86883cd5c6 Refactor PostgreSQL provider: multi-schema & async prep
- Refactor migrations and provider to use multiple PostgreSQL schemas, each matching a legacy SQLite database (activitylog, authentication, displaypreferences, library, users).
- All tables, foreign keys, and indexes are now schema-qualified; Down migration drops tables by schema.
- Provider ensures schemas exist before migrations; entities are mapped to correct schemas in OnModelCreating.
- Add support for max-pool-size, min-pool-size, and multiplexing connection options; update logging accordingly.
- VACUUM ANALYZE now runs per schema during scheduled optimization.
- TruncateAllTablesAsync now truncates tables with schema qualification.
- README updated with schema structure, new options, and multiplexing warnings.
- CacheDecorator now calls async repository methods using .GetAwaiter().GetResult(), with documentation.
- Lays groundwork for full async/await and multiplexing support in the database layer.
2026-02-23 09:38:22 -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 8d39eb77e6 Remove Jellyfin.CodeAnalysis and analyzers from test deps
Removed all references to the Jellyfin.CodeAnalysis project and related analyzer NuGet packages (IDisposableAnalyzers, SerilogAnalyzer, SmartAnalyzers.MultithreadingAnalyzer, StyleCop.Analyzers, Microsoft.CodeAnalysis.BannedApiAnalyzers) from test projects and their dependency graphs. Updated .dgspec.json, project.assets.json, and project.nuget.cache files accordingly. Also updated warningProperties to explicitly set warning behaviors. This streamlines the dependency tree and removes static analysis tooling from the test build process.
2026-02-22 19:03:29 -05:00
wjones ed8fe21055 Update migration filters for PostgreSQL compatibility
Changed unique index filters in migration to use PostgreSQL syntax ("UserId" IS NOT NULL) instead of SQL Server syntax. Updated assembly version metadata and rebuilt related binaries.
2026-02-22 19:00:38 -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
wjones 0efab2cfb6 Add JELLYFIN_WEB_DIR env and update publish settings
- Add JELLYFIN_WEB_DIR environment variable to launch profiles and test project for consistent web directory configuration.
- Conditionally add AssemblyMetadata for ASPNETCORE_ENVIRONMENT and JELLYFIN_WEB_DIR in DEBUG builds.
- Update FolderProfile.pubxml to delete existing files on publish and set additional properties (TargetFramework, ProjectGuid, etc.).
- Bump Jellyfin.CodeAnalysis assembly version and update related binaries.
- Refresh publish history in FolderProfile.pubxml.user.
2026-02-22 16:43:14 -05:00
wjones 656b61deac Merge pull request 'Add PostgreSQL Provider Support' (#7) from pgsql_conversion into main
Reviewed-on: #7
2026-02-22 16:19:14 -05:00
wjones f8b7c62f9e Add PostgreSQL provider and code cleanup
Added Jellyfin.Database.Providers.Postgres project and integrated Npgsql packages for PostgreSQL support. Updated solution and test project references. Refactored code for clarity and performance, including improved string handling, log formatting, and plugin management. Enhanced .editorconfig rules and fixed minor test issues. Added publishing profiles and updated web server setup references. Cleaned up assembly info and cache files.
Now able to successfully build solution
2026-02-22 16:15:19 -05:00
wjones 02f8159bc6 Merge pull request 'Improve string comparison and code formatting' (#6) from pgsql_conversion into main
Reviewed-on: #6
2026-02-22 12:47:26 -05:00
wjones d1e6fbc122 Improve string comparison and code formatting
Updated string comparison logic to use explicit StringComparison parameters for correctness and performance. Moved using statements outside namespace in event consumer classes. Added minor formatting fixes and closing braces. Suppressed IDisposableAnalyzers and reduced StyleCop rule severity in .editorconfig. Updated project cache and assembly info files. No changes to business logic.
2026-02-22 12:44:55 -05:00
wjones f8873f91f3 Merge pull request 'pgsql_conversion' (#5) from pgsql_conversion into main
Reviewed-on: #5
2026-02-22 12:10:27 -05:00
wjones 8c300533f9 Reformat .editorconfig and update analyzer suppressions
Reorganized .editorconfig for clarity and maintainability, adding and adjusting StyleCop and IDE analyzer suppressions. Rebuilt Jellyfin.CodeAnalysis assembly and updated project.nuget.cache files to reflect configuration changes. No source code changes included.
2026-02-22 12:02:16 -05:00
wjones dbeec2e9f0 Refactor and modernize JSON converter test code
Refactor test code in Jellyfin.Extensions.Tests for clarity and consistency:
- Use explicit object initializers and collection expressions
- Standardize field naming and use of this.
- Add/improve XML doc comments for test methods
- Use new(...) syntax for Guid/Version instantiation
- Convert file-scoped to block-scoped namespaces in key tests
- Nest test classes and use instance methods in enum tests
- Enable XML docs and suppress select warnings in csproj
- No changes to test or converter logic; style and maintainability only
2026-02-22 10:31:23 -05:00
wjones d5522c6fb3 Improve code clarity and test documentation
Refactored ImageProcessor to use explicit 'this.' member access for consistency and readability. Enhanced test files with XML documentation, explicit types, modern C# syntax, and clearer Moq setups. Enabled XML doc generation for test project. Updated assembly info and cache files as a result of build changes. No functional or behavioral changes.
2026-02-22 09:38:16 -05:00
wjones 48569427a5 Refactor for clarity; add docs and .editorconfig
Refactored code to consistently use `this.` for instance members, improving clarity and maintainability. Added XML documentation comments to multiple methods and properties for better API documentation. Streamlined `FfProbeKeyframeExtractor` logic and enhanced EBML parsing code with comments and style improvements. Introduced a new `.editorconfig` to disable legacy StyleCop and IDisposableAnalyzers rules. Updated binary files, assembly info, and NuGet cache files due to rebuilds and dependency changes. No functional changes were made.
2026-02-21 16:55:27 -05:00
wjones e887356385 Improve XML docs and formatting in tests and constants
Added and enhanced XML documentation comments across the codebase, including detailed summaries and parameter descriptions for methods, classes, and constants. Documented all MatroskaConstants. Improved test readability with comments and explicit variable declarations. Made minor formatting and consistency fixes in test files. No functional changes. Updated project cache and binary files to reflect documentation improvements.
2026-02-21 15:46:18 -05:00