Hookup Auto and Manual Search in Album Dialog

Hookup Auto and Manual Search in Album Dialog
pull/18/head
Qstick 8 years ago
parent f0b68afccd
commit 3888fec0d1

@ -77,26 +77,26 @@ namespace NzbDrone.Api.Indexers
private List<ReleaseResource> GetReleases()
{
if (Request.Query.episodeId != null)
if (Request.Query.albumId != null)
{
return GetEpisodeReleases(Request.Query.episodeId);
return GetAlbumReleases(Request.Query.albumId);
}
return GetRss();
}
private List<ReleaseResource> GetEpisodeReleases(int episodeId)
private List<ReleaseResource> GetAlbumReleases(int albumId)
{
try
{
var decisions = _nzbSearchService.EpisodeSearch(episodeId, true);
var decisions = _nzbSearchService.AlbumSearch(albumId, true, true);
var prioritizedDecisions = _prioritizeDownloadDecision.PrioritizeDecisions(decisions);
return MapDecisions(prioritizedDecisions);
}
catch (Exception ex)
{
_logger.Error(ex, "Episode search failed");
_logger.Error(ex, "Album search failed");
}
return new List<ReleaseResource>();

@ -42,8 +42,8 @@ module.exports = Marionette.Layout.extend({
e.preventDefault();
}
CommandController.Execute('episodeSearch', {
episodeIds : [this.model.get('id')] //TODO Refactor for Albums search
CommandController.Execute('albumSearch', {
albumId : this.model.get('id')
});
vent.trigger(vent.Commands.CloseModalCommand);
@ -56,7 +56,7 @@ module.exports = Marionette.Layout.extend({
this.mainView = new LoadingView();
this._showMainView();
this.releaseCollection.fetchEpisodeReleases(this.model.id); //TODO Refactor for Albums
this.releaseCollection.fetchAlbumReleases(this.model.id);
},
_showMainView : function() {

@ -46,8 +46,8 @@ var Collection = PagableCollection.extend({
}
},
fetchEpisodeReleases : function(episodeId) {
return this.fetch({ data : { episodeId : episodeId } });
fetchAlbumReleases : function(albumId) {
return this.fetch({ data : { albumId : albumId } });
}
});

Loading…
Cancel
Save