mirror of https://github.com/lidarr/Lidarr
Hookup Auto and Manual Search in Album Dialog
Hookup Auto and Manual Search in Album Dialog
This commit is contained in:
parent
f0b68afccd
commit
3888fec0d1
|
@ -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>();
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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 } });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue