move API DTOs to separate file

This commit is contained in:
aglowinthefield 2025-12-10 13:02:13 -05:00
parent 9792c298d9
commit f8dbad254f
No known key found for this signature in database
3 changed files with 55 additions and 50 deletions

View 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; }
}

View file

@ -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; }
}

View file

@ -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; }
}