mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-02-28 18:55:20 +00:00
Fixed: Artist/Album lookup endpoints display error on failure
This commit is contained in:
@@ -20,14 +20,12 @@ namespace Lidarr.Api.V1.Albums
|
||||
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 @@ namespace Lidarr.Api.V1.Artist
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user