From 3888fec0d13508d521ec28eb53600cddd6055822 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 28 Jul 2017 22:35:33 -0400 Subject: [PATCH] Hookup Auto and Manual Search in Album Dialog Hookup Auto and Manual Search in Album Dialog --- src/NzbDrone.Api/Indexers/ReleaseModule.cs | 10 +++++----- src/UI/Album/Search/AlbumSearchLayout.js | 6 +++--- src/UI/Release/ReleaseCollection.js | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/NzbDrone.Api/Indexers/ReleaseModule.cs b/src/NzbDrone.Api/Indexers/ReleaseModule.cs index 6a31ec0b9..9ad8eb964 100644 --- a/src/NzbDrone.Api/Indexers/ReleaseModule.cs +++ b/src/NzbDrone.Api/Indexers/ReleaseModule.cs @@ -77,26 +77,26 @@ namespace NzbDrone.Api.Indexers private List 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 GetEpisodeReleases(int episodeId) + private List 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(); diff --git a/src/UI/Album/Search/AlbumSearchLayout.js b/src/UI/Album/Search/AlbumSearchLayout.js index e4c21501a..e4364279b 100644 --- a/src/UI/Album/Search/AlbumSearchLayout.js +++ b/src/UI/Album/Search/AlbumSearchLayout.js @@ -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() { diff --git a/src/UI/Release/ReleaseCollection.js b/src/UI/Release/ReleaseCollection.js index a66547f00..a2dbb13ed 100644 --- a/src/UI/Release/ReleaseCollection.js +++ b/src/UI/Release/ReleaseCollection.js @@ -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 } }); } });