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; namespace PlexRequests.Api.Models.SickRage
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlexRequests.Api.Models.SickRage
{ {
public class SickRageBase<T> public class SickRageBase<T>
{ {

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

@ -132,10 +132,17 @@ namespace PlexRequests.Api
request.AddUrlSegment("apiKey", apiKey); request.AddUrlSegment("apiKey", apiKey);
request.AddQueryParameter("tvdbid", tvdbId.ToString()); request.AddQueryParameter("tvdbid", tvdbId.ToString());
try
{
var obj = Api.ExecuteJson<SickRageSeasonList>(request, baseUrl); var obj = Api.ExecuteJson<SickRageSeasonList>(request, baseUrl);
return obj; return obj;
} }
catch (Exception e)
{
Log.Error(e);
return new SickRageSeasonList();
}
}
public async Task<SickRageTvAdd> AddSeason(int tvdbId, int season, string apiKey, Uri baseUrl) 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>() { return new Dictionary<string, string>() {
{ "default", "Use Deafult" }, { "default", "Use Deafult" },
{ "sdtv", ">SD TV" }, { "sdtv", "SD TV" },
{ "sddvd", "SD DVD" }, { "sddvd", "SD DVD" },
{ "hdtv", "HD TV" }, { "hdtv", "HD TV" },
{ "rawhdtv", "Raw HD TV" }, { "rawhdtv", "Raw HD TV" },

@ -82,13 +82,14 @@ namespace PlexRequests.UI.Helpers
qualityId = sickRageSettings.QualityProfile; 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); sickRageSettings.ApiKey, sickRageSettings.FullUri);
var result = apiResult.Result;
Log.Trace("SickRage Add Result: "); Log.Trace("SickRage Add Result: ");
Log.Trace(result.DumpJson()); Log.Trace(result.DumpJson());
return result.Result; return result;
} }
} }
} }
Loading…
Cancel
Save