Maps OpenLibrary MARC publish_country to ReleaseCountry

Adds publish_country to the Open Library edition response, translates MARC 21 country codes into the ReleaseCountry enumeration through a private table, and drops the city based publish_places mapping.

Closes #222
This commit is contained in:
BinaryAlley committed 2026-11-08 10:00:00 +02:00
1 parent 3350f19c1d
commit c6469e70cf
7 files changed
+365 -27

No files matched your search

@@ -48,10 +48,10 @@ internal sealed record OpenLibraryEditionResponse
public List<string> Publishers { get; init; } = [];
/// <summary>
/// Gets the publication places of the edition.
/// Gets the MARC 21 country code of the publication place of the edition.
/// </summary>
[JsonPropertyName("publish_places")]
public List<string> PublishPlaces { get; init; } = [];
[JsonPropertyName("publish_country")]
public string? PublishCountry { get; init; }
/// <summary>
/// Gets the number of pages of the edition.
@@ -70,12 +70,6 @@ internal sealed record OpenLibrarySearchDocumentResponse
[JsonPropertyName("subject")]
public List<string> Subjects { get; init; } = [];
/// <summary>
/// Gets the publication places of the search document.
/// </summary>
[JsonPropertyName("publish_place")]
public List<string> PublishPlaces { get; init; } = [];
/// <summary>
/// Gets the median number of pages of the search document.
/// </summary>