| | 1 | | using System; |
| | 2 | | using MediaBrowser.Controller.Configuration; |
| | 3 | | using MediaBrowser.Model.System; |
| | 4 | |
|
| | 5 | | namespace Jellyfin.Server.Migrations.Routines; |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Migration to add the default cast receivers to the system config. |
| | 9 | | /// </summary> |
| | 10 | | #pragma warning disable CS0618 // Type or member is obsolete |
| | 11 | | [JellyfinMigration("2025-04-20T16:00:00", nameof(AddDefaultCastReceivers), "34A1A1C4-5572-418E-A2F8-32CDFE2668E8", RunMi |
| | 12 | | public class AddDefaultCastReceivers : IMigrationRoutine |
| | 13 | | #pragma warning restore CS0618 // Type or member is obsolete |
| | 14 | | { |
| | 15 | | private readonly IServerConfigurationManager _serverConfigurationManager; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Initializes a new instance of the <see cref="AddDefaultCastReceivers"/> class. |
| | 19 | | /// </summary> |
| | 20 | | /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</p |
| | 21 | | public AddDefaultCastReceivers(IServerConfigurationManager serverConfigurationManager) |
| | 22 | | { |
| 21 | 23 | | _serverConfigurationManager = serverConfigurationManager; |
| 21 | 24 | | } |
| | 25 | |
|
| | 26 | | /// <inheritdoc /> |
| | 27 | | public void Perform() |
| | 28 | | { |
| 21 | 29 | | _serverConfigurationManager.Configuration.CastReceiverApplications = |
| 21 | 30 | | [ |
| 21 | 31 | | new() |
| 21 | 32 | | { |
| 21 | 33 | | Id = "F007D354", |
| 21 | 34 | | Name = "Stable" |
| 21 | 35 | | }, |
| 21 | 36 | | new() |
| 21 | 37 | | { |
| 21 | 38 | | Id = "6F511C87", |
| 21 | 39 | | Name = "Unstable" |
| 21 | 40 | | } |
| 21 | 41 | | ]; |
| | 42 | |
|
| 21 | 43 | | _serverConfigurationManager.SaveConfiguration(); |
| 21 | 44 | | } |
| | 45 | | } |