More fixes for signalr + episodes

This commit is contained in:
Mark McDowall 2014-06-28 10:01:59 -07:00
parent 293e6cac6d
commit a6639fecd9
5 changed files with 8 additions and 10 deletions

View File

@ -8,7 +8,7 @@ using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Calendar
{
public class CalendarModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
public class CalendarModule : EpisodeModuleWithSignalR
{
private readonly IEpisodeService _episodeService;
private readonly SeriesRepository _seriesRepository;
@ -22,7 +22,6 @@ namespace NzbDrone.Api.Calendar
_seriesRepository = seriesRepository;
GetResourceAll = GetCalendar;
GetResourceById = GetEpisode;
}
private List<EpisodeResource> GetCalendar()

View File

@ -5,8 +5,7 @@ using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Episodes
{
public class EpisodeModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
public class EpisodeModule : EpisodeModuleWithSignalR
{
private readonly IEpisodeService _episodeService;

View File

@ -8,11 +8,9 @@ using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Episodes
{
public abstract class EpisodeModuleWithSignalR<TResource, TModel> : NzbDroneRestModuleWithSignalR<TResource, TModel>,
public abstract class EpisodeModuleWithSignalR : NzbDroneRestModuleWithSignalR<EpisodeResource, Episode>,
IHandle<EpisodeGrabbedEvent>,
IHandle<EpisodeDownloadedEvent>
where TResource : EpisodeResource, new()
where TModel : Episode
{
private readonly IEpisodeService _episodeService;
@ -20,6 +18,8 @@ namespace NzbDrone.Api.Episodes
: base(commandExecutor)
{
_episodeService = episodeService;
GetResourceById = GetEpisode;
}
protected EpisodeModuleWithSignalR(IEpisodeService episodeService, ICommandExecutor commandExecutor, string resource)
@ -37,7 +37,7 @@ namespace NzbDrone.Api.Episodes
{
foreach (var episode in message.Episode.Episodes)
{
var resource = episode.InjectTo<TResource>();
var resource = episode.InjectTo<EpisodeResource>();
resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);

View File

@ -7,7 +7,7 @@ using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Wanted
{
public class CutoffModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
public class CutoffModule : EpisodeModuleWithSignalR
{
private readonly IEpisodeCutoffService _episodeCutoffService;
private readonly ISeriesRepository _seriesRepository;

View File

@ -7,7 +7,7 @@ using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Wanted
{
public class MissingModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
public class MissingModule : EpisodeModuleWithSignalR
{
private readonly IEpisodeService _episodeService;
private readonly ISeriesRepository _seriesRepository;