Gestion de bibliothèque personnelle auto-hébergée : catalogue, prêts, scan de code-barres, consultation hors-ligne. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
72 lines
2.3 KiB
C#
72 lines
2.3 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace MaBibli.Api.Services.Isbn;
|
|
|
|
/// <summary>Réponse de <c>https://openlibrary.org/books/OL…M.json</c> (édition).</summary>
|
|
public record OpenLibraryEdition
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string? Key { get; init; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
[JsonPropertyName("subtitle")]
|
|
public string? Subtitle { get; init; }
|
|
|
|
/// <summary>
|
|
/// Références d'auteurs, <b>pas</b> des noms : <c>{ "key": "/authors/OL31901A" }</c>.
|
|
/// Il faut un second appel pour obtenir le nom — c'est le bug de BookLogr à ne pas reproduire.
|
|
/// Ce champ est parfois totalement absent (cas mesuré : Introduction to Algorithms).
|
|
/// </summary>
|
|
[JsonPropertyName("authors")]
|
|
public List<OpenLibraryCle>? Authors { get; init; }
|
|
|
|
/// <summary>Œuvre rattachée, utilisée en repli quand l'édition ne porte aucun auteur.</summary>
|
|
[JsonPropertyName("works")]
|
|
public List<OpenLibraryCle>? Works { get; init; }
|
|
|
|
[JsonPropertyName("publishers")]
|
|
public List<string>? Publishers { get; init; }
|
|
|
|
[JsonPropertyName("publish_date")]
|
|
public string? PublishDate { get; init; }
|
|
|
|
[JsonPropertyName("languages")]
|
|
public List<OpenLibraryCle>? Languages { get; init; }
|
|
|
|
/// <summary>Mention de responsabilité brute, dernier repli si aucun auteur n'est résolvable.</summary>
|
|
[JsonPropertyName("by_statement")]
|
|
public string? ByStatement { get; init; }
|
|
}
|
|
|
|
/// <summary>Réponse de <c>https://openlibrary.org/works/OL…W.json</c>.</summary>
|
|
public record OpenLibraryWork
|
|
{
|
|
[JsonPropertyName("authors")]
|
|
public List<OpenLibraryWorkAuthor>? Authors { get; init; }
|
|
}
|
|
|
|
public record OpenLibraryWorkAuthor
|
|
{
|
|
[JsonPropertyName("author")]
|
|
public OpenLibraryCle? Author { get; init; }
|
|
}
|
|
|
|
/// <summary>Réponse de <c>https://openlibrary.org/authors/OL…A.json</c>.</summary>
|
|
public record OpenLibraryAuthor
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
[JsonPropertyName("personal_name")]
|
|
public string? PersonalName { get; init; }
|
|
}
|
|
|
|
/// <summary>Référence OpenLibrary : <c>{ "key": "/authors/OL31901A" }</c>.</summary>
|
|
public record OpenLibraryCle
|
|
{
|
|
[JsonPropertyName("key")]
|
|
public string? Key { get; init; }
|
|
}
|