Hookup Auto and Manual Search in Album Dialog

Hookup Auto and Manual Search in Album Dialog
This commit is contained in:
Qstick 2017-07-28 22:35:33 -04:00
parent f0b68afccd
commit 3888fec0d1
3 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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