From 412063c9828083182d98a372ff02d21fbac727bd Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Sat, 27 Mar 2021 00:51:36 +1300 Subject: [PATCH 001/104] Capitalizes V for tv show notification type. Refactors notification message curlys class. --- src/Ombi.Notifications/BaseNotification.cs | 1 - .../NotificationMessageCurlys.cs | 349 ++++++++---------- 2 files changed, 144 insertions(+), 206 deletions(-) diff --git a/src/Ombi.Notifications/BaseNotification.cs b/src/Ombi.Notifications/BaseNotification.cs index c9404eb2c..9d8bbb776 100644 --- a/src/Ombi.Notifications/BaseNotification.cs +++ b/src/Ombi.Notifications/BaseNotification.cs @@ -209,7 +209,6 @@ namespace Ombi.Notifications if (model.RequestType == RequestType.Movie) { _log.LogDebug("Notification options: {@model}, Req: {@MovieRequest}, Settings: {@Customization}", model, MovieRequest, Customization); - curlys.Setup(model, MovieRequest, Customization, preference); } else if (model.RequestType == RequestType.TvShow) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index 54e85080b..4c4aa01ef 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -14,228 +14,164 @@ namespace Ombi.Notifications { public class NotificationMessageCurlys { - public void Setup(NotificationOptions opts, MovieRequests req, CustomizationSettings s, UserNotificationPreferences pref) + public void SetupNewsletter(CustomizationSettings s) { - LoadIssues(opts); + ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s.ApplicationName; + ApplicationUrl = s?.ApplicationUrl.HasValue() ?? false ? s.ApplicationUrl : string.Empty; + } - RequestId = req?.Id.ToString(); + public void Setup(OmbiUser user, CustomizationSettings s) + { + ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s.ApplicationName; + ApplicationUrl = s?.ApplicationUrl.HasValue() ?? false ? s.ApplicationUrl : string.Empty; + RequestedUser = user.UserName; + Alias = user.UserAlias; + UserName = user.UserName; + } + + public void Setup(NotificationOptions opts, MovieRequests req, CustomizationSettings s, + UserNotificationPreferences pref) + { + LoadIssues(opts); + LoadCommon(req, s, pref); + LoadTitle(opts, req); ProviderId = req?.TheMovieDbId.ToString() ?? string.Empty; - string title; - if (req == null) - { - opts.Substitutes.TryGetValue("Title", out title); - } - else - { - title = req?.Title; - } - ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; - ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; - RequestedUser = req?.RequestedUser?.UserName; - if (UserName.IsNullOrEmpty()) - { - // Can be set if it's an issue - UserName = req?.RequestedUser?.UserName; - } + Year = req?.ReleaseDate.Year.ToString(); + Overview = req?.Overview; + AdditionalInformation = opts?.AdditionalInformation ?? string.Empty; - if (Alias.IsNullOrEmpty()) + if (!string.IsNullOrEmpty(req?.PosterPath)) { - // Can be set if it's an issue - Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; + PosterImage = $"https://image.tmdb.org/t/p/w300/{req.PosterPath.TrimStart('/')}"; } - if (pref != null) - { - UserPreference = pref.Value.HasValue() ? pref.Value : Alias; - } - Title = title; - RequestedDate = req?.RequestedDate.ToString("D"); - if (Type.IsNullOrEmpty()) - { - Type = req?.RequestType.Humanize(); - } - Overview = req?.Overview; - Year = req?.ReleaseDate.Year.ToString(); - DenyReason = req?.DeniedReason; - AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; - if (req?.RequestType == RequestType.Movie) - { - PosterImage = string.Format((req?.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) - ? "https://image.tmdb.org/t/p/w300{0}" : "https://image.tmdb.org/t/p/w300/{0}", req?.PosterPath); - } - else + CalculateRequestStatus(req); + } + + public void Setup(NotificationOptions opts, ChildRequests req, CustomizationSettings s, + UserNotificationPreferences pref) + { + LoadIssues(opts); + LoadCommon(req, s, pref); + LoadTitle(opts, req); + ProviderId = req?.ParentRequest?.ExternalProviderId.ToString() ?? string.Empty; + Year = req?.ParentRequest?.ReleaseDate.Year.ToString(); + Overview = req?.ParentRequest?.Overview; + AdditionalInformation = opts.AdditionalInformation; + + if (!string.IsNullOrEmpty(req?.ParentRequest?.PosterPath)) { - PosterImage = req?.PosterPath; + PosterImage = $"https://image.tmdb.org/t/p/w300/{req.ParentRequest?.PosterPath.TrimStart('/')}"; } - AdditionalInformation = opts?.AdditionalInformation ?? string.Empty; + // Generate episode list. + StringBuilder epSb = new StringBuilder(); + IEnumerable episodes = req?.SeasonRequests? + .SelectMany(x => x.Episodes) ?? new List(); + episodes + .OrderBy(x => x.EpisodeNumber) + .ToList() + .ForEach(ep => epSb.Append($"{ep.EpisodeNumber},")); + if (epSb.Length > 0) epSb.Remove(epSb.Length - 1, 1); + EpisodesList = epSb.ToString(); + // Generate season list. + StringBuilder seasonSb = new StringBuilder(); + List seasons = req?.SeasonRequests ?? new List(); + seasons + .OrderBy(x => x.SeasonNumber) + .ToList() + .ForEach(ep => seasonSb.Append($"{ep.SeasonNumber},")); + if (seasonSb.Length > 0) seasonSb.Remove(seasonSb.Length - 1, 1); + SeasonsList = seasonSb.ToString(); CalculateRequestStatus(req); } - public void Setup(NotificationOptions opts, AlbumRequest req, CustomizationSettings s, UserNotificationPreferences pref) + public void Setup(NotificationOptions opts, AlbumRequest req, CustomizationSettings s, + UserNotificationPreferences pref) { LoadIssues(opts); - - RequestId = req?.Id.ToString(); + LoadCommon(req, s, pref); + LoadTitle(opts, req); ProviderId = req?.ForeignArtistId ?? string.Empty; - - string title; - if (req == null) - { - opts.Substitutes.TryGetValue("Title", out title); - } - else - { - title = req?.Title; - } - ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; - ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; - RequestedUser = req?.RequestedUser?.UserName; - if (UserName.IsNullOrEmpty()) - { - // Can be set if it's an issue - UserName = req?.RequestedUser?.UserName; - } - - AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; - DenyReason = req?.DeniedReason; - if (Alias.IsNullOrEmpty()) - { - Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; - } - if (pref != null) - { - UserPreference = pref.Value.HasValue() ? pref.Value : Alias; - } - Title = title; - RequestedDate = req?.RequestedDate.ToString("D"); - if (Type.IsNullOrEmpty()) - { - Type = req?.RequestType.Humanize(); - } Year = req?.ReleaseDate.Year.ToString(); - PosterImage = (req?.Cover.HasValue() ?? false) ? req.Cover : req?.Disk ?? string.Empty; - AdditionalInformation = opts?.AdditionalInformation ?? string.Empty; + PosterImage = req?.Cover.HasValue() ?? false ? req.Cover : req?.Disk ?? string.Empty; CalculateRequestStatus(req); } - public void SetupNewsletter(CustomizationSettings s) + private void LoadIssues(NotificationOptions opts) { - ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; - ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; + IssueDescription = opts.Substitutes.TryGetValue("IssueDescription", out string val) ? val : string.Empty; + IssueCategory = opts.Substitutes.TryGetValue("IssueCategory", out val) ? val : string.Empty; + IssueStatus = opts.Substitutes.TryGetValue("IssueStatus", out val) ? val : string.Empty; + IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty; + NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty; + UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty; + Alias = opts.Substitutes.TryGetValue("IssueUserAlias", out val) ? val : string.Empty; + Type = opts.Substitutes.TryGetValue("RequestType", out val) && Enum.TryParse(val, out RequestType type) + ? HumanizeReturnType(type) + : string.Empty; } - public void Setup(NotificationOptions opts, ChildRequests req, CustomizationSettings s, UserNotificationPreferences pref) + private void LoadCommon(BaseRequest req, CustomizationSettings s, UserNotificationPreferences pref) { - LoadIssues(opts); - RequestId = req?.Id.ToString(); - ProviderId = req?.ParentRequest?.ExternalProviderId.ToString() ?? string.Empty; - string title; - if (req == null) - { - opts.Substitutes.TryGetValue("Title", out title); - } - else - { - title = req?.ParentRequest.Title; - } + ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s.ApplicationName; + ApplicationUrl = s?.ApplicationUrl.HasValue() ?? false ? s.ApplicationUrl : string.Empty; + AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; DenyReason = req?.DeniedReason; - ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; - ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; + RequestId = req?.Id.ToString(); RequestedUser = req?.RequestedUser?.UserName; - if (UserName.IsNullOrEmpty()) - { - // Can be set if it's an issue - UserName = req?.RequestedUser?.UserName; - } - AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; - if (Alias.IsNullOrEmpty()) - { - Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; - } - if (pref != null) - { - UserPreference = pref.Value.HasValue() ? pref.Value : Alias; - } - Title = title; RequestedDate = req?.RequestedDate.ToString("D"); + if (Type.IsNullOrEmpty()) { - Type = req?.RequestType.Humanize(); + Type = HumanizeReturnType(req?.RequestType); } - Overview = req?.ParentRequest.Overview; - Year = req?.ParentRequest.ReleaseDate.Year.ToString(); - if (req?.RequestType == RequestType.Movie) - { - PosterImage = string.Format((req?.ParentRequest.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) - ? "https://image.tmdb.org/t/p/w300{0}" : "https://image.tmdb.org/t/p/w300/{0}", req?.ParentRequest.PosterPath); - } - else + if (UserName.IsNullOrEmpty()) { - PosterImage = req?.ParentRequest.PosterPath; + UserName = req?.RequestedUser?.UserName; } - AdditionalInformation = opts.AdditionalInformation; - // DO Episode and Season Lists - var episodes = req?.SeasonRequests?.SelectMany(x => x.Episodes) ?? new List(); - var seasons = req?.SeasonRequests?.OrderBy(x => x.SeasonNumber).ToList() ?? new List(); - var orderedEpisodes = episodes.OrderBy(x => x.EpisodeNumber).ToList(); - var epSb = new StringBuilder(); - var seasonSb = new StringBuilder(); - for (var i = 0; i < orderedEpisodes.Count; i++) + if (Alias.IsNullOrEmpty()) { - var ep = orderedEpisodes[i]; - if (i < orderedEpisodes.Count - 1) - { - epSb.Append($"{ep.EpisodeNumber},"); - } - else - { - epSb.Append($"{ep.EpisodeNumber}"); - } + Alias = req?.RequestedUser?.Alias.HasValue() ?? false + ? req.RequestedUser?.Alias + : req?.RequestedUser?.UserName; } - for (var i = 0; i < seasons.Count; i++) + if (pref != null) { - var ep = seasons[i]; - if (i < seasons.Count - 1) - { - seasonSb.Append($"{ep.SeasonNumber},"); - } - else - { - seasonSb.Append($"{ep.SeasonNumber}"); - } + UserPreference = pref.Value.HasValue() ? pref.Value : Alias; } - - EpisodesList = epSb.ToString(); - SeasonsList = seasonSb.ToString(); - CalculateRequestStatus(req); } - public void Setup(OmbiUser user, CustomizationSettings s) + private static string HumanizeReturnType(RequestType? requestType) { - ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty; - ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName; - RequestedUser = user.UserName; - Alias = user.UserAlias; - UserName = user.UserName; + return requestType switch + { + null => string.Empty, + RequestType.TvShow => "TV Show", + _ => requestType.Humanize() + }; } - private void LoadIssues(NotificationOptions opts) + private void LoadTitle(NotificationOptions opts, BaseRequest req) { - var val = string.Empty; - IssueDescription = opts.Substitutes.TryGetValue("IssueDescription", out val) ? val : string.Empty; - IssueCategory = opts.Substitutes.TryGetValue("IssueCategory", out val) ? val : string.Empty; - IssueStatus = opts.Substitutes.TryGetValue("IssueStatus", out val) ? val : string.Empty; - IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty; - NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty; - UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty; - Alias = opts.Substitutes.TryGetValue("IssueUserAlias", out val) ? val : string.Empty; - Type = opts.Substitutes.TryGetValue("RequestType", out val) ? val.Humanize() : string.Empty; + switch (req) + { + case null: + opts.Substitutes.TryGetValue("Title", out string title); + Title = title; + break; + case ChildRequests tvShowRequest: + Title = tvShowRequest.ParentRequest?.Title; + break; + default: + Title = req.Title; + break; + } } private void CalculateRequestStatus(BaseRequest req) @@ -248,16 +184,19 @@ namespace Ombi.Notifications RequestStatus = "Available"; return; } + if (req.Denied ?? false) { RequestStatus = "Denied"; return; } + if (!req.Available && req.Approved) { RequestStatus = "Processing Request"; return; } + RequestStatus = "Pending Approval"; } } @@ -298,36 +237,36 @@ namespace Ombi.Notifications public Dictionary Curlys => new Dictionary { - {nameof(RequestId), RequestId }, - {nameof(RequestedUser), RequestedUser }, - {nameof(Title), Title }, - {nameof(RequestedDate), RequestedDate }, - {nameof(Type), Type }, - {nameof(AdditionalInformation), AdditionalInformation }, - {nameof(LongDate),LongDate}, - {nameof(ShortDate),ShortDate}, - {nameof(LongTime),LongTime}, - {nameof(ShortTime),ShortTime}, - {nameof(Overview),Overview}, - {nameof(Year),Year}, - {nameof(EpisodesList),EpisodesList}, - {nameof(SeasonsList),SeasonsList}, - {nameof(PosterImage),PosterImage}, - {nameof(ApplicationName),ApplicationName}, - {nameof(ApplicationUrl),ApplicationUrl}, - {nameof(IssueDescription),IssueDescription}, - {nameof(IssueCategory),IssueCategory}, - {nameof(IssueStatus),IssueStatus}, - {nameof(IssueSubject),IssueSubject}, - {nameof(NewIssueComment),NewIssueComment}, - {nameof(IssueUser),IssueUser}, - {nameof(UserName),UserName}, - {nameof(Alias),Alias}, - {nameof(UserPreference),UserPreference}, - {nameof(DenyReason),DenyReason}, - {nameof(AvailableDate),AvailableDate}, - {nameof(RequestStatus),RequestStatus}, - {nameof(ProviderId),ProviderId}, + { nameof(RequestId), RequestId }, + { nameof(RequestedUser), RequestedUser }, + { nameof(Title), Title }, + { nameof(RequestedDate), RequestedDate }, + { nameof(Type), Type }, + { nameof(AdditionalInformation), AdditionalInformation }, + { nameof(LongDate), LongDate }, + { nameof(ShortDate), ShortDate }, + { nameof(LongTime), LongTime }, + { nameof(ShortTime), ShortTime }, + { nameof(Overview), Overview }, + { nameof(Year), Year }, + { nameof(EpisodesList), EpisodesList }, + { nameof(SeasonsList), SeasonsList }, + { nameof(PosterImage), PosterImage }, + { nameof(ApplicationName), ApplicationName }, + { nameof(ApplicationUrl), ApplicationUrl }, + { nameof(IssueDescription), IssueDescription }, + { nameof(IssueCategory), IssueCategory }, + { nameof(IssueStatus), IssueStatus }, + { nameof(IssueSubject), IssueSubject }, + { nameof(NewIssueComment), NewIssueComment }, + { nameof(IssueUser), IssueUser }, + { nameof(UserName), UserName }, + { nameof(Alias), Alias }, + { nameof(UserPreference), UserPreference }, + { nameof(DenyReason), DenyReason }, + { nameof(AvailableDate), AvailableDate }, + { nameof(RequestStatus), RequestStatus }, + { nameof(ProviderId), ProviderId }, }; } } \ No newline at end of file From a5fd1622d61773f541b24dc3e931b07d763e3269 Mon Sep 17 00:00:00 2001 From: Emil Kitti Date: Wed, 31 Mar 2021 14:25:11 +0200 Subject: [PATCH 002/104] themoviedb keywords attribute api change --- src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs b/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs index 1dc39299a..edc0c7e23 100644 --- a/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs +++ b/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs @@ -95,7 +95,7 @@ namespace Ombi.Api.TheMovieDb.Models public class Keywords { - [JsonProperty("keywords")] + [JsonProperty("results")] public List KeywordsValue { get; set; } } From ea54f52325f058e3f57c74e9606b5aa3b72b2f9b Mon Sep 17 00:00:00 2001 From: Emil Kitti Date: Wed, 31 Mar 2021 19:49:16 +0200 Subject: [PATCH 003/104] fixes movie keywords --- src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs b/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs index edc0c7e23..1ab33990e 100644 --- a/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs +++ b/src/Ombi.TheMovieDbApi/Models/FullMovieInfo.cs @@ -97,6 +97,8 @@ namespace Ombi.Api.TheMovieDb.Models { [JsonProperty("results")] public List KeywordsValue { get; set; } + [JsonProperty("keywords")] + private List _movieKeywordValue { set { KeywordsValue = value; }} } public class KeywordsValue From 1c8ab3cee2c02965b607b852717065cc0b7747ee Mon Sep 17 00:00:00 2001 From: twanariens Date: Wed, 31 Mar 2021 22:08:42 +0200 Subject: [PATCH 004/104] Reworked top search. included username. styling fixes for menu --- .../src/app/my-nav/my-nav.component.html | 47 +++++----- .../src/app/my-nav/my-nav.component.scss | 85 ++++++++++--------- .../src/app/my-nav/nav-search.component.scss | 1 - 3 files changed, 68 insertions(+), 65 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html index 3ca868685..9e9bdcd73 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html @@ -53,36 +53,33 @@ -
@@ -34,6 +36,7 @@
+
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/discord.component.ts b/src/Ombi/ClientApp/src/app/settings/notifications/discord.component.ts index 73f271894..e2e92e55c 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/discord.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/notifications/discord.component.ts @@ -29,7 +29,8 @@ export class DiscordComponent implements OnInit { enabled: [x.enabled], username: [x.username], webhookUrl: [x.webhookUrl, [Validators.required]], - icon: [x.icon] + icon: [x.icon], + hideUser: [x.hideUser] }); }); From 5d8a2123120bcb79f58de4e8b882a454b05d1e98 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 6 May 2021 20:15:58 +0100 Subject: [PATCH 035/104] Improved the Plex OAuth flow --- .../src/app/login/login.component.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/login/login.component.ts b/src/Ombi/ClientApp/src/app/login/login.component.ts index 5245b8239..e9260d685 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.ts +++ b/src/Ombi/ClientApp/src/app/login/login.component.ts @@ -146,6 +146,9 @@ export class LoginComponent implements OnDestroy, OnInit { } public oauth() { + if (this.oAuthWindow) { + this.oAuthWindow.close(); + } this.oAuthWindow = window.open(window.location.toString(), "_blank", `toolbar=0, location=0, status=0, @@ -159,16 +162,22 @@ export class LoginComponent implements OnDestroy, OnInit { this.authService.login({ usePlexOAuth: true, password: "", rememberMe: true, username: "", plexTvPin: pin }).subscribe(x => { this.oAuthWindow!.location.replace(x.url); - this.pinTimer = setInterval(() => { + if (this.pinTimer) { + clearInterval(this.pinTimer); + } - this.oauthLoading = true; - this.getPinResult(x.pinId); - }, 4000); + this.pinTimer = setInterval(() => { + if(this.oAuthWindow.closed) { + this.oauthLoading = true; + this.getPinResult(x.pinId); + } + }, 1000); }); }); } public getPinResult(pinId: number) { + clearInterval(this.pinTimer); this.authService.oAuth(pinId).subscribe(x => { if(x.access_token) { this.store.save("id_token", x.access_token); @@ -176,7 +185,7 @@ export class LoginComponent implements OnDestroy, OnInit { if (this.authService.loggedIn()) { this.ngOnDestroy(); - if(this.oAuthWindow) { + if (this.oAuthWindow) { this.oAuthWindow.close(); } this.oauthLoading = false; @@ -184,6 +193,10 @@ export class LoginComponent implements OnDestroy, OnInit { return; } } + this.notify.open("Could not log you in!", "OK", { + duration: 3000 + }); + this.oauthLoading = false; }, err => { console.log(err); From 7c79e28d5c0a3d884ddec862dc7a87b2ff51c582 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 6 May 2021 20:29:44 +0100 Subject: [PATCH 036/104] Added a message on the application url field to better explain what it does --- .../app/settings/customization/customization.component.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html index c98cf65fc..3b3044780 100644 --- a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html @@ -12,6 +12,10 @@
+ The application url should be your Externally Accessible URL for example, your internal URL is http://192.168.1.50/ but your Externally + Accessible URL is 'https://mydomain.com/requests' Please ensure this field is correct as it drives a lot of functionality include the QR code for the + mobile app and it affects the way email notifications are sent. + Application URL From 8dd00e9e9935038754fad1202652fd5ad9575114 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 6 May 2021 20:31:36 +0100 Subject: [PATCH 037/104] Improved the message on the admin request popup --- src/Ombi/wwwroot/translations/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 18e864bdd..5e24656fe 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -254,9 +254,9 @@ "ViewCollection":"View Collection", "NotEnoughInfo": "Unfortunately there is not enough information about this show yet!", "AdvancedOptions":"Advanced Options", - "AutoApproveOptions":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved!", - "AutoApproveOptionsTv":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it!", - "AutoApproveOptionsTvShort":"You can configure the request here, once requested it will be send to your DVR application! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it!", + "AutoApproveOptions":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved! Please note, this is optional, just press Request to skip!", + "AutoApproveOptionsTv":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!", + "AutoApproveOptionsTvShort":"You can configure the request here, once requested it will be send to your DVR application! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!", "QualityProfilesSelect":"Select A Quality Profile", "RootFolderSelect":"Select A Root Folder", "LanguageProfileSelect":"Select A Language Profile", From 4071b2e8a215e5e5dfe60b617080c7e4c48d7e36 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 7 May 2021 14:41:10 +0100 Subject: [PATCH 038/104] Added the open on mobile back in, this will be available in the next app update --- .../Rules/Search/AvailabilityRuleHelper.cs | 2 +- .../Rule/Rules/Search/PlexAvailabilityRule.cs | 4 +-- .../user-preference.component.html | 28 +++++++++++-------- .../user-preference.component.ts | 7 +++++ 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs index 71331c51d..c3de20798 100644 --- a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs +++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs @@ -13,7 +13,7 @@ namespace Ombi.Core.Rule.Rules.Search { public static void CheckForUnairedEpisodes(SearchTvShowViewModel search) { - foreach (var season in search.SeasonRequests) + foreach (var season in search.SeasonRequests.ToList()) { // If we have all the episodes for this season, then this season is available if (season.Episodes.All(x => x.Available)) diff --git a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs index 7b757802d..68551aac4 100644 --- a/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/PlexAvailabilityRule.cs @@ -85,9 +85,9 @@ namespace Ombi.Core.Rule.Rules.Search if (search.SeasonRequests.Any()) { var allEpisodes = PlexContentRepository.GetAllEpisodes(); - foreach (var season in search.SeasonRequests) + foreach (var season in search.SeasonRequests.ToList()) { - foreach (var episode in season.Episodes) + foreach (var episode in season.Episodes.ToList()) { await AvailabilityRuleHelper.SingleEpisodeCheck(useImdb, allEpisodes, episode, season, item, useTheMovieDb, useTvDb, Log); } diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html index b809a510d..ab9f7bf0c 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html @@ -52,19 +52,25 @@
-
-
-
- Get it on Google Play + +
+
+ Get it on Google Play +
+
+ Get it on Google Play +
+
+ +
+
-
- Get it on Google Play -
-
+
diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts index ae68055a6..eb504065c 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts @@ -120,6 +120,13 @@ export class UserPreferenceComponent implements OnInit { }) } + public openMobileApp(event: any) { + event.preventDefault(); + + const url = `ombi://${this.qrCode}`; + window.location.assign(url); + } + private welcomeText: string; private setWelcomeText() { From 50af2b84821ce39d316194c0a14e7ebb4f507d1e Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 7 May 2021 19:36:07 +0100 Subject: [PATCH 039/104] Fixed the issue where you couldn't remove a legacy user from the notifications --- src/Ombi/Controllers/V1/MobileController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/Controllers/V1/MobileController.cs b/src/Ombi/Controllers/V1/MobileController.cs index 2ca640769..485535816 100644 --- a/src/Ombi/Controllers/V1/MobileController.cs +++ b/src/Ombi/Controllers/V1/MobileController.cs @@ -92,7 +92,7 @@ namespace Ombi.Controllers.V1 [Admin] public async Task RemoveUser([FromBody] RemoveUserModel userId) { - var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId.UserId, StringComparison.InvariantCultureIgnoreCase)); + var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id == userId.UserId); try { await _notification.DeleteRange(user.NotificationUserIds); From 64c0fc17cc56c1484a33a8dc2a715843bcab82b9 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 9 May 2021 19:58:36 +0100 Subject: [PATCH 040/104] Fixed #4152 --- src/Ombi.Core/Engine/Interfaces/BaseEngine.cs | 4 ++-- src/Ombi.Core/Engine/MovieRequestEngine.cs | 4 ++-- src/Ombi.Core/Rule/Interfaces/IRuleEvaluator.cs | 2 +- src/Ombi.Core/Rule/Interfaces/ISpecificRule.cs | 2 +- src/Ombi.Core/Rule/RuleEvaluator.cs | 4 ++-- .../Rule/Rules/Search/AvailabilityRuleHelper.cs | 2 +- .../Rule/Rules/Search/LidarrArtistCacheRule.cs | 3 ++- .../Rule/Rules/Specific/SendNotificationRule.cs | 11 ++++++++++- 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs b/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs index 6fd22bced..68a4335cb 100644 --- a/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs @@ -59,9 +59,9 @@ namespace Ombi.Core.Engine.Interfaces var ruleResults = await Rules.StartSearchRules(model); return ruleResults; } - public async Task RunSpecificRule(object model, SpecificRules rule) + public async Task RunSpecificRule(object model, SpecificRules rule, string requestOnBehalf) { - var ruleResults = await Rules.StartSpecificRules(model, rule); + var ruleResults = await Rules.StartSpecificRules(model, rule, requestOnBehalf); return ruleResults; } } diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 8d54f0fc3..a2380be81 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -71,7 +71,7 @@ namespace Ombi.Core.Engine var canRequestOnBehalf = model.RequestOnBehalf.HasValue(); var isAdmin = await UserManager.IsInRoleAsync(userDetails, OmbiRoles.PowerUser) || await UserManager.IsInRoleAsync(userDetails, OmbiRoles.Admin); - if (model.RequestOnBehalf.HasValue() && !isAdmin) + if (canRequestOnBehalf && !isAdmin) { return new RequestEngineResult { @@ -703,7 +703,7 @@ namespace Ombi.Core.Engine { await MovieRepository.Add(model); - var result = await RunSpecificRule(model, SpecificRules.CanSendNotification); + var result = await RunSpecificRule(model, SpecificRules.CanSendNotification, requestOnBehalf); if (result.Success) { await NotificationHelper.NewRequest(model); diff --git a/src/Ombi.Core/Rule/Interfaces/IRuleEvaluator.cs b/src/Ombi.Core/Rule/Interfaces/IRuleEvaluator.cs index c32342146..5b438124e 100644 --- a/src/Ombi.Core/Rule/Interfaces/IRuleEvaluator.cs +++ b/src/Ombi.Core/Rule/Interfaces/IRuleEvaluator.cs @@ -9,6 +9,6 @@ namespace Ombi.Core.Rule.Interfaces { Task> StartRequestRules(BaseRequest obj); Task> StartSearchRules(SearchViewModel obj); - Task StartSpecificRules(object obj, SpecificRules selectedRule); + Task StartSpecificRules(object obj, SpecificRules selectedRule, string requestOnBehalf); } } \ No newline at end of file diff --git a/src/Ombi.Core/Rule/Interfaces/ISpecificRule.cs b/src/Ombi.Core/Rule/Interfaces/ISpecificRule.cs index 065b2f990..f76464888 100644 --- a/src/Ombi.Core/Rule/Interfaces/ISpecificRule.cs +++ b/src/Ombi.Core/Rule/Interfaces/ISpecificRule.cs @@ -5,7 +5,7 @@ namespace Ombi.Core.Rule.Interfaces { public interface ISpecificRule where T : new() { - Task Execute(T obj); + Task Execute(T obj, string requestOnBehalf); SpecificRules Rule { get; } } } \ No newline at end of file diff --git a/src/Ombi.Core/Rule/RuleEvaluator.cs b/src/Ombi.Core/Rule/RuleEvaluator.cs index a0c272c00..712d6031e 100644 --- a/src/Ombi.Core/Rule/RuleEvaluator.cs +++ b/src/Ombi.Core/Rule/RuleEvaluator.cs @@ -58,13 +58,13 @@ namespace Ombi.Core.Rule return results; } - public async Task StartSpecificRules(object obj, SpecificRules selectedRule) + public async Task StartSpecificRules(object obj, SpecificRules selectedRule, string requestOnBehalf) { foreach (var rule in SpecificRules) { if (selectedRule == rule.Rule) { - var result = await rule.Execute(obj); + var result = await rule.Execute(obj, requestOnBehalf); return result; } } diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs index c3de20798..fe062e851 100644 --- a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs +++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs @@ -18,7 +18,7 @@ namespace Ombi.Core.Rule.Rules.Search // If we have all the episodes for this season, then this season is available if (season.Episodes.All(x => x.Available)) { - season.SeasonAvailable = true; + season.SeasonAvailable = true; } } if (search.SeasonRequests.All(x => x.Episodes.All(e => e.Available))) diff --git a/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs b/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs index a254ea2d3..b0e9af1ec 100644 --- a/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs @@ -8,7 +8,7 @@ using Ombi.Store.Repository; namespace Ombi.Core.Rule.Rules.Search { - public class LidarrArtistCacheRule : SpecificRule, ISpecificRule + public class LidarrArtistCacheRule : SpecificRule, IRules { public LidarrArtistCacheRule(IExternalRepository db) { @@ -30,6 +30,7 @@ namespace Ombi.Core.Rule.Rules.Search return Task.FromResult(Success()); } + public override SpecificRules Rule => SpecificRules.LidarrArtist; } } \ No newline at end of file diff --git a/src/Ombi.Core/Rule/Rules/Specific/SendNotificationRule.cs b/src/Ombi.Core/Rule/Rules/Specific/SendNotificationRule.cs index 30ec9b14a..af71df9ac 100644 --- a/src/Ombi.Core/Rule/Rules/Specific/SendNotificationRule.cs +++ b/src/Ombi.Core/Rule/Rules/Specific/SendNotificationRule.cs @@ -22,11 +22,20 @@ namespace Ombi.Core.Rule.Rules.Specific private OmbiUserManager UserManager { get; } private ISettingsService Settings { get; } - public async Task Execute(object obj) + public async Task Execute(object obj, string requestOnBehalf) { var req = (BaseRequest)obj; + var canRequestonBehalf = requestOnBehalf.HasValue(); var settings = await Settings.GetSettingsAsync(); var sendNotification = true; + + if (settings.DoNotSendNotificationsForAutoApprove && canRequestonBehalf) + { + return new RuleResult + { + Success = false + }; + } var requestedUser = await UserManager.Users.FirstOrDefaultAsync(x => x.Id == req.RequestedUserId); if (req.RequestType == RequestType.Movie) { From 6e32bd33f5418070d9616152e31309e84c3b4489 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 9 May 2021 21:15:56 +0100 Subject: [PATCH 041/104] Fixed build --- .../Rule/Search/LidarrAlbumCacheRuleTests.cs | 10 +++++----- .../Rule/Search/LidarrArtistCacheRuleTests.cs | 6 +++--- src/Ombi.Core/Engine/MovieRequestEngine.cs | 2 +- src/Ombi.Core/Engine/MusicRequestEngine.cs | 4 ++-- src/Ombi.Core/Engine/MusicSearchEngine.cs | 8 ++++---- src/Ombi.Core/Engine/TvRequestEngine.cs | 2 +- .../Rule/Rules/Search/LidarrAlbumCacheRule.cs | 6 ++++-- .../Rule/Rules/Search/LidarrArtistCacheRule.cs | 4 ++-- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/Ombi.Core.Tests/Rule/Search/LidarrAlbumCacheRuleTests.cs b/src/Ombi.Core.Tests/Rule/Search/LidarrAlbumCacheRuleTests.cs index 27dbee614..7bf84d05f 100644 --- a/src/Ombi.Core.Tests/Rule/Search/LidarrAlbumCacheRuleTests.cs +++ b/src/Ombi.Core.Tests/Rule/Search/LidarrAlbumCacheRuleTests.cs @@ -30,7 +30,7 @@ namespace Ombi.Core.Tests.Rule.Search public async Task Should_Not_Be_Monitored_Or_Available() { var request = new SearchAlbumViewModel { ForeignAlbumId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Approved); @@ -49,7 +49,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchAlbumViewModel { ForeignAlbumId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Approved); @@ -71,7 +71,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchAlbumViewModel { ForeignAlbumId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Approved); @@ -93,7 +93,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchAlbumViewModel { ForeignAlbumId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Approved); @@ -114,7 +114,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchAlbumViewModel { ForeignAlbumId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Approved); diff --git a/src/Ombi.Core.Tests/Rule/Search/LidarrArtistCacheRuleTests.cs b/src/Ombi.Core.Tests/Rule/Search/LidarrArtistCacheRuleTests.cs index c17400acb..e13d8d1cd 100644 --- a/src/Ombi.Core.Tests/Rule/Search/LidarrArtistCacheRuleTests.cs +++ b/src/Ombi.Core.Tests/Rule/Search/LidarrArtistCacheRuleTests.cs @@ -29,7 +29,7 @@ namespace Ombi.Core.Tests.Rule.Search public async Task Should_Not_Be_Monitored() { var request = new SearchArtistViewModel { ForignArtistId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.False(request.Monitored); @@ -46,7 +46,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchArtistViewModel { ForignArtistId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.True(request.Monitored); @@ -64,7 +64,7 @@ namespace Ombi.Core.Tests.Rule.Search } }.AsQueryable()); var request = new SearchArtistViewModel { ForignArtistId = "abc" }; - var result = await Rule.Execute(request); + var result = await Rule.Execute(request, string.Empty); Assert.True(result.Success); Assert.True(request.Monitored); diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index a2380be81..d37983d21 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -550,7 +550,7 @@ namespace Ombi.Core.Engine request.Denied = false; await MovieRepository.Update(request); - var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification); + var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification, string.Empty); if (canNotify.Success) { await NotificationHelper.Notify(request, NotificationType.RequestApproved); diff --git a/src/Ombi.Core/Engine/MusicRequestEngine.cs b/src/Ombi.Core/Engine/MusicRequestEngine.cs index e473c1fb1..032b2ae7d 100644 --- a/src/Ombi.Core/Engine/MusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/MusicRequestEngine.cs @@ -362,7 +362,7 @@ namespace Ombi.Core.Engine await MusicRepository.Update(request); - var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification); + var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification, string.Empty); if (canNotify.Success) { await NotificationHelper.Notify(request, NotificationType.RequestApproved); @@ -506,7 +506,7 @@ namespace Ombi.Core.Engine { await MusicRepository.Add(model); - var result = await RunSpecificRule(model, SpecificRules.CanSendNotification); + var result = await RunSpecificRule(model, SpecificRules.CanSendNotification, string.Empty); if (result.Success) { await NotificationHelper.NewRequest(model); diff --git a/src/Ombi.Core/Engine/MusicSearchEngine.cs b/src/Ombi.Core/Engine/MusicSearchEngine.cs index a9af03ecf..89bae7069 100644 --- a/src/Ombi.Core/Engine/MusicSearchEngine.cs +++ b/src/Ombi.Core/Engine/MusicSearchEngine.cs @@ -151,7 +151,7 @@ namespace Ombi.Core.Engine } - await Rules.StartSpecificRules(vm, SpecificRules.LidarrArtist); + await Rules.StartSpecificRules(vm, SpecificRules.LidarrArtist, string.Empty); return vm; } @@ -190,7 +190,7 @@ namespace Ombi.Core.Engine vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.ToHttpsUrl(); - await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum); + await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum, string.Empty); await RunSearchRules(vm); @@ -230,7 +230,7 @@ namespace Ombi.Core.Engine vm.Cover = a.remoteCover; } - await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum); + await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum, string.Empty); await RunSearchRules(vm); @@ -258,7 +258,7 @@ namespace Ombi.Core.Engine vm.Cover = fullAlbum.remoteCover; } - await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum); + await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum, string.Empty); await RunSearchRules(vm); diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index 5eae0912c..00655e921 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -915,7 +915,7 @@ namespace Ombi.Core.Engine private async Task AfterRequest(ChildRequests model, string requestOnBehalf) { - var sendRuleResult = await RunSpecificRule(model, SpecificRules.CanSendNotification); + var sendRuleResult = await RunSpecificRule(model, SpecificRules.CanSendNotification, requestOnBehalf); if (sendRuleResult.Success) { await NotificationHelper.NewRequest(model); diff --git a/src/Ombi.Core/Rule/Rules/Search/LidarrAlbumCacheRule.cs b/src/Ombi.Core/Rule/Rules/Search/LidarrAlbumCacheRule.cs index 3ca57d635..ca0c0cd97 100644 --- a/src/Ombi.Core/Rule/Rules/Search/LidarrAlbumCacheRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/LidarrAlbumCacheRule.cs @@ -9,7 +9,7 @@ using Ombi.Store.Repository; namespace Ombi.Core.Rule.Rules.Search { - public class LidarrAlbumCacheRule : BaseSearchRule, IRules + public class LidarrAlbumCacheRule : SpecificRule, ISpecificRule { public LidarrAlbumCacheRule(IExternalRepository db) { @@ -18,7 +18,9 @@ namespace Ombi.Core.Rule.Rules.Search private readonly IExternalRepository _db; - public Task Execute(SearchViewModel objec) + public override SpecificRules Rule => SpecificRules.LidarrAlbum; + + public Task Execute(object objec, string requestOnBehalf) { if (objec is SearchAlbumViewModel obj) { diff --git a/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs b/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs index b0e9af1ec..06ca3f06c 100644 --- a/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/LidarrArtistCacheRule.cs @@ -8,7 +8,7 @@ using Ombi.Store.Repository; namespace Ombi.Core.Rule.Rules.Search { - public class LidarrArtistCacheRule : SpecificRule, IRules + public class LidarrArtistCacheRule : SpecificRule, ISpecificRule { public LidarrArtistCacheRule(IExternalRepository db) { @@ -17,7 +17,7 @@ namespace Ombi.Core.Rule.Rules.Search private readonly IExternalRepository _db; - public Task Execute(object objec) + public Task Execute(object objec, string requestOnBehalf) { var obj = (SearchArtistViewModel) objec; // Check if it's in Lidarr From 900ec20e42d31c0f290a04d71268065b9e6a0cc7 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 9 May 2021 21:44:21 +0100 Subject: [PATCH 042/104] Fixed #4057 #4180 --- .../src/app/usermanagement/usermanagement.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts index c2245957c..d119c8961 100644 --- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts +++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts @@ -1,7 +1,7 @@ import { AfterViewInit, Component, OnInit, ViewChild } from "@angular/core"; - import { ICheckbox, ICustomizationSettings, IEmailNotificationSettings, IUser } from "../interfaces"; import { IdentityService, NotificationService, SettingsService } from "../services"; + import { MatSort } from "@angular/material/sort"; import { MatTableDataSource } from "@angular/material/table"; import { SelectionModel } from "@angular/cdk/collections"; @@ -90,6 +90,9 @@ export class UserManagementComponent implements OnInit { if (this.bulkMusicLimit) { x.musicRequestLimit = this.bulkMusicLimit; } + if (this.bulkStreaming) { + x.streamingCountry = this.bulkStreaming; + } this.identityService.updateUser(x).subscribe(y => { if (!y.successful) { this.notificationService.error(`Could not update user ${x.userName}. Reason ${y.errors[0]}`); @@ -102,6 +105,7 @@ export class UserManagementComponent implements OnInit { this.bulkMovieLimit = undefined; this.bulkEpisodeLimit = undefined; this.bulkMusicLimit = undefined; + this.bulkStreaming = undefined; } public isAllSelected() { From b8076e2e655958522ed4974ea1cdc88dfe63f798 Mon Sep 17 00:00:00 2001 From: Dyson Parkes Date: Mon, 10 May 2021 13:43:00 +1200 Subject: [PATCH 043/104] Adjust app store string --- .../components/user-preference/user-preference.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html index ab9f7bf0c..6954030de 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html @@ -62,7 +62,7 @@
Get it on Google Play
@@ -128,4 +128,4 @@ -
\ No newline at end of file + From 21b8bf76d28b4b232f1fb74f86d2fc82da8edb24 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 11 May 2021 09:51:18 +0100 Subject: [PATCH 044/104] Fixed an issue where for Available Emby content, the service ID was not being passed --- src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs index 3fe11cbc4..7f6718a6b 100644 --- a/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs @@ -67,7 +67,7 @@ namespace Ombi.Core.Rule.Rules.Search var s = await EmbySettings.GetSettingsAsync(); if (s.Enable) { - var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null); + var server = s.Servers.FirstOrDefault(); if ((server?.ServerHostname ?? string.Empty).HasValue()) { obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerId, server?.ServerHostname); From 65879acb8d2abc981409a5bd3419b064417aef98 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 16 May 2021 11:52:37 +0100 Subject: [PATCH 045/104] Fixed the deseralizing issue #4181 --- src/Ombi.Api.Radarr/Models/V2/RadarrAddMovie.cs | 1 + src/Ombi.Api.Radarr/RadarrApi.cs | 3 ++- src/Ombi.Api.Radarr/RadarrV3Api.cs | 3 ++- src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Ombi.Api.Radarr/Models/V2/RadarrAddMovie.cs b/src/Ombi.Api.Radarr/Models/V2/RadarrAddMovie.cs index b56049c9a..09e985f43 100644 --- a/src/Ombi.Api.Radarr/Models/V2/RadarrAddMovie.cs +++ b/src/Ombi.Api.Radarr/Models/V2/RadarrAddMovie.cs @@ -28,5 +28,6 @@ namespace Ombi.Api.Radarr.Models public string titleSlug { get; set; } public int year { get; set; } public string minimumAvailability { get; set; } + public long sizeOnDisk { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Api.Radarr/RadarrApi.cs b/src/Ombi.Api.Radarr/RadarrApi.cs index b461ccda8..e1879bba3 100644 --- a/src/Ombi.Api.Radarr/RadarrApi.cs +++ b/src/Ombi.Api.Radarr/RadarrApi.cs @@ -82,7 +82,8 @@ namespace Ombi.Api.Radarr titleSlug = title + year, monitored = true, year = year, - minimumAvailability = minimumAvailability + minimumAvailability = minimumAvailability, + sizeOnDisk = 0 }; if (searchNow) diff --git a/src/Ombi.Api.Radarr/RadarrV3Api.cs b/src/Ombi.Api.Radarr/RadarrV3Api.cs index dd1d0b279..21f95b3e1 100644 --- a/src/Ombi.Api.Radarr/RadarrV3Api.cs +++ b/src/Ombi.Api.Radarr/RadarrV3Api.cs @@ -85,7 +85,8 @@ namespace Ombi.Api.Radarr titleSlug = title + year, monitored = true, year = year, - minimumAvailability = minimumAvailability + minimumAvailability = minimumAvailability, + sizeOnDisk = 0 }; if (searchNow) diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts index d4c5a9883..256f0a75e 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts @@ -43,7 +43,7 @@ export class RadarrComponent implements OnInit { addOnly: [x.addOnly], minimumAvailability: [x.minimumAvailability, [Validators.required]], scanForAvailability: [x.scanForAvailability], - v3: [x.v3] + v3: [x.v3 ?? true] }); if (x.defaultQualityProfile) { From d23c4c38594d96e28c8bf6de0e6e69b7f84276b4 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 16 May 2021 12:03:39 +0100 Subject: [PATCH 046/104] removed the ripple from the navmenu #4192 --- .../ClientApp/src/app/my-nav/my-nav.component.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html index c1b69b303..f73c9bbc8 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html @@ -6,12 +6,12 @@ {{applicationName}} - + -