1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-28 10:37:41 +00:00

Add ArtistEditedService to handle AlbumType Changes

This commit is contained in:
Qstick 2017-10-16 22:08:49 -04:00
parent bba52cdbc8
commit debad793ee

View 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));
}
}
}
}