diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 6e81e3e73..cb4cb4ba6 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -251,7 +251,7 @@ namespace Ombi.Core.Engine var requests = await (OrderMovies(allRequests, orderFilter.OrderType)).Skip(position).Take(count) .ToListAsync(); - await CheckForSubscription(shouldHide, requests); + await CheckForSubscription(shouldHide.UserId, requests); return new RequestsViewModel { Collection = requests, @@ -295,7 +295,7 @@ namespace Ombi.Core.Engine var total = requests.Count(); requests = requests.Skip(position).Take(count).ToList(); - await CheckForSubscription(shouldHide, requests); + await CheckForSubscription(shouldHide.UserId, requests); return new RequestsViewModel { Collection = requests, @@ -380,7 +380,7 @@ namespace Ombi.Core.Engine // TODO fix this so we execute this on the server requests = requests.Skip(position).Take(count).ToList(); - await CheckForSubscription(shouldHide, requests); + await CheckForSubscription(shouldHide.UserId, requests); return new RequestsViewModel { Collection = requests, @@ -423,7 +423,7 @@ namespace Ombi.Core.Engine var total = requests.Count(); requests = requests.Skip(position).Take(count).ToList(); - await CheckForSubscription(shouldHide, requests); + await CheckForSubscription(shouldHide.UserId, requests); return new RequestsViewModel { Collection = requests, @@ -505,7 +505,7 @@ namespace Ombi.Core.Engine allRequests = await MovieRepository.GetWithUser().ToListAsync(); } - await CheckForSubscription(shouldHide, allRequests); + await CheckForSubscription(shouldHide.UserId, allRequests); return allRequests; } @@ -513,21 +513,21 @@ namespace Ombi.Core.Engine public async Task GetRequest(int requestId) { var request = await MovieRepository.GetWithUser().Where(x => x.Id == requestId).FirstOrDefaultAsync(); - await CheckForSubscription(new HideResult(), new List { request }); + await CheckForSubscription((await GetUser()).Id, new List { request }); return request; } - private async Task CheckForSubscription(HideResult shouldHide, List movieRequests) + private async Task CheckForSubscription(string UserId, List movieRequests) { var requestIds = movieRequests.Select(x => x.Id); var sub = await _subscriptionRepository.GetAll().Where(s => - s.UserId == shouldHide.UserId && requestIds.Contains(s.RequestId) && s.RequestType == RequestType.Movie) + s.UserId == UserId && requestIds.Contains(s.RequestId) && s.RequestType == RequestType.Movie) .ToListAsync(); foreach (var x in movieRequests) { x.PosterPath = PosterPathHelper.FixPosterPath(x.PosterPath); - if (shouldHide.UserId == x.RequestedUserId) + if (UserId == x.RequestedUserId) { x.ShowSubscribe = false; } @@ -559,7 +559,7 @@ namespace Ombi.Core.Engine } var results = allRequests.Where(x => x.Title.Contains(search, CompareOptions.IgnoreCase)).ToList(); - await CheckForSubscription(shouldHide, results); + await CheckForSubscription(shouldHide.UserId, results); return results; } diff --git a/src/Ombi.Core/Models/Search/SearchViewModel.cs b/src/Ombi.Core/Models/Search/SearchViewModel.cs index 4cf812982..e1a2f2850 100644 --- a/src/Ombi.Core/Models/Search/SearchViewModel.cs +++ b/src/Ombi.Core/Models/Search/SearchViewModel.cs @@ -1,4 +1,5 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System; +using System.ComponentModel.DataAnnotations.Schema; using Ombi.Store.Entities; namespace Ombi.Core.Models.Search @@ -32,6 +33,7 @@ namespace Ombi.Core.Models.Search public string TheMovieDbId { get; set; } [NotMapped] + [Obsolete("Use request service instead")] public bool Subscribed { get; set; } [NotMapped] public bool ShowSubscribe { get; set; } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html index d3997fb1c..2207ea323 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html @@ -4,30 +4,18 @@
- + @@ -43,118 +31,147 @@
- + {{'Search.ViewOnPlex' | translate}} - + {{'Search.ViewOnEmby' | translate}} - + {{'Search.ViewOnJellyfin' | translate}} - - - - - - - - - + + + + + + + + + - - + + - - + - - - - - - + + + + + - - + + + + + + + - - - - - - - - - - - - - - - - + + + +
@@ -163,7 +180,8 @@
- + @@ -199,9 +217,14 @@ {{'MediaDetails.Trailers' | translate}} - + - + @@ -229,7 +252,9 @@ @@ -249,7 +274,9 @@