using System; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Updates; namespace Jellyfin.Server.Migrations.Routines { /// /// Migration to initialize system configuration with the default plugin repository. /// #pragma warning disable CS0618 // Type or member is obsolete [JellyfinMigration("2025-04-20T09:00:00", nameof(AddDefaultPluginRepository), "EB58EBEE-9514-4B9B-8225-12E1A40020DF", RunMigrationOnSetup = true)] public class AddDefaultPluginRepository : IMigrationRoutine #pragma warning restore CS0618 // Type or member is obsolete { private readonly IServerConfigurationManager _serverConfigurationManager; private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo { Name = "Jellyfin Stable", Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json" }; /// /// Initializes a new instance of the class. /// /// Instance of the interface. public AddDefaultPluginRepository(IServerConfigurationManager serverConfigurationManager) { _serverConfigurationManager = serverConfigurationManager; } /// public void Perform() { _serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo }; _serverConfigurationManager.SaveConfiguration(); } } }