Fix MetadataEntry endpoints, payload
Some checks failed
Docker Image CI / build (push) Has been cancelled

This commit is contained in:
2025-10-14 14:08:44 +02:00
parent 352c4a4401
commit acd885f1ab
7 changed files with 580 additions and 21 deletions

View File

@@ -18,7 +18,6 @@ public class Manga : Identifiable
public MangaReleaseStatus ReleaseStatus { get; internal set; }
[StringLength(64)] public string? LibraryId { get; private set; }
public FileLibrary? Library = null!;
public ICollection<Author> Authors { get; internal set; } = null!;
public ICollection<MangaTag> MangaTags { get; internal set; } = null!;
public ICollection<Link> Links { get; internal set; } = null!;
@@ -31,13 +30,20 @@ public class Manga : Identifiable
/// <exception cref="DirectoryNotFoundException">Library not loaded</exception>
[NotMapped] public string FullDirectoryPath => EnsureDirectoryExists();
[NotMapped]
[JsonIgnore]
public string FullDirectoryPath => EnsureDirectoryExists();
[NotMapped] public ICollection<string> ChapterIds => Chapters.Select(c => c.Key).ToList();
[NotMapped]
public ICollection<string> ChapterIds => Chapters.Select(c => c.Key).ToList();
[JsonIgnore]
public ICollection<Chapter> Chapters = null!;
[NotMapped] public Dictionary<string, string> IdsOnMangaConnectors => MangaConnectorIds.ToDictionary(id => id.MangaConnectorName, id => id.IdOnConnectorSite);
[NotMapped] public ICollection<string> MangaConnectorIdsIds => MangaConnectorIds.Select(id => id.Key).ToList();
[NotMapped]
public Dictionary<string, string> IdsOnMangaConnectors => MangaConnectorIds.ToDictionary(id => id.MangaConnectorName, id => id.IdOnConnectorSite);
[NotMapped]
public ICollection<string> MangaConnectorIdsIds => MangaConnectorIds.Select(id => id.Key).ToList();
[JsonIgnore]
public ICollection<MangaConnectorId<Manga>> MangaConnectorIds = null!;
public Manga(string name, string description, string coverUrl, MangaReleaseStatus releaseStatus,

View File

@@ -99,10 +99,6 @@ public class MangaContext(DbContextOptions<MangaContext> options) : TrangaBaseCo
.HasOne<Manga>(entry => entry.Manga)
.WithMany()
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<MetadataEntry>()
.HasOne<MetadataFetcher>(entry => entry.MetadataFetcher)
.WithMany()
.OnDelete(DeleteBehavior.Cascade);
}
public async Task<Manga?> FindMangaLike(Manga other, CancellationToken token)

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
@@ -10,6 +11,7 @@ public class MetadataEntry
public Manga Manga { get; init; } = null!;
public string MangaId { get; init; }
[JsonIgnore]
[NotMapped]
public MetadataFetcher MetadataFetcher { get; init; } = null!;
public string MetadataFetcherName { get; init; }
public string Identifier { get; init; }