mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Change AlbumSearchCommand to take a list of ids instead of a single id
This commit is contained in:
parent
163a2f7495
commit
8bde4b660c
3 changed files with 21 additions and 7 deletions
|
@ -1,11 +1,21 @@
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using System.Collections.Generic;
|
||||||
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
|
|
||||||
namespace NzbDrone.Core.IndexerSearch
|
namespace NzbDrone.Core.IndexerSearch
|
||||||
{
|
{
|
||||||
class AlbumSearchCommand : Command
|
class AlbumSearchCommand : Command
|
||||||
{
|
{
|
||||||
public int AlbumId { get; set; }
|
public List<int> AlbumIds { get; set; }
|
||||||
|
|
||||||
public override bool SendUpdatesToClient => true;
|
public override bool SendUpdatesToClient => true;
|
||||||
|
|
||||||
|
public AlbumSearchCommand()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlbumSearchCommand(List<int> albumIds)
|
||||||
|
{
|
||||||
|
AlbumIds = albumIds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,14 @@ namespace NzbDrone.Core.IndexerSearch
|
||||||
|
|
||||||
public void Execute(AlbumSearchCommand message)
|
public void Execute(AlbumSearchCommand message)
|
||||||
{
|
{
|
||||||
var decisions = _nzbSearchService.AlbumSearch(message.AlbumId, false, message.Trigger == CommandTrigger.Manual);
|
foreach (var albumId in message.AlbumIds)
|
||||||
|
{
|
||||||
|
var decisions =
|
||||||
|
_nzbSearchService.AlbumSearch(albumId, false, message.Trigger == CommandTrigger.Manual);
|
||||||
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ module.exports = Marionette.Layout.extend({
|
||||||
command : {
|
command : {
|
||||||
name : 'albumSearch',
|
name : 'albumSearch',
|
||||||
artistId : this.artist.id,
|
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', {
|
CommandController.Execute('albumSearch', {
|
||||||
name : 'albumSearch',
|
name : 'albumSearch',
|
||||||
artistId : this.artist.id,
|
artistId : this.artist.id,
|
||||||
albumId : this.model.get('id')
|
albumIds : [this.model.get('id')]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue