mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
Added logging
This commit is contained in:
parent
73635e06c3
commit
3dcf55ce7a
12 changed files with 120 additions and 14 deletions
|
@ -33,6 +33,8 @@ using System.Xml.Serialization;
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using NLog;
|
||||
|
||||
using PlexRequests.Api.Interfaces;
|
||||
using PlexRequests.Api.Models;
|
||||
|
||||
|
@ -42,7 +44,7 @@ namespace PlexRequests.Api
|
|||
{
|
||||
public class ApiRequest : IApiRequest
|
||||
{
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
/// <summary>
|
||||
/// An API request handler
|
||||
/// </summary>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -42,6 +42,10 @@
|
|||
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.2.3\lib\net45\NLog.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RestSharp.105.2.3\lib\net452\RestSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<package id="Dapper" version="1.42" targetFramework="net452" />
|
||||
<package id="Nancy" version="1.4.3" targetFramework="net452" />
|
||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
|
||||
<package id="NLog" version="4.2.3" targetFramework="net452" />
|
||||
<package id="RestSharp" version="105.2.3" targetFramework="net452" />
|
||||
<package id="TMDbLib" version="0.9.0.0-alpha" targetFramework="net452" />
|
||||
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue