2024-08-30 15:29:48 +02:00
|
|
|
using System;
|
2020-06-05 13:23:38 -06:00
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
|
using MediaBrowser.Model.Updates;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Migrations.Routines
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Migration to initialize system configuration with the default plugin repository.
|
|
|
|
|
/// </summary>
|
2025-04-28 03:18:08 +03:00
|
|
|
[JellyfinMigration("2025-04-20T09:00:00", nameof(AddDefaultPluginRepository), "EB58EBEE-9514-4B9B-8225-12E1A40020DF", RunMigrationOnSetup = true)]
|
|
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
2020-06-05 13:23:38 -06:00
|
|
|
public class AddDefaultPluginRepository : IMigrationRoutine
|
2025-04-28 03:18:08 +03:00
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
2020-06-05 13:23:38 -06:00
|
|
|
{
|
|
|
|
|
private readonly IServerConfigurationManager _serverConfigurationManager;
|
|
|
|
|
|
|
|
|
|
private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo
|
|
|
|
|
{
|
|
|
|
|
Name = "Jellyfin Stable",
|
2020-06-06 22:02:30 +09:00
|
|
|
Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json"
|
2020-06-05 13:23:38 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="AddDefaultPluginRepository"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</param>
|
|
|
|
|
public AddDefaultPluginRepository(IServerConfigurationManager serverConfigurationManager)
|
|
|
|
|
{
|
|
|
|
|
_serverConfigurationManager = serverConfigurationManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public void Perform()
|
|
|
|
|
{
|
2023-01-04 16:01:31 +01:00
|
|
|
_serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo };
|
2020-06-05 13:23:38 -06:00
|
|
|
_serverConfigurationManager.SaveConfiguration();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-06 18:57:00 +09:00
|
|
|
}
|