mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 01:38:24 +00:00
added delete series event
This commit is contained in:
parent
80ac142434
commit
cc1dcffdf3
3 changed files with 23 additions and 2 deletions
|
@ -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" />
|
||||
|
|
15
NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs
Normal file
15
NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue