| | 1 | | using System; |
| | 2 | | using MediaBrowser.Controller.Configuration; |
| | 3 | | using MediaBrowser.Model.Updates; |
| | 4 | |
|
| | 5 | | namespace Jellyfin.Server.Migrations.Routines |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// Migration to initialize system configuration with the default plugin repository. |
| | 9 | | /// </summary> |
| | 10 | | #pragma warning disable CS0618 // Type or member is obsolete |
| | 11 | | [JellyfinMigration("2025-04-20T09:00:00", nameof(AddDefaultPluginRepository), "EB58EBEE-9514-4B9B-8225-12E1A40020DF" |
| | 12 | | public class AddDefaultPluginRepository : IMigrationRoutine |
| | 13 | | #pragma warning restore CS0618 // Type or member is obsolete |
| | 14 | | { |
| | 15 | | private readonly IServerConfigurationManager _serverConfigurationManager; |
| | 16 | |
|
| 21 | 17 | | private readonly RepositoryInfo _defaultRepositoryInfo = new RepositoryInfo |
| 21 | 18 | | { |
| 21 | 19 | | Name = "Jellyfin Stable", |
| 21 | 20 | | Url = "https://repo.jellyfin.org/releases/plugin/manifest-stable.json" |
| 21 | 21 | | }; |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Initializes a new instance of the <see cref="AddDefaultPluginRepository"/> class. |
| | 25 | | /// </summary> |
| | 26 | | /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface |
| | 27 | | public AddDefaultPluginRepository(IServerConfigurationManager serverConfigurationManager) |
| | 28 | | { |
| 21 | 29 | | _serverConfigurationManager = serverConfigurationManager; |
| 21 | 30 | | } |
| | 31 | |
|
| | 32 | | /// <inheritdoc/> |
| | 33 | | public void Perform() |
| | 34 | | { |
| 21 | 35 | | _serverConfigurationManager.Configuration.PluginRepositories = new[] { _defaultRepositoryInfo }; |
| 21 | 36 | | _serverConfigurationManager.SaveConfiguration(); |
| 21 | 37 | | } |
| | 38 | | } |
| | 39 | | } |