From 7afcb1749a8a54e53609b05b7dd4f4b9e60f9abc Mon Sep 17 00:00:00 2001 From: TidusJar Date: Tue, 4 Sep 2018 08:55:40 +0100 Subject: [PATCH] Allow Lidarr to specify if we should search for the album --- src/Ombi.Core/Senders/MusicSender.cs | 4 ++++ .../Settings/Models/External/LidarrSettings.cs | 1 + src/Ombi/ClientApp/app/interfaces/ISettings.ts | 1 + .../app/settings/lidarr/lidarr.component.html | 10 ++++++++++ .../ClientApp/app/settings/lidarr/lidarr.component.ts | 1 + 5 files changed, 17 insertions(+) diff --git a/src/Ombi.Core/Senders/MusicSender.cs b/src/Ombi.Core/Senders/MusicSender.cs index 5e1e44126..937204be5 100644 --- a/src/Ombi.Core/Senders/MusicSender.cs +++ b/src/Ombi.Core/Senders/MusicSender.cs @@ -116,6 +116,10 @@ namespace Ombi.Core.Senders } var result = await _lidarrApi.MontiorAlbum(album.id, settings.ApiKey, settings.FullUri); + if (!settings.AddOnly) + { + await _lidarrApi.AlbumSearch(new[] {result.id}, settings.ApiKey, settings.FullUri); + } if (result.monitored) { return new SenderResult {Message = "Album has been requested!", Sent = true, Success = true}; diff --git a/src/Ombi.Settings/Settings/Models/External/LidarrSettings.cs b/src/Ombi.Settings/Settings/Models/External/LidarrSettings.cs index e0bdbdc43..3a37b7d43 100644 --- a/src/Ombi.Settings/Settings/Models/External/LidarrSettings.cs +++ b/src/Ombi.Settings/Settings/Models/External/LidarrSettings.cs @@ -11,5 +11,6 @@ namespace Ombi.Settings.Settings.Models.External public bool AlbumFolder { get; set; } public int LanguageProfileId { get; set; } public int MetadataProfileId { get; set; } + public bool AddOnly { get; set; } } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index 2fb46a2b7..db4db935e 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -93,6 +93,7 @@ export interface ILidarrSettings extends IExternalSettings { metadataProfileId: number; languageProfileId: number; albumFolder: boolean; + addOnly: boolean; } export interface ILandingPageSettings extends ISettings { diff --git a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html index 11d9baf2d..c834fbdbd 100644 --- a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html +++ b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.html @@ -3,6 +3,10 @@
Lidarr Settings +
+ Advanced + +
@@ -110,6 +114,12 @@
+
+
+ + +
+
diff --git a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.ts b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.ts index 5d85c3d73..1f372546a 100644 --- a/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/lidarr/lidarr.component.ts @@ -45,6 +45,7 @@ export class LidarrComponent implements OnInit { albumFolder: [x.albumFolder], languageProfileId: [x.languageProfileId, [Validators.required]], metadataProfileId: [x.metadataProfileId, [Validators.required]], + addOnly: [x.addOnly] }); if (x.defaultQualityProfile) {