From a0e0ae1da35bbc16dbd3c496f7443026c717926d Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Apr 2022 11:49:15 +0200 Subject: [PATCH 1/2] Hide subscribe button when request is available --- src/Ombi.Core/Engine/MovieRequestEngine.cs | 5 ++++- src/Ombi.Core/Engine/MusicRequestEngine.cs | 5 ++++- src/Ombi.Core/Engine/TvRequestEngine.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index cb4cb4ba6..b290633d5 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -533,7 +533,10 @@ namespace Ombi.Core.Engine } else { - x.ShowSubscribe = true; + if (!x.Available && !x.Available4K) + { + x.ShowSubscribe = true; + } var hasSub = sub.FirstOrDefault(r => r.RequestId == x.Id); x.Subscribed = hasSub != null; } diff --git a/src/Ombi.Core/Engine/MusicRequestEngine.cs b/src/Ombi.Core/Engine/MusicRequestEngine.cs index 640d2ade3..e6fc1dad8 100644 --- a/src/Ombi.Core/Engine/MusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/MusicRequestEngine.cs @@ -270,7 +270,10 @@ namespace Ombi.Core.Engine } else { - x.ShowSubscribe = true; + if (!x.Available) + { + x.ShowSubscribe = true; + } var hasSub = sub.FirstOrDefault(r => r.RequestId == x.Id); x.Subscribed = hasSub != null; } diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index 5664d276f..a684f903c 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -886,7 +886,10 @@ namespace Ombi.Core.Engine } else { - x.ShowSubscribe = true; + if (!x.Available) + { + x.ShowSubscribe = true; + } var result = relevantSubs.FirstOrDefault(s => s.RequestId == x.Id); x.Subscribed = result != null; } From 8daf8e0c7f988e48a9b2ea520ef184411e0f7bb9 Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:00:40 +0200 Subject: [PATCH 2/2] Hide subscribe button when request is denied --- src/Ombi.Core/Engine/MovieRequestEngine.cs | 2 +- src/Ombi.Core/Engine/MusicRequestEngine.cs | 2 +- src/Ombi.Core/Engine/TvRequestEngine.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index b290633d5..9403fdcae 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -533,7 +533,7 @@ namespace Ombi.Core.Engine } else { - if (!x.Available && !x.Available4K) + if (!x.Available && !x.Available4K && (!x.Denied ?? true) && (!x.Denied4K ?? true)) { x.ShowSubscribe = true; } diff --git a/src/Ombi.Core/Engine/MusicRequestEngine.cs b/src/Ombi.Core/Engine/MusicRequestEngine.cs index e6fc1dad8..67caa81a2 100644 --- a/src/Ombi.Core/Engine/MusicRequestEngine.cs +++ b/src/Ombi.Core/Engine/MusicRequestEngine.cs @@ -270,7 +270,7 @@ namespace Ombi.Core.Engine } else { - if (!x.Available) + if (!x.Available && (!x.Denied ?? false)) { x.ShowSubscribe = true; } diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index a684f903c..8ccc6d17e 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -886,7 +886,7 @@ namespace Ombi.Core.Engine } else { - if (!x.Available) + if (!x.Available && (!x.Denied ?? true)) { x.ShowSubscribe = true; }