It works now when we request an album when we do not have the artist in Lidarr. Waiting on https://github.com/lidarr/Lidarr/issues/459 to do when we have the artist

This commit is contained in:
Jamie 2018-08-26 23:42:53 +01:00
parent 0b7a7a6bbb
commit e02c8e4014
5 changed files with 27 additions and 9 deletions

View file

@ -113,7 +113,7 @@ namespace Ombi.Api.Lidarr
return Api.Request<ArtistResult>(request);
}
public Task<AlbumResponse> MontiorAlbum(int albumId, string apiKey, string baseUrl)
public async Task<AlbumResponse> MontiorAlbum(int albumId, string apiKey, string baseUrl)
{
var request = new Request($"{ApiVersion}/album/monitor", baseUrl, HttpMethod.Put);
request.AddJsonBody(new
@ -122,7 +122,7 @@ namespace Ombi.Api.Lidarr
monitored = true
});
AddHeaders(request, apiKey);
return Api.Request<AlbumResponse>(request);
return (await Api.Request<List<AlbumResponse>>(request)).FirstOrDefault();
}
public Task<List<AlbumResponse>> GetAllAlbumsByArtistId(int artistId, string apiKey, string baseUrl)