mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
Added logging
This commit is contained in:
parent
73635e06c3
commit
3dcf55ce7a
12 changed files with 120 additions and 14 deletions
|
@ -28,7 +28,7 @@ using System;
|
|||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PlexRequests.Api.Models.Movie;
|
||||
using NLog;
|
||||
|
||||
using RestSharp;
|
||||
|
||||
|
@ -41,6 +41,7 @@ namespace PlexRequests.Api
|
|||
Api = new ApiRequest();
|
||||
}
|
||||
private ApiRequest Api { get; set; }
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public bool AddMovie(string imdbid, string apiKey, string title, string baseUrl)
|
||||
{
|
||||
|
@ -51,9 +52,13 @@ namespace PlexRequests.Api
|
|||
request.AddUrlSegment("title", title);
|
||||
|
||||
var obj = Api.ExecuteJson<JObject>(request, new Uri(baseUrl));
|
||||
Log.Trace("CP movie Add result count {0}", obj.Count);
|
||||
|
||||
if (obj.Count > 0)
|
||||
{
|
||||
Log.Trace("CP movie obj[\"success\"] = {0}", obj["success"]);
|
||||
var result = (bool)obj["success"];
|
||||
Log.Trace("CP movie Add result {0}", result);
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue