diff --git a/src/NzbDrone.Core/IndexerSearch/AlbumSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/AlbumSearchCommand.cs index d4c7b7c22..9f47c4e8c 100644 --- a/src/NzbDrone.Core/IndexerSearch/AlbumSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/AlbumSearchCommand.cs @@ -1,11 +1,21 @@ -using NzbDrone.Core.Messaging.Commands; +using System.Collections.Generic; +using NzbDrone.Core.Messaging.Commands; namespace NzbDrone.Core.IndexerSearch { class AlbumSearchCommand : Command { - public int AlbumId { get; set; } + public List AlbumIds { get; set; } public override bool SendUpdatesToClient => true; + + public AlbumSearchCommand() + { + } + + public AlbumSearchCommand(List albumIds) + { + AlbumIds = albumIds; + } } } diff --git a/src/NzbDrone.Core/IndexerSearch/AlbumSearchService.cs b/src/NzbDrone.Core/IndexerSearch/AlbumSearchService.cs index 22a098421..70a5be751 100644 --- a/src/NzbDrone.Core/IndexerSearch/AlbumSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/AlbumSearchService.cs @@ -22,10 +22,14 @@ namespace NzbDrone.Core.IndexerSearch public void Execute(AlbumSearchCommand message) { - var decisions = _nzbSearchService.AlbumSearch(message.AlbumId, false, message.Trigger == CommandTrigger.Manual); - var processed = _processDownloadDecisions.ProcessDecisions(decisions); + foreach (var albumId in message.AlbumIds) + { + var decisions = + _nzbSearchService.AlbumSearch(albumId, false, message.Trigger == CommandTrigger.Manual); + var processed = _processDownloadDecisions.ProcessDecisions(decisions); - _logger.ProgressInfo("Album search completed. {0} reports downloaded.", processed.Grabbed.Count); + _logger.ProgressInfo("Album search completed. {0} reports downloaded.", processed.Grabbed.Count); + } } } } diff --git a/src/UI/Artist/Details/AlbumLayout.js b/src/UI/Artist/Details/AlbumLayout.js index 4e18f710d..3015e9d6b 100644 --- a/src/UI/Artist/Details/AlbumLayout.js +++ b/src/UI/Artist/Details/AlbumLayout.js @@ -154,7 +154,7 @@ module.exports = Marionette.Layout.extend({ command : { name : 'albumSearch', artistId : this.artist.id, - albumId : this.model.get('id') + albumIds : [this.model.get('id')] } }); @@ -182,7 +182,7 @@ module.exports = Marionette.Layout.extend({ CommandController.Execute('albumSearch', { name : 'albumSearch', artistId : this.artist.id, - albumId : this.model.get('id') + albumIds : [this.model.get('id')] }); },