mirror of
https://github.com/Readarr/Readarr
synced 2026-01-08 16:43:34 +01:00
Fixed: Artist/Album lookup endpoints display error on failure
This commit is contained in:
parent
f2a1100d95
commit
6a414cff14
2 changed files with 2 additions and 6 deletions
|
|
@ -20,14 +20,12 @@ public AlbumLookupModule(ISearchForNewAlbum searchProxy)
|
|||
Get["/"] = x => Search();
|
||||
}
|
||||
|
||||
|
||||
private Response Search()
|
||||
{
|
||||
var searchResults = _searchProxy.SearchForNewAlbum((string)Request.Query.term, null);
|
||||
return MapToResource(searchResults).AsResponse();
|
||||
return MapToResource(searchResults).ToList().AsResponse();
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<AlbumResource> MapToResource(IEnumerable<NzbDrone.Core.Music.Album> albums)
|
||||
{
|
||||
foreach (var currentAlbum in albums)
|
||||
|
|
|
|||
|
|
@ -19,14 +19,12 @@ public ArtistLookupModule(ISearchForNewArtist searchProxy)
|
|||
Get["/"] = x => Search();
|
||||
}
|
||||
|
||||
|
||||
private Response Search()
|
||||
{
|
||||
var searchResults = _searchProxy.SearchForNewArtist((string)Request.Query.term);
|
||||
return MapToResource(searchResults).AsResponse();
|
||||
return MapToResource(searchResults).ToList().AsResponse();
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<ArtistResource> MapToResource(IEnumerable<NzbDrone.Core.Music.Artist> artist)
|
||||
{
|
||||
foreach (var currentArtist in artist)
|
||||
|
|
|
|||
Loading…
Reference in a new issue