mirror of
https://github.com/Lidarr/Lidarr
synced 2026-01-24 08:22:41 +01:00
move API DTOs to separate file
This commit is contained in:
parent
9792c298d9
commit
f8dbad254f
3 changed files with 55 additions and 50 deletions
52
src/NzbDrone.Core/ImportLists/Discogs/DiscogsApi.cs
Normal file
52
src/NzbDrone.Core/ImportLists/Discogs/DiscogsApi.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.Discogs;
|
||||
|
||||
public class DiscogsListResponse
|
||||
{
|
||||
public List<DiscogsListItem> Items { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsListItem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public int Id { get; set; }
|
||||
[JsonProperty("display_title")]
|
||||
public string DisplayTitle { get; set; }
|
||||
[JsonProperty("resource_url")]
|
||||
public string ResourceUrl { get; set; }
|
||||
public string Uri { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsReleaseResponse
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public List<DiscogsReleaseArtist> Artists { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsReleaseArtist
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsWantlistResponse
|
||||
{
|
||||
public List<DiscogsWantlistItem> Wants { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsWantlistItem
|
||||
{
|
||||
[JsonProperty("basic_information")]
|
||||
public DiscogsBasicInformation BasicInformation { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsBasicInformation
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("resource_url")]
|
||||
public string ResourceUrl { get; set; }
|
||||
public List<DiscogsReleaseArtist> Artists { get; set; }
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
|
|
@ -77,31 +76,3 @@ private ImportListItemInfo TryFetchRelease(string resourceUrl)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DiscogsListResponse
|
||||
{
|
||||
public List<DiscogsListItem> Items { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsListItem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public int Id { get; set; }
|
||||
[JsonProperty("display_title")]
|
||||
public string DisplayTitle { get; set; }
|
||||
[JsonProperty("resource_url")]
|
||||
public string ResourceUrl { get; set; }
|
||||
public string Uri { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsReleaseResponse
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public List<DiscogsReleaseArtist> Artists { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsReleaseArtist
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
|
|
@ -10,6 +9,9 @@ namespace NzbDrone.Core.ImportLists.Discogs;
|
|||
|
||||
public class DiscogsWantlistParser : IParseImportListResponse
|
||||
{
|
||||
private IHttpClient _httpClient;
|
||||
private DiscogsWantlistSettings _settings;
|
||||
|
||||
public DiscogsWantlistParser()
|
||||
{
|
||||
}
|
||||
|
|
@ -60,23 +62,3 @@ public IList<ImportListItemInfo> ParseResponse(ImportListResponse importListResp
|
|||
return items;
|
||||
}
|
||||
}
|
||||
|
||||
public class DiscogsWantlistResponse
|
||||
{
|
||||
public List<DiscogsWantlistItem> Wants { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsWantlistItem
|
||||
{
|
||||
[JsonProperty("basic_information")]
|
||||
public DiscogsBasicInformation BasicInformation { get; set; }
|
||||
}
|
||||
|
||||
public class DiscogsBasicInformation
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
[JsonProperty("resource_url")]
|
||||
public string ResourceUrl { get; set; }
|
||||
public List<DiscogsReleaseArtist> Artists { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue