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.
This commit is contained in:
2026-02-25 16:29:08 -05:00
parent c38adfc0f7
commit 69c213f13c
13 changed files with 1759 additions and 5 deletions
@@ -105,12 +105,42 @@ public static class ServiceCollectionExtensions
efCoreConfiguration = new DatabaseConfigurationOptions()
{
DatabaseType = "Jellyfin-SQLite",
LockingBehavior = DatabaseLockingBehaviorTypes.NoLock
LockingBehavior = DatabaseLockingBehaviorTypes.NoLock,
PresetConfigurations =
[
new PresetConfigurationItem
{
Key = "SQLite",
Value = new PresetDatabaseConfiguration
{
DatabaseType = "Jellyfin-SQLite",
LockingBehavior = DatabaseLockingBehaviorTypes.NoLock,
Description = "Default SQLite database configuration. Database stored in data directory."
}
},
new PresetConfigurationItem
{
Key = "PostgreSQL-Local",
Value = new PresetDatabaseConfiguration
{
DatabaseType = "Jellyfin-PostgreSQL",
LockingBehavior = DatabaseLockingBehaviorTypes.NoLock,
Description = "PostgreSQL database on localhost. Update CustomProviderOptions with your database credentials."
}
}
]
};
configurationManager.SaveConfiguration("database", efCoreConfiguration);
}
}
// Ensure DatabaseType is set (handle corrupted or empty configuration files)
if (string.IsNullOrWhiteSpace(efCoreConfiguration.DatabaseType))
{
efCoreConfiguration.DatabaseType = "Jellyfin-SQLite";
configurationManager.SaveConfiguration("database", efCoreConfiguration);
}
if (efCoreConfiguration.DatabaseType.Equals("PLUGIN_PROVIDER", StringComparison.OrdinalIgnoreCase))
{
if (efCoreConfiguration.CustomProviderOptions is null)