mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Finished #923 !!!
This commit is contained in:
parent
02a1770b31
commit
4926255094
18 changed files with 283 additions and 22 deletions
|
@ -76,7 +76,7 @@ namespace Ombi.UI.Modules
|
|||
ISettingsService<PlexSettings> plexService, ISettingsService<AuthenticationSettings> auth,
|
||||
IRepository<UsersToNotify> u, ISettingsService<EmailNotificationSettings> email,
|
||||
IIssueService issue, IAnalytics a, IRepository<RequestLimit> rl, ITransientFaultQueue tfQueue, IRepository<PlexContent> content,
|
||||
ISecurityExtensions security, IMovieSender movieSender)
|
||||
ISecurityExtensions security, IMovieSender movieSender, IRadarrCacher radarrCacher)
|
||||
: base("search", prSettings, security)
|
||||
{
|
||||
Auth = auth;
|
||||
|
@ -108,6 +108,7 @@ namespace Ombi.UI.Modules
|
|||
PlexContentRepository = content;
|
||||
MovieSender = movieSender;
|
||||
WatcherCacher = watcherCacher;
|
||||
RadarrCacher = radarrCacher;
|
||||
|
||||
Get["SearchIndex", "/", true] = async (x, ct) => await RequestLoad();
|
||||
|
||||
|
@ -157,6 +158,7 @@ namespace Ombi.UI.Modules
|
|||
private IAnalytics Analytics { get; }
|
||||
private ITransientFaultQueue FaultQueue { get; }
|
||||
private IRepository<RequestLimit> RequestLimitRepo { get; }
|
||||
private IRadarrCacher RadarrCacher { get; }
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private async Task<Negotiator> RequestLoad()
|
||||
|
@ -236,6 +238,7 @@ namespace Ombi.UI.Modules
|
|||
|
||||
var cpCached = CpCacher.QueuedIds();
|
||||
var watcherCached = WatcherCacher.QueuedIds();
|
||||
var radarrCached = RadarrCacher.QueuedIds();
|
||||
var content = PlexContentRepository.GetAll();
|
||||
var plexMovies = Checker.GetPlexMovies(content);
|
||||
var viewMovies = new List<SearchMovieViewModel>();
|
||||
|
@ -288,13 +291,19 @@ namespace Ombi.UI.Modules
|
|||
}
|
||||
else if (cpCached.Contains(movie.Id) && canSee) // compare to the couchpotato db
|
||||
{
|
||||
viewMovie.Approved = true;
|
||||
viewMovie.Requested = true;
|
||||
}
|
||||
else if(watcherCached.Contains(imdbId) && canSee) // compare to the watcher db
|
||||
{
|
||||
viewMovie.Approved = true;
|
||||
viewMovie.Requested = true;
|
||||
}
|
||||
else if (radarrCached.Contains(movie.Id) && canSee)
|
||||
{
|
||||
viewMovie.Approved = true;
|
||||
viewMovie.Requested = true;
|
||||
}
|
||||
|
||||
viewMovies.Add(viewMovie);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue