diff --git a/src/NzbDrone.Core/ImportLists/Discogs/DiscogsApi.cs b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsApi.cs new file mode 100644 index 000000000..f9a1b6c65 --- /dev/null +++ b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsApi.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace NzbDrone.Core.ImportLists.Discogs; + +public class DiscogsListResponse +{ + public List 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 Artists { get; set; } +} + +public class DiscogsReleaseArtist +{ + public string Name { get; set; } + public int Id { get; set; } +} + +public class DiscogsWantlistResponse +{ + public List 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 Artists { get; set; } +} diff --git a/src/NzbDrone.Core/ImportLists/Discogs/DiscogsListsParser.cs b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsListsParser.cs index 479fe8008..0e6a960f1 100644 --- a/src/NzbDrone.Core/ImportLists/Discogs/DiscogsListsParser.cs +++ b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsListsParser.cs @@ -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 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 Artists { get; set; } -} - -public class DiscogsReleaseArtist -{ - public string Name { get; set; } - public int Id { get; set; } -} diff --git a/src/NzbDrone.Core/ImportLists/Discogs/DiscogsWantlistParser.cs b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsWantlistParser.cs index 85ccb939f..415e64c2b 100644 --- a/src/NzbDrone.Core/ImportLists/Discogs/DiscogsWantlistParser.cs +++ b/src/NzbDrone.Core/ImportLists/Discogs/DiscogsWantlistParser.cs @@ -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 ParseResponse(ImportListResponse importListResp return items; } } - -public class DiscogsWantlistResponse -{ - public List 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 Artists { get; set; } -}