mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -07:00
!wip
This commit is contained in:
parent
3fb8b1ebe5
commit
cb8272cfe9
3 changed files with 35 additions and 4 deletions
|
@ -23,6 +23,6 @@ namespace Ombi.Api.Lidarr
|
||||||
Task<List<LanguageProfiles>> GetLanguageProfile(string apiKey, string baseUrl);
|
Task<List<LanguageProfiles>> GetLanguageProfile(string apiKey, string baseUrl);
|
||||||
Task<LidarrStatus> Status(string apiKey, string baseUrl);
|
Task<LidarrStatus> Status(string apiKey, string baseUrl);
|
||||||
Task<CommandResult> AlbumSearch(int[] albumIds, 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);
|
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);
|
var request = new Request($"{ApiVersion}/album", baseUrl, HttpMethod.Get);
|
||||||
request.AddQueryString("foreignAlbumId", albumId);
|
request.AddQueryString("foreignAlbumId", albumId);
|
||||||
AddHeaders(request, apiKey);
|
AddHeaders(request, apiKey);
|
||||||
var albums = await Api.Request<List<AlbumResponse>>(request);
|
var albums = await Api.Request<List<AlbumByForeignId>>(request);
|
||||||
return albums.Where(x => x.foreignAlbumId.Equals(albumId, StringComparison.InvariantCultureIgnoreCase))
|
return albums.
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs
Normal file
31
src/Ombi.Api.Lidarr/Models/AlbumByForeignId.cs
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue