added delete series event

pull/4/head
Keivan Beigi 12 years ago
parent 80ac142434
commit cc1dcffdf3

@ -265,6 +265,7 @@
<Compile Include="Tv\Events\EpisodeInfoUpdatedEvent.cs" />
<Compile Include="Tv\Events\EpisodeInfoAddedEvent.cs" />
<Compile Include="Tv\Events\SeriesAddedEvent.cs" />
<Compile Include="Tv\Events\SeriesDeletedEvent.cs" />
<Compile Include="Tv\Events\SeriesUpdatedEvent.cs" />
<Compile Include="Tv\SeasonRepository.cs" />
<Compile Include="Tv\SeriesRepository.cs" />

@ -0,0 +1,15 @@
using System.Linq;
using NzbDrone.Common.Eventing;
namespace NzbDrone.Core.Tv.Events
{
public class SeriesDeletedEvent : IEvent
{
public Series Series { get; private set; }
public SeriesDeletedEvent(Series series)
{
Series = series;
}
}
}

@ -8,7 +8,6 @@ using NzbDrone.Core.Configuration;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.ReferenceData;
using NzbDrone.Core.Tv.Events;
@ -24,6 +23,7 @@ namespace NzbDrone.Core.Tv
void UpdateFromSeriesEditor(IList<Series> editedSeries);
Series FindByTvdbId(int tvdbId);
void SetSeriesType(int seriesId, SeriesTypes seriesTypes);
void DeleteSeries(int seriesId);
}
public class SeriesService : ISeriesService
@ -167,6 +167,11 @@ namespace NzbDrone.Core.Tv
_seriesRepository.SetSeriesType(seriesId, seriesTypes);
}
public void DeleteSeries(int seriesId)
{
var series = _seriesRepository.Get(seriesId);
_seriesRepository.Delete(seriesId);
_eventAggregator.Publish(new SeriesDeletedEvent(series));
}
}
}

Loading…
Cancel
Save