mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Added happy path tests for the Checker
This commit is contained in:
parent
64125cc44c
commit
d6763bf435
2 changed files with 104 additions and 8 deletions
|
|
@ -66,7 +66,7 @@ namespace PlexRequests.Services
|
|||
Log.Trace("Getting all the requests");
|
||||
var requests = RequestService.GetAll();
|
||||
|
||||
var requestedModels = requests as RequestedModel[] ?? requests.ToArray();
|
||||
var requestedModels = requests as RequestedModel[] ?? requests.Where(x => !x.Available).ToArray();
|
||||
Log.Trace("Requests Count {0}", requestedModels.Length);
|
||||
|
||||
if (!ValidateSettings(plexSettings, authSettings) || !requestedModels.Any())
|
||||
|
|
@ -107,7 +107,9 @@ namespace PlexRequests.Services
|
|||
Log.Trace("The result from Plex where the title matches for the video : {0}", videoResult != null);
|
||||
Log.Trace("The result from Plex where the title matches for the directory : {0}", directoryResult != null);
|
||||
|
||||
if (videoResult != null || directoryResult != null)
|
||||
var directoryResultVal = directoryResult ?? false;
|
||||
|
||||
if (videoResult != null || directoryResultVal)
|
||||
{
|
||||
r.Available = true;
|
||||
modifiedModel.Add(r);
|
||||
|
|
@ -120,7 +122,9 @@ namespace PlexRequests.Services
|
|||
Log.Trace("Updating the requests now");
|
||||
Log.Trace("Requests that will be updates:");
|
||||
Log.Trace(modifiedModel.SelectMany(x => x.Title).DumpJson());
|
||||
RequestService.BatchUpdate(modifiedModel);
|
||||
|
||||
if(modifiedModel.Any())
|
||||
{ RequestService.BatchUpdate(modifiedModel);}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue