mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Add ArtistEditedService to handle AlbumType Changes
This commit is contained in:
parent
bba52cdbc8
commit
debad793ee
1 changed files with 26 additions and 0 deletions
26
src/NzbDrone.Core/Music/ArtistEditedService.cs
Normal file
26
src/NzbDrone.Core/Music/ArtistEditedService.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
using NzbDrone.Core.Music.Commands;
|
||||||
|
using NzbDrone.Core.Music.Events;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Music
|
||||||
|
{
|
||||||
|
public class ArtistEditedService : IHandle<ArtistEditedEvent>
|
||||||
|
{
|
||||||
|
private readonly IManageCommandQueue _commandQueueManager;
|
||||||
|
|
||||||
|
public ArtistEditedService(IManageCommandQueue commandQueueManager)
|
||||||
|
{
|
||||||
|
_commandQueueManager = commandQueueManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(ArtistEditedEvent message)
|
||||||
|
{
|
||||||
|
// Refresh Artist is we change AlbumType Preferences
|
||||||
|
if (message.Artist.PrimaryAlbumTypes != message.OldArtist.PrimaryAlbumTypes || message.Artist.SecondaryAlbumTypes != message.OldArtist.SecondaryAlbumTypes)
|
||||||
|
{
|
||||||
|
_commandQueueManager.Push(new RefreshArtistCommand(message.Artist.Id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue