mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
removed virtuals from Xem
This commit is contained in:
parent
9195dc6de5
commit
dbadf52029
@ -9,7 +9,14 @@
|
|||||||
|
|
||||||
namespace NzbDrone.Core.Providers
|
namespace NzbDrone.Core.Providers
|
||||||
{
|
{
|
||||||
public class XemCommunicationProvider
|
public interface IXemCommunicationProvider
|
||||||
|
{
|
||||||
|
List<Int32> GetXemSeriesIds(string origin = "tvdb");
|
||||||
|
List<XemSceneTvdbMapping> GetSceneTvdbMappings(int id);
|
||||||
|
void CheckForFailureResult(string response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class XemCommunicationProvider : IXemCommunicationProvider
|
||||||
{
|
{
|
||||||
private readonly IHttpProvider _httpProvider;
|
private readonly IHttpProvider _httpProvider;
|
||||||
|
|
||||||
@ -22,11 +29,7 @@ public XemCommunicationProvider(IHttpProvider httpProvider)
|
|||||||
_httpProvider = httpProvider;
|
_httpProvider = httpProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XemCommunicationProvider()
|
public List<Int32> GetXemSeriesIds(string origin = "tvdb")
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual List<Int32> GetXemSeriesIds(string origin = "tvdb")
|
|
||||||
{
|
{
|
||||||
_logger.Trace("Fetching Series IDs from: {0}", origin);
|
_logger.Trace("Fetching Series IDs from: {0}", origin);
|
||||||
|
|
||||||
@ -40,7 +43,7 @@ public virtual List<Int32> GetXemSeriesIds(string origin = "tvdb")
|
|||||||
return result.Data.ToList();
|
return result.Data.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual List<XemSceneTvdbMapping> GetSceneTvdbMappings(int id)
|
public List<XemSceneTvdbMapping> GetSceneTvdbMappings(int id)
|
||||||
{
|
{
|
||||||
_logger.Trace("Fetching Mappings for: {0}", id);
|
_logger.Trace("Fetching Mappings for: {0}", id);
|
||||||
var url = String.Format("{0}all?id={1}&origin=tvdb", XEM_BASE_URL, id);
|
var url = String.Format("{0}all?id={1}&origin=tvdb", XEM_BASE_URL, id);
|
||||||
@ -53,7 +56,7 @@ public virtual List<XemSceneTvdbMapping> GetSceneTvdbMappings(int id)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void CheckForFailureResult(string response)
|
public void CheckForFailureResult(string response)
|
||||||
{
|
{
|
||||||
var result = JsonConvert.DeserializeObject<XemResult<dynamic>>(response);
|
var result = JsonConvert.DeserializeObject<XemResult<dynamic>>(response);
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ public interface IXemProvider
|
|||||||
public class XemProvider : IXemProvider, IExecute<UpdateXemMappingsCommand>, IHandle<SeriesUpdatedEvent>
|
public class XemProvider : IXemProvider, IExecute<UpdateXemMappingsCommand>, IHandle<SeriesUpdatedEvent>
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
private readonly XemCommunicationProvider _xemCommunicationProvider;
|
private readonly IXemCommunicationProvider _xemCommunicationProvider;
|
||||||
private readonly ISeriesService _seriesService;
|
private readonly ISeriesService _seriesService;
|
||||||
|
|
||||||
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
public XemProvider(IEpisodeService episodeService, XemCommunicationProvider xemCommunicationProvider, ISeriesService seriesService)
|
public XemProvider(IEpisodeService episodeService, IXemCommunicationProvider xemCommunicationProvider, ISeriesService seriesService)
|
||||||
{
|
{
|
||||||
if (seriesService == null) throw new ArgumentNullException("seriesService");
|
if (seriesService == null) throw new ArgumentNullException("seriesService");
|
||||||
_episodeService = episodeService;
|
_episodeService = episodeService;
|
||||||
|
Loading…
Reference in New Issue
Block a user