diff --git a/API/Controllers/DTOs/Manga.cs b/API/Controllers/DTOs/Manga.cs index 587e1b2..76bd34e 100644 --- a/API/Controllers/DTOs/Manga.cs +++ b/API/Controllers/DTOs/Manga.cs @@ -7,7 +7,7 @@ namespace API.Controllers.DTOs; /// /// DTO /// -public record Manga(string Key, string Name, string Description, MangaReleaseStatus ReleaseStatus, IEnumerable MangaConnectorIds, float IgnoreChaptersBefore, uint? Year, string? OriginalLanguage, IEnumerable ChapterIds, IEnumerable Authors, IEnumerable Tags, IEnumerable Links, IEnumerable AltTitles) +public record Manga(string Key, string Name, string Description, MangaReleaseStatus ReleaseStatus, IEnumerable MangaConnectorIds, float IgnoreChaptersBefore, uint? Year, string? OriginalLanguage, IEnumerable ChapterIds, IEnumerable Authors, IEnumerable Tags, IEnumerable Links, IEnumerable AltTitles, string? FileLibraryId) : MinimalManga(Key, Name, Description, ReleaseStatus, MangaConnectorIds) { /// @@ -63,4 +63,11 @@ public record Manga(string Key, string Name, string Description, MangaReleaseSta [Required] [Description("Alt Titles of Manga")] public IEnumerable AltTitles { get; init; } = AltTitles; + + /// + /// Id of the Library the Manga gets downloaded to + /// + [Required] + [Description("Id of the Library the Manga gets downloaded to")] + public string? FileLibraryId { get; init; } = FileLibraryId; } \ No newline at end of file diff --git a/API/Controllers/MangaController.cs b/API/Controllers/MangaController.cs index aaea9a3..6cc8636 100644 --- a/API/Controllers/MangaController.cs +++ b/API/Controllers/MangaController.cs @@ -111,7 +111,7 @@ public class MangaController(MangaContext context) : Controller IEnumerable tags = m.MangaTags.Select(t => t.Tag); IEnumerable links = m.Links.Select(l => new Link(l.Key, l.LinkProvider, l.LinkUrl)); IEnumerable altTitles = m.AltTitles.Select(a => new AltTitle(a.Language, a.Title)); - return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles); + return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles, m.LibraryId); }).ToList()); } @@ -134,7 +134,7 @@ public class MangaController(MangaContext context) : Controller IEnumerable tags = manga.MangaTags.Select(t => t.Tag); IEnumerable links = manga.Links.Select(l => new Link(l.Key, l.LinkProvider, l.LinkUrl)); IEnumerable altTitles = manga.AltTitles.Select(a => new AltTitle(a.Language, a.Title)); - Manga result = new (manga.Key, manga.Name, manga.Description, manga.ReleaseStatus, ids, manga.IgnoreChaptersBefore, manga.Year, manga.OriginalLanguage, manga.ChapterIds, authors, tags, links, altTitles); + Manga result = new (manga.Key, manga.Name, manga.Description, manga.ReleaseStatus, ids, manga.IgnoreChaptersBefore, manga.Year, manga.OriginalLanguage, manga.ChapterIds, authors, tags, links, altTitles, manga.LibraryId); return TypedResults.Ok(result); } @@ -545,7 +545,7 @@ public class MangaController(MangaContext context) : Controller IEnumerable tags = m.MangaTags.Select(t => t.Tag); IEnumerable links = m.Links.Select(l => new Link(l.Key, l.LinkProvider, l.LinkUrl)); IEnumerable altTitles = m.AltTitles.Select(a => new AltTitle(a.Language, a.Title)); - return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles); + return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles, m.LibraryId); }).ToList()); } @@ -576,7 +576,7 @@ public class MangaController(MangaContext context) : Controller IEnumerable tags = m.MangaTags.Select(t => t.Tag); IEnumerable links = m.Links.Select(l => new Link(l.Key, l.LinkProvider, l.LinkUrl)); IEnumerable altTitles = m.AltTitles.Select(a => new AltTitle(a.Language, a.Title)); - return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles); + return new Manga(m.Key, m.Name, m.Description, m.ReleaseStatus, ids, m.IgnoreChaptersBefore, m.Year, m.OriginalLanguage, m.ChapterIds, authors, tags, links, altTitles, m.LibraryId); }).ToList()); } } \ No newline at end of file