public void Execute(RefreshAlbumCommand message) { if (message.AlbumId.HasValue) { var album = _albumService.GetAlbum(message.AlbumId.Value); var artist = _artistService.GetArtistByMetadataId(album.ArtistMetadataId); var updated = RefreshAlbumInfo(album, null, false); if (updated) { _eventAggregator.PublishEvent(new ArtistUpdatedEvent(artist)); } } }
public void Execute(RefreshAlbumCommand message) { if (message.AlbumId.HasValue) { var album = _albumService.GetAlbum(message.AlbumId.Value); var artist = _artistService.GetArtistByMetadataId(album.ArtistMetadataId); var updated = RefreshAlbumInfo(album, null, false); if (updated) { _eventAggregator.PublishEvent(new ArtistUpdatedEvent(artist)); _eventAggregator.PublishEvent(new AlbumUpdatedEvent(album)); } if (message.IsNewAlbum) { // Just scan the artist path - triggering a full rescan is too painful var folders = new List <string> { artist.Path }; _commandQueueManager.Push(new RescanFoldersCommand(folders, FilterFilesType.Matched, false, null)); } } }