Fixed an issue where we would add the Sickrage series but it would fail on adding the seasons.

pull/140/head
tidusjar 9 years ago
parent 5d1b335d6c
commit f0d44b2788

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlexRequests.Api.Models.SickRage
namespace PlexRequests.Api.Models.SickRage
{
public class SickRageBase<T>
{
@ -12,4 +6,4 @@ namespace PlexRequests.Api.Models.SickRage
public string message { get; set; }
public string result { get; set; }
}
}
}

@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlexRequests.Api.Models.SickRage
namespace PlexRequests.Api.Models.SickRage
{
public class SickRageSeasonList : SickRageBase<int[]>
{
}
}
}

@ -132,9 +132,16 @@ namespace PlexRequests.Api
request.AddUrlSegment("apiKey", apiKey);
request.AddQueryParameter("tvdbid", tvdbId.ToString());
var obj = Api.ExecuteJson<SickRageSeasonList>(request, baseUrl);
return obj;
try
{
var obj = Api.ExecuteJson<SickRageSeasonList>(request, baseUrl);
return obj;
}
catch (Exception e)
{
Log.Error(e);
return new SickRageSeasonList();
}
}
public async Task<SickRageTvAdd> AddSeason(int tvdbId, int season, string apiKey, Uri baseUrl)

@ -47,7 +47,7 @@ namespace PlexRequests.Core.SettingModels
{
return new Dictionary<string, string>() {
{ "default", "Use Deafult" },
{ "sdtv", ">SD TV" },
{ "sdtv", "SD TV" },
{ "sddvd", "SD DVD" },
{ "hdtv", "HD TV" },
{ "rawhdtv", "Raw HD TV" },

@ -82,13 +82,14 @@ namespace PlexRequests.UI.Helpers
qualityId = sickRageSettings.QualityProfile;
}
var result = SickrageApi.AddSeries(model.ProviderId, model.SeasonCount, model.SeasonList, qualityId,
var apiResult = SickrageApi.AddSeries(model.ProviderId, model.SeasonCount, model.SeasonList, qualityId,
sickRageSettings.ApiKey, sickRageSettings.FullUri);
var result = apiResult.Result;
Log.Trace("SickRage Add Result: ");
Log.Trace(result.DumpJson());
return result.Result;
return result;
}
}
}
Loading…
Cancel
Save