More fixes for signalr + episodes
This commit is contained in:
parent
293e6cac6d
commit
a6639fecd9
|
@ -8,7 +8,7 @@ using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Calendar
|
namespace NzbDrone.Api.Calendar
|
||||||
{
|
{
|
||||||
public class CalendarModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
|
public class CalendarModule : EpisodeModuleWithSignalR
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
private readonly SeriesRepository _seriesRepository;
|
private readonly SeriesRepository _seriesRepository;
|
||||||
|
@ -22,7 +22,6 @@ namespace NzbDrone.Api.Calendar
|
||||||
_seriesRepository = seriesRepository;
|
_seriesRepository = seriesRepository;
|
||||||
|
|
||||||
GetResourceAll = GetCalendar;
|
GetResourceAll = GetCalendar;
|
||||||
GetResourceById = GetEpisode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<EpisodeResource> GetCalendar()
|
private List<EpisodeResource> GetCalendar()
|
||||||
|
|
|
@ -5,8 +5,7 @@ using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Episodes
|
namespace NzbDrone.Api.Episodes
|
||||||
{
|
{
|
||||||
public class EpisodeModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
|
public class EpisodeModule : EpisodeModuleWithSignalR
|
||||||
|
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,9 @@ using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Episodes
|
namespace NzbDrone.Api.Episodes
|
||||||
{
|
{
|
||||||
public abstract class EpisodeModuleWithSignalR<TResource, TModel> : NzbDroneRestModuleWithSignalR<TResource, TModel>,
|
public abstract class EpisodeModuleWithSignalR : NzbDroneRestModuleWithSignalR<EpisodeResource, Episode>,
|
||||||
IHandle<EpisodeGrabbedEvent>,
|
IHandle<EpisodeGrabbedEvent>,
|
||||||
IHandle<EpisodeDownloadedEvent>
|
IHandle<EpisodeDownloadedEvent>
|
||||||
where TResource : EpisodeResource, new()
|
|
||||||
where TModel : Episode
|
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
|
|
||||||
|
@ -20,6 +18,8 @@ namespace NzbDrone.Api.Episodes
|
||||||
: base(commandExecutor)
|
: base(commandExecutor)
|
||||||
{
|
{
|
||||||
_episodeService = episodeService;
|
_episodeService = episodeService;
|
||||||
|
|
||||||
|
GetResourceById = GetEpisode;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EpisodeModuleWithSignalR(IEpisodeService episodeService, ICommandExecutor commandExecutor, string resource)
|
protected EpisodeModuleWithSignalR(IEpisodeService episodeService, ICommandExecutor commandExecutor, string resource)
|
||||||
|
@ -37,7 +37,7 @@ namespace NzbDrone.Api.Episodes
|
||||||
{
|
{
|
||||||
foreach (var episode in message.Episode.Episodes)
|
foreach (var episode in message.Episode.Episodes)
|
||||||
{
|
{
|
||||||
var resource = episode.InjectTo<TResource>();
|
var resource = episode.InjectTo<EpisodeResource>();
|
||||||
resource.Grabbed = true;
|
resource.Grabbed = true;
|
||||||
|
|
||||||
BroadcastResourceChange(ModelAction.Updated, resource);
|
BroadcastResourceChange(ModelAction.Updated, resource);
|
||||||
|
|
|
@ -7,7 +7,7 @@ using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Wanted
|
namespace NzbDrone.Api.Wanted
|
||||||
{
|
{
|
||||||
public class CutoffModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
|
public class CutoffModule : EpisodeModuleWithSignalR
|
||||||
{
|
{
|
||||||
private readonly IEpisodeCutoffService _episodeCutoffService;
|
private readonly IEpisodeCutoffService _episodeCutoffService;
|
||||||
private readonly ISeriesRepository _seriesRepository;
|
private readonly ISeriesRepository _seriesRepository;
|
||||||
|
|
|
@ -7,7 +7,7 @@ using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Wanted
|
namespace NzbDrone.Api.Wanted
|
||||||
{
|
{
|
||||||
public class MissingModule : EpisodeModuleWithSignalR<EpisodeResource, Episode>
|
public class MissingModule : EpisodeModuleWithSignalR
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
private readonly ISeriesRepository _seriesRepository;
|
private readonly ISeriesRepository _seriesRepository;
|
||||||
|
|
Loading…
Reference in New Issue