Fixed: Errors after episode is imported

pull/106/merge
Mark McDowall 10 years ago
parent ebf0dbc1d0
commit 57a95d4cc5

@ -2,9 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Tv;
using NzbDrone.SignalR;
@ -13,9 +11,10 @@ namespace NzbDrone.Api.Calendar
public class CalendarModule : EpisodeModuleWithSignalR
{
public CalendarModule(IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, qualityUpgradableSpecification, signalRBroadcaster, "calendar")
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "calendar")
{
GetResourceAll = GetCalendar;
}

@ -1,7 +1,6 @@
using System.Collections.Generic;
using NzbDrone.Api.REST;
using NzbDrone.Core.Tv;
using NzbDrone.Api.Mapping;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.SignalR;
@ -9,16 +8,12 @@ namespace NzbDrone.Api.Episodes
{
public class EpisodeModule : EpisodeModuleWithSignalR
{
protected readonly ISeriesService _seriesService;
public EpisodeModule(ISeriesService seriesService,
IEpisodeService episodeService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, qualityUpgradableSpecification, signalRBroadcaster)
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster)
{
_seriesService = seriesService;
GetResourceAll = GetEpisodes;
UpdateResource = SetMonitored;
}
@ -32,8 +27,6 @@ namespace NzbDrone.Api.Episodes
throw new BadRequestException("seriesId is missing");
}
var series = _seriesService.GetSeries(seriesId.Value);
var resources = ToListResource(_episodeService.GetEpisodeBySeries(seriesId.Value));
return resources;

@ -17,26 +17,31 @@ namespace NzbDrone.Api.Episodes
IHandle<EpisodeDownloadedEvent>
{
protected readonly IEpisodeService _episodeService;
protected readonly ISeriesService _seriesService;
protected readonly IQualityUpgradableSpecification _qualityUpgradableSpecification;
protected EpisodeModuleWithSignalR(IEpisodeService episodeService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(signalRBroadcaster)
{
_episodeService = episodeService;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
GetResourceById = GetEpisode;
}
protected EpisodeModuleWithSignalR(IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster,
String resource)
: base(signalRBroadcaster, resource)
{
_episodeService = episodeService;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
GetResourceById = GetEpisode;
@ -46,6 +51,7 @@ namespace NzbDrone.Api.Episodes
{
var episode = _episodeService.GetEpisode(id);
episode.EpisodeFile.LazyLoad();
episode.Series = _seriesService.GetSeries(episode.SeriesId);
return ToResource(episode);
}

@ -1,6 +1,4 @@
using System.Linq;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions;
using NzbDrone.Api.Episodes;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv;
@ -14,9 +12,10 @@ namespace NzbDrone.Api.Wanted
public CutoffModule(IEpisodeCutoffService episodeCutoffService,
IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/cutoff")
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/cutoff")
{
_episodeCutoffService = episodeCutoffService;
GetResourcePaged = GetCutoffUnmetEpisodes;

@ -1,10 +1,6 @@
using System;
using System.Linq;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions;
using NzbDrone.Api.Episodes;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Tv;
using NzbDrone.SignalR;
@ -13,9 +9,10 @@ namespace NzbDrone.Api.Wanted
public class MissingModule : EpisodeModuleWithSignalR
{
public MissingModule(IEpisodeService episodeService,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/missing")
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/missing")
{
GetResourcePaged = GetMissingEpisodes;
}

Loading…
Cancel
Save