mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
cache plex library data regardless of whether we have requests in the database or not
This commit is contained in:
parent
e8e7367019
commit
4c6c0ae900
1 changed files with 13 additions and 8 deletions
|
@ -35,7 +35,6 @@ using PlexRequests.Api.Models.Plex;
|
|||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Helpers;
|
||||
using PlexRequests.Helpers.Exceptions;
|
||||
using PlexRequests.Services.Interfaces;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.Services.Models;
|
||||
|
@ -67,14 +66,10 @@ namespace PlexRequests.Services
|
|||
var plexSettings = Plex.GetSettings();
|
||||
var authSettings = Auth.GetSettings();
|
||||
Log.Trace("Getting all the requests");
|
||||
var requests = RequestService.GetAll();
|
||||
|
||||
var requestedModels = requests as RequestedModel[] ?? requests.Where(x => !x.Available).ToArray();
|
||||
Log.Trace("Requests Count {0}", requestedModels.Length);
|
||||
|
||||
if (!ValidateSettings(plexSettings, authSettings) || !requestedModels.Any())
|
||||
|
||||
if (!ValidateSettings(plexSettings, authSettings))
|
||||
{
|
||||
Log.Info("Validation of the settings failed or there is no requests.");
|
||||
Log.Info("Validation of the plex settings failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -83,6 +78,16 @@ namespace PlexRequests.Services
|
|||
var shows = GetPlexTvShows().ToArray();
|
||||
var albums = GetPlexAlbums().ToArray();
|
||||
|
||||
var requests = RequestService.GetAll();
|
||||
var requestedModels = requests as RequestedModel[] ?? requests.Where(x => !x.Available).ToArray();
|
||||
Log.Trace("Requests Count {0}", requestedModels.Length);
|
||||
|
||||
if (!requestedModels.Any())
|
||||
{
|
||||
Log.Info("There are no requests to check.");
|
||||
return;
|
||||
}
|
||||
|
||||
var modifiedModel = new List<RequestedModel>();
|
||||
foreach (var r in requestedModels)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue