pull/3016/head
tidusjar 5 years ago
parent 3fb8b1ebe5
commit cb8272cfe9

@ -23,6 +23,6 @@ namespace Ombi.Api.Lidarr
Task<List<LanguageProfiles>> GetLanguageProfile(string apiKey, string baseUrl);
Task<LidarrStatus> Status(string apiKey, string baseUrl);
Task<CommandResult> AlbumSearch(int[] albumIds, string apiKey, string baseUrl);
Task<AlbumResponse> AlbumInformation(string albumId, string apiKey, string baseUrl);
Task<AlbumByForeignId> AlbumInformation(string albumId, string apiKey, string baseUrl);
}
}

@ -105,13 +105,13 @@ namespace Ombi.Api.Lidarr
return Api.Request<List<AlbumResponse>>(request);
}
public async Task<AlbumResponse> AlbumInformation(string albumId, string apiKey, string baseUrl)
public async Task<AlbumByForeignId> AlbumInformation(string albumId, string apiKey, string baseUrl)
{
var request = new Request($"{ApiVersion}/album", baseUrl, HttpMethod.Get);
request.AddQueryString("foreignAlbumId", albumId);
AddHeaders(request, apiKey);
var albums = await Api.Request<List<AlbumResponse>>(request);
return albums.Where(x => x.foreignAlbumId.Equals(albumId, StringComparison.InvariantCultureIgnoreCase))
var albums = await Api.Request<List<AlbumByForeignId>>(request);
return albums.
.FirstOrDefault();
}

@ -0,0 +1,31 @@
using System;
using System.Net.Mime;
namespace Ombi.Api.Lidarr.Models
{
public class AlbumByForeignId
{
public string title { get; set; }
public string disambiguation { get; set; }
public string overview { get; set; }
public int artistId { get; set; }
public string foreignAlbumId { get; set; }
public bool monitored { get; set; }
public bool anyReleaseOk { get; set; }
public int profileId { get; set; }
public int duration { get; set; }
public string albumType { get; set; }
public object[] secondaryTypes { get; set; }
public int mediumCount { get; set; }
public Ratings ratings { get; set; }
public DateTime releaseDate { get; set; }
public Release[] releases { get; set; }
public object[] genres { get; set; }
public Medium[] media { get; set; }
public Artist artist { get; set; }
public Image[] images { get; set; }
public Link[] links { get; set; }
public Statistics statistics { get; set; }
public int id { get; set; }
}
}
Loading…
Cancel
Save