1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

added delete series event

This commit is contained in:
Keivan Beigi 2013-03-05 11:35:33 -08:00
parent 80ac142434
commit cc1dcffdf3
3 changed files with 23 additions and 2 deletions

View File

@ -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" />

View File

@ -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;
}
}
}

View File

@ -8,7 +8,6 @@
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 @@ public interface ISeriesService
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 @@ public void SetSeriesType(int seriesId, SeriesTypes seriesTypes)
_seriesRepository.SetSeriesType(seriesId, seriesTypes);
}
public void DeleteSeries(int seriesId)
{
var series = _seriesRepository.Get(seriesId);
_seriesRepository.Delete(seriesId);
_eventAggregator.Publish(new SeriesDeletedEvent(series));
}
}
}