public static void SetRadarr(MoviesSettings movieSettings, RadarrSettingsModel radarrSettings)
        {
            SettingsFile.Write(settings =>
            {
                settings.DownloadClients.Radarr.Hostname = radarrSettings.Hostname;
                settings.DownloadClients.Radarr.Port     = radarrSettings.Port;
                settings.DownloadClients.Radarr.ApiKey   = radarrSettings.ApiKey;
                settings.DownloadClients.Radarr.BaseUrl  = radarrSettings.BaseUrl;

                settings.DownloadClients.Radarr.MovieProfileId           = radarrSettings.MovieProfile;
                settings.DownloadClients.Radarr.MovieRootFolder          = radarrSettings.MoviePath;
                settings.DownloadClients.Radarr.MovieMinimumAvailability = radarrSettings.MovieMinAvailability;
                settings.DownloadClients.Radarr.MovieTags = JToken.FromObject(radarrSettings.MovieTags);

                settings.DownloadClients.Radarr.AnimeProfileId           = radarrSettings.AnimeProfile;
                settings.DownloadClients.Radarr.AnimeRootFolder          = radarrSettings.AnimePath;
                settings.DownloadClients.Radarr.AnimeMinimumAvailability = radarrSettings.AnimeMinAvailability;
                settings.DownloadClients.Radarr.AnimeTags = JToken.FromObject(radarrSettings.AnimeTags);

                settings.DownloadClients.Radarr.SearchNewRequests  = radarrSettings.SearchNewRequests;
                settings.DownloadClients.Radarr.MonitorNewRequests = radarrSettings.MonitorNewRequests;

                settings.DownloadClients.Radarr.UseSSL  = radarrSettings.UseSSL;
                settings.DownloadClients.Radarr.Version = radarrSettings.Version;

                settings.Movies.Client  = movieSettings.Client;
                settings.Movies.Command = movieSettings.Command;
            });
        }
Beispiel #2
0
        public static void SetRadarr(MoviesSettings movieSettings, RadarrSettingsModel radarrSettings)
        {
            SettingsFile.Write(settings =>
            {
                settings.DownloadClients.Radarr.Hostname = radarrSettings.Hostname;
                settings.DownloadClients.Radarr.Port     = radarrSettings.Port;
                settings.DownloadClients.Radarr.ApiKey   = radarrSettings.ApiKey;
                settings.DownloadClients.Radarr.BaseUrl  = radarrSettings.BaseUrl;

                settings.DownloadClients.Radarr.Categories = JToken.FromObject(radarrSettings.Categories.Select(x => new RadarrCategory
                {
                    Id   = x.Id,
                    Name = x.Name,
                    MinimumAvailability = x.MinimumAvailability,
                    ProfileId           = x.ProfileId,
                    RootFolder          = x.RootFolder,
                    Tags = x.Tags
                }).ToArray());

                settings.DownloadClients.Radarr.SearchNewRequests  = radarrSettings.SearchNewRequests;
                settings.DownloadClients.Radarr.MonitorNewRequests = radarrSettings.MonitorNewRequests;

                settings.DownloadClients.Radarr.UseSSL  = radarrSettings.UseSSL;
                settings.DownloadClients.Radarr.Version = radarrSettings.Version;

                if (settings.Movies.Client != movieSettings.Client)
                {
                    NotificationsFile.ClearAllMovieNotifications();
                }

                SetMovieSettings(movieSettings, settings);
            });
        }