Logging Enhancements (#1521)

* Recreated Kavita Logging with Serilog instead of Default. This needs to be move out of the appsettings now, to allow auto updater to patch.

* Refactored the code to be completely configured via Code rather than appsettings.json. This is a required step for Auto Updating.

* Added in the ability to send logs directly to the UI only for users on the log route. Stopping implementation as Alerts page will handle the rest of the implementation.

* Fixed up the backup service to not rely on Config from appsettings.json

* Tweaked the Logging levels available

* Moved everything over to File-scoped namespaces

* Moved everything over to File-scoped namespaces

* Code cleanup, removed an old migration and changed so debug logging doesn't print sensitive db data

* Removed dead code
This commit is contained in:
Joseph Milazzo 2022-09-12 19:25:48 -05:00 committed by GitHub
parent 9f715cc35f
commit d1a14f7e68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
212 changed files with 16599 additions and 16834 deletions

View file

@ -1,8 +1,7 @@
namespace API.DTOs.Account
namespace API.DTOs.Account;
public class LoginDto
{
public class LoginDto
{
public string Username { get; init; }
public string Password { get; set; }
}
public string Username { get; init; }
public string Password { get; set; }
}

View file

@ -1,23 +1,22 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account
namespace API.DTOs.Account;
public class ResetPasswordDto
{
public class ResetPasswordDto
{
/// <summary>
/// The Username of the User
/// </summary>
[Required]
public string UserName { get; init; }
/// <summary>
/// The new password
/// </summary>
[Required]
[StringLength(32, MinimumLength = 6)]
public string Password { get; init; }
/// <summary>
/// The old, existing password. If an admin is performing the change, this is not required. Otherwise, it is.
/// </summary>
public string OldPassword { get; init; }
}
/// <summary>
/// The Username of the User
/// </summary>
[Required]
public string UserName { get; init; }
/// <summary>
/// The new password
/// </summary>
[Required]
[StringLength(32, MinimumLength = 6)]
public string Password { get; init; }
/// <summary>
/// The old, existing password. If an admin is performing the change, this is not required. Otherwise, it is.
/// </summary>
public string OldPassword { get; init; }
}

View file

@ -5,89 +5,88 @@ using API.DTOs.Reader;
using API.Entities.Enums;
using API.Entities.Interfaces;
namespace API.DTOs
{
/// <summary>
/// A Chapter is the lowest grouping of a reading medium. A Chapter contains a set of MangaFiles which represents the underlying
/// file (abstracted from type).
/// </summary>
public class ChapterDto : IHasReadTimeEstimate
{
public int Id { get; init; }
/// <summary>
/// Range of chapters. Chapter 2-4 -> "2-4". Chapter 2 -> "2".
/// </summary>
public string Range { get; init; }
/// <summary>
/// Smallest number of the Range.
/// </summary>
public string Number { get; init; }
/// <summary>
/// Total number of pages in all MangaFiles
/// </summary>
public int Pages { get; init; }
/// <summary>
/// If this Chapter contains files that could only be identified as Series or has Special Identifier from filename
/// </summary>
public bool IsSpecial { get; init; }
/// <summary>
/// Used for books/specials to display custom title. For non-specials/books, will be set to <see cref="Range"/>
/// </summary>
public string Title { get; set; }
/// <summary>
/// The files that represent this Chapter
/// </summary>
public ICollection<MangaFileDto> Files { get; init; }
/// <summary>
/// Calculated at API time. Number of pages read for this Chapter for logged in user.
/// </summary>
public int PagesRead { get; set; }
/// <summary>
/// If the Cover Image is locked for this entity
/// </summary>
public bool CoverImageLocked { get; set; }
/// <summary>
/// Volume Id this Chapter belongs to
/// </summary>
public int VolumeId { get; init; }
/// <summary>
/// When chapter was created
/// </summary>
public DateTime Created { get; init; }
/// <summary>
/// When the chapter was released.
/// </summary>
/// <remarks>Metadata field</remarks>
public DateTime ReleaseDate { get; init; }
/// <summary>
/// Title of the Chapter/Issue
/// </summary>
/// <remarks>Metadata field</remarks>
public string TitleName { get; set; }
/// <summary>
/// Summary of the Chapter
/// </summary>
/// <remarks>This is not set normally, only for Series Detail</remarks>
public string Summary { get; init; }
/// <summary>
/// Age Rating for the issue/chapter
/// </summary>
public AgeRating AgeRating { get; init; }
/// <summary>
/// Total words in a Chapter (books only)
/// </summary>
public long WordCount { get; set; } = 0L;
namespace API.DTOs;
/// <summary>
/// Formatted Volume title ie) Volume 2.
/// </summary>
/// <remarks>Only available when fetched from Series Detail API</remarks>
public string VolumeTitle { get; set; } = string.Empty;
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
}
/// <summary>
/// A Chapter is the lowest grouping of a reading medium. A Chapter contains a set of MangaFiles which represents the underlying
/// file (abstracted from type).
/// </summary>
public class ChapterDto : IHasReadTimeEstimate
{
public int Id { get; init; }
/// <summary>
/// Range of chapters. Chapter 2-4 -> "2-4". Chapter 2 -> "2".
/// </summary>
public string Range { get; init; }
/// <summary>
/// Smallest number of the Range.
/// </summary>
public string Number { get; init; }
/// <summary>
/// Total number of pages in all MangaFiles
/// </summary>
public int Pages { get; init; }
/// <summary>
/// If this Chapter contains files that could only be identified as Series or has Special Identifier from filename
/// </summary>
public bool IsSpecial { get; init; }
/// <summary>
/// Used for books/specials to display custom title. For non-specials/books, will be set to <see cref="Range"/>
/// </summary>
public string Title { get; set; }
/// <summary>
/// The files that represent this Chapter
/// </summary>
public ICollection<MangaFileDto> Files { get; init; }
/// <summary>
/// Calculated at API time. Number of pages read for this Chapter for logged in user.
/// </summary>
public int PagesRead { get; set; }
/// <summary>
/// If the Cover Image is locked for this entity
/// </summary>
public bool CoverImageLocked { get; set; }
/// <summary>
/// Volume Id this Chapter belongs to
/// </summary>
public int VolumeId { get; init; }
/// <summary>
/// When chapter was created
/// </summary>
public DateTime Created { get; init; }
/// <summary>
/// When the chapter was released.
/// </summary>
/// <remarks>Metadata field</remarks>
public DateTime ReleaseDate { get; init; }
/// <summary>
/// Title of the Chapter/Issue
/// </summary>
/// <remarks>Metadata field</remarks>
public string TitleName { get; set; }
/// <summary>
/// Summary of the Chapter
/// </summary>
/// <remarks>This is not set normally, only for Series Detail</remarks>
public string Summary { get; init; }
/// <summary>
/// Age Rating for the issue/chapter
/// </summary>
public AgeRating AgeRating { get; init; }
/// <summary>
/// Total words in a Chapter (books only)
/// </summary>
public long WordCount { get; set; } = 0L;
/// <summary>
/// Formatted Volume title ie) Volume 2.
/// </summary>
/// <remarks>Only available when fetched from Series Detail API</remarks>
public string VolumeTitle { get; set; } = string.Empty;
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
}

View file

@ -1,18 +1,17 @@
using System.Collections.Generic;
namespace API.DTOs.CollectionTags
namespace API.DTOs.CollectionTags;
public class CollectionTagBulkAddDto
{
public class CollectionTagBulkAddDto
{
/// <summary>
/// Collection Tag Id
/// </summary>
/// <remarks>Can be 0 which then will use Title to create a tag</remarks>
public int CollectionTagId { get; init; }
public string CollectionTagTitle { get; init; }
/// <summary>
/// Series Ids to add onto Collection Tag
/// </summary>
public IEnumerable<int> SeriesIds { get; init; }
}
/// <summary>
/// Collection Tag Id
/// </summary>
/// <remarks>Can be 0 which then will use Title to create a tag</remarks>
public int CollectionTagId { get; init; }
public string CollectionTagTitle { get; init; }
/// <summary>
/// Series Ids to add onto Collection Tag
/// </summary>
public IEnumerable<int> SeriesIds { get; init; }
}

View file

@ -1,15 +1,14 @@
namespace API.DTOs.CollectionTags
namespace API.DTOs.CollectionTags;
public class CollectionTagDto
{
public class CollectionTagDto
{
public int Id { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
/// <summary>
/// The cover image string. This is used on Frontend to show or hide the Cover Image
/// </summary>
public string CoverImage { get; set; }
public bool CoverImageLocked { get; set; }
}
public int Id { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
/// <summary>
/// The cover image string. This is used on Frontend to show or hide the Cover Image
/// </summary>
public string CoverImage { get; set; }
public bool CoverImageLocked { get; set; }
}

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
namespace API.DTOs.CollectionTags
namespace API.DTOs.CollectionTags;
public class UpdateSeriesForTagDto
{
public class UpdateSeriesForTagDto
{
public CollectionTagDto Tag { get; init; }
public IEnumerable<int> SeriesIdsToRemove { get; init; }
}
public CollectionTagDto Tag { get; init; }
public IEnumerable<int> SeriesIdsToRemove { get; init; }
}

View file

@ -2,16 +2,15 @@
using System.ComponentModel.DataAnnotations;
using API.Entities.Enums;
namespace API.DTOs
namespace API.DTOs;
public class CreateLibraryDto
{
public class CreateLibraryDto
{
[Required]
public string Name { get; init; }
[Required]
public LibraryType Type { get; init; }
[Required]
[MinLength(1)]
public IEnumerable<string> Folders { get; init; }
}
}
[Required]
public string Name { get; init; }
[Required]
public LibraryType Type { get; init; }
[Required]
[MinLength(1)]
public IEnumerable<string> Folders { get; init; }
}

View file

@ -1,9 +1,8 @@
using System.Collections.Generic;
namespace API.DTOs
namespace API.DTOs;
public class DeleteSeriesDto
{
public class DeleteSeriesDto
{
public IList<int> SeriesIds { get; set; }
}
public IList<int> SeriesIds { get; set; }
}

View file

@ -2,11 +2,10 @@
using System.ComponentModel.DataAnnotations;
using API.DTOs.Reader;
namespace API.DTOs.Downloads
namespace API.DTOs.Downloads;
public class DownloadBookmarkDto
{
public class DownloadBookmarkDto
{
[Required]
public IEnumerable<BookmarkDto> Bookmarks { get; set; }
}
[Required]
public IEnumerable<BookmarkDto> Bookmarks { get; set; }
}

View file

@ -3,101 +3,100 @@ using System.Runtime.InteropServices;
using API.Entities;
using API.Entities.Enums;
namespace API.DTOs.Filtering
namespace API.DTOs.Filtering;
public class FilterDto
{
public class FilterDto
{
/// <summary>
/// The type of Formats you want to be returned. An empty list will return all formats back
/// </summary>
public IList<MangaFormat> Formats { get; init; } = new List<MangaFormat>();
/// <summary>
/// The type of Formats you want to be returned. An empty list will return all formats back
/// </summary>
public IList<MangaFormat> Formats { get; init; } = new List<MangaFormat>();
/// <summary>
/// The progress you want to be returned. This can be bitwise manipulated. Defaults to all applicable states.
/// </summary>
public ReadStatus ReadStatus { get; init; } = new ReadStatus();
/// <summary>
/// The progress you want to be returned. This can be bitwise manipulated. Defaults to all applicable states.
/// </summary>
public ReadStatus ReadStatus { get; init; } = new ReadStatus();
/// <summary>
/// A list of library ids to restrict search to. Defaults to all libraries by passing empty list
/// </summary>
public IList<int> Libraries { get; init; } = new List<int>();
/// <summary>
/// A list of Genre ids to restrict search to. Defaults to all genres by passing an empty list
/// </summary>
public IList<int> Genres { get; init; } = new List<int>();
/// <summary>
/// A list of Writers to restrict search to. Defaults to all Writers by passing an empty list
/// </summary>
public IList<int> Writers { get; init; } = new List<int>();
/// <summary>
/// A list of Penciller ids to restrict search to. Defaults to all Pencillers by passing an empty list
/// </summary>
public IList<int> Penciller { get; init; } = new List<int>();
/// <summary>
/// A list of Inker ids to restrict search to. Defaults to all Inkers by passing an empty list
/// </summary>
public IList<int> Inker { get; init; } = new List<int>();
/// <summary>
/// A list of Colorist ids to restrict search to. Defaults to all Colorists by passing an empty list
/// </summary>
public IList<int> Colorist { get; init; } = new List<int>();
/// <summary>
/// A list of Letterer ids to restrict search to. Defaults to all Letterers by passing an empty list
/// </summary>
public IList<int> Letterer { get; init; } = new List<int>();
/// <summary>
/// A list of CoverArtist ids to restrict search to. Defaults to all CoverArtists by passing an empty list
/// </summary>
public IList<int> CoverArtist { get; init; } = new List<int>();
/// <summary>
/// A list of Editor ids to restrict search to. Defaults to all Editors by passing an empty list
/// </summary>
public IList<int> Editor { get; init; } = new List<int>();
/// <summary>
/// A list of Publisher ids to restrict search to. Defaults to all Publishers by passing an empty list
/// </summary>
public IList<int> Publisher { get; init; } = new List<int>();
/// <summary>
/// A list of Character ids to restrict search to. Defaults to all Characters by passing an empty list
/// </summary>
public IList<int> Character { get; init; } = new List<int>();
/// <summary>
/// A list of Translator ids to restrict search to. Defaults to all Translatorss by passing an empty list
/// </summary>
public IList<int> Translators { get; init; } = new List<int>();
/// <summary>
/// A list of Collection Tag ids to restrict search to. Defaults to all Collection Tags by passing an empty list
/// </summary>
public IList<int> CollectionTags { get; init; } = new List<int>();
/// <summary>
/// A list of Tag ids to restrict search to. Defaults to all Tags by passing an empty list
/// </summary>
public IList<int> Tags { get; init; } = new List<int>();
/// <summary>
/// Will return back everything with the rating and above
/// <see cref="AppUserRating.Rating"/>
/// </summary>
public int Rating { get; init; }
/// <summary>
/// Sorting Options for a query. Defaults to null, which uses the queries natural sorting order
/// </summary>
public SortOptions SortOptions { get; set; } = null;
/// <summary>
/// Age Ratings. Empty list will return everything back
/// </summary>
public IList<AgeRating> AgeRating { get; init; } = new List<AgeRating>();
/// <summary>
/// Languages (ISO 639-1 code) to filter by. Empty list will return everything back
/// </summary>
public IList<string> Languages { get; init; } = new List<string>();
/// <summary>
/// Publication statuses to filter by. Empty list will return everything back
/// </summary>
public IList<PublicationStatus> PublicationStatus { get; init; } = new List<PublicationStatus>();
/// <summary>
/// A list of library ids to restrict search to. Defaults to all libraries by passing empty list
/// </summary>
public IList<int> Libraries { get; init; } = new List<int>();
/// <summary>
/// A list of Genre ids to restrict search to. Defaults to all genres by passing an empty list
/// </summary>
public IList<int> Genres { get; init; } = new List<int>();
/// <summary>
/// A list of Writers to restrict search to. Defaults to all Writers by passing an empty list
/// </summary>
public IList<int> Writers { get; init; } = new List<int>();
/// <summary>
/// A list of Penciller ids to restrict search to. Defaults to all Pencillers by passing an empty list
/// </summary>
public IList<int> Penciller { get; init; } = new List<int>();
/// <summary>
/// A list of Inker ids to restrict search to. Defaults to all Inkers by passing an empty list
/// </summary>
public IList<int> Inker { get; init; } = new List<int>();
/// <summary>
/// A list of Colorist ids to restrict search to. Defaults to all Colorists by passing an empty list
/// </summary>
public IList<int> Colorist { get; init; } = new List<int>();
/// <summary>
/// A list of Letterer ids to restrict search to. Defaults to all Letterers by passing an empty list
/// </summary>
public IList<int> Letterer { get; init; } = new List<int>();
/// <summary>
/// A list of CoverArtist ids to restrict search to. Defaults to all CoverArtists by passing an empty list
/// </summary>
public IList<int> CoverArtist { get; init; } = new List<int>();
/// <summary>
/// A list of Editor ids to restrict search to. Defaults to all Editors by passing an empty list
/// </summary>
public IList<int> Editor { get; init; } = new List<int>();
/// <summary>
/// A list of Publisher ids to restrict search to. Defaults to all Publishers by passing an empty list
/// </summary>
public IList<int> Publisher { get; init; } = new List<int>();
/// <summary>
/// A list of Character ids to restrict search to. Defaults to all Characters by passing an empty list
/// </summary>
public IList<int> Character { get; init; } = new List<int>();
/// <summary>
/// A list of Translator ids to restrict search to. Defaults to all Translatorss by passing an empty list
/// </summary>
public IList<int> Translators { get; init; } = new List<int>();
/// <summary>
/// A list of Collection Tag ids to restrict search to. Defaults to all Collection Tags by passing an empty list
/// </summary>
public IList<int> CollectionTags { get; init; } = new List<int>();
/// <summary>
/// A list of Tag ids to restrict search to. Defaults to all Tags by passing an empty list
/// </summary>
public IList<int> Tags { get; init; } = new List<int>();
/// <summary>
/// Will return back everything with the rating and above
/// <see cref="AppUserRating.Rating"/>
/// </summary>
public int Rating { get; init; }
/// <summary>
/// Sorting Options for a query. Defaults to null, which uses the queries natural sorting order
/// </summary>
public SortOptions SortOptions { get; set; } = null;
/// <summary>
/// Age Ratings. Empty list will return everything back
/// </summary>
public IList<AgeRating> AgeRating { get; init; } = new List<AgeRating>();
/// <summary>
/// Languages (ISO 639-1 code) to filter by. Empty list will return everything back
/// </summary>
public IList<string> Languages { get; init; } = new List<string>();
/// <summary>
/// Publication statuses to filter by. Empty list will return everything back
/// </summary>
public IList<PublicationStatus> PublicationStatus { get; init; } = new List<PublicationStatus>();
/// <summary>
/// An optional name string to filter by. Empty string will ignore.
/// </summary>
public string SeriesNameQuery { get; init; } = string.Empty;
}
/// <summary>
/// An optional name string to filter by. Empty string will ignore.
/// </summary>
public string SeriesNameQuery { get; init; } = string.Empty;
}

View file

@ -2,17 +2,16 @@
using System.Collections.Generic;
using API.Entities.Enums;
namespace API.DTOs
namespace API.DTOs;
public class LibraryDto
{
public class LibraryDto
{
public int Id { get; init; }
public string Name { get; init; }
/// <summary>
/// Last time Library was scanned
/// </summary>
public DateTime LastScanned { get; init; }
public LibraryType Type { get; init; }
public ICollection<string> Folders { get; init; }
}
public int Id { get; init; }
public string Name { get; init; }
/// <summary>
/// Last time Library was scanned
/// </summary>
public DateTime LastScanned { get; init; }
public LibraryType Type { get; init; }
public ICollection<string> Folders { get; init; }
}

View file

@ -1,15 +1,14 @@
using System;
using API.Entities.Enums;
namespace API.DTOs
{
public class MangaFileDto
{
public int Id { get; init; }
public string FilePath { get; init; }
public int Pages { get; init; }
public MangaFormat Format { get; init; }
public DateTime Created { get; init; }
namespace API.DTOs;
public class MangaFileDto
{
public int Id { get; init; }
public string FilePath { get; init; }
public int Pages { get; init; }
public MangaFormat Format { get; init; }
public DateTime Created { get; init; }
}
}

View file

@ -1,19 +1,18 @@
using System;
using System.Collections.Generic;
namespace API.DTOs
namespace API.DTOs;
/// <summary>
/// Represents a member of a Kavita server.
/// </summary>
public class MemberDto
{
/// <summary>
/// Represents a member of a Kavita server.
/// </summary>
public class MemberDto
{
public int Id { get; init; }
public string Username { get; init; }
public string Email { get; init; }
public DateTime Created { get; init; }
public DateTime LastActive { get; init; }
public IEnumerable<LibraryDto> Libraries { get; init; }
public IEnumerable<string> Roles { get; init; }
}
public int Id { get; init; }
public string Username { get; init; }
public string Email { get; init; }
public DateTime Created { get; init; }
public DateTime LastActive { get; init; }
public IEnumerable<LibraryDto> Libraries { get; init; }
public IEnumerable<string> Roles { get; init; }
}

View file

@ -1,56 +1,55 @@
using System.Collections.Generic;
using API.Entities.Enums;
namespace API.DTOs.Metadata
namespace API.DTOs.Metadata;
/// <summary>
/// Exclusively metadata about a given chapter
/// </summary>
public class ChapterMetadataDto
{
public int Id { get; set; }
public int ChapterId { get; set; }
public string Title { get; set; }
public ICollection<PersonDto> Writers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> CoverArtists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Publishers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Characters { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Pencillers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Inkers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Colorists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Letterers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Editors { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Translators { get; set; } = new List<PersonDto>();
public ICollection<GenreTagDto> Genres { get; set; } = new List<GenreTagDto>();
/// <summary>
/// Exclusively metadata about a given chapter
/// Collection of all Tags from underlying chapters for a Series
/// </summary>
public class ChapterMetadataDto
{
public int Id { get; set; }
public int ChapterId { get; set; }
public string Title { get; set; }
public ICollection<PersonDto> Writers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> CoverArtists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Publishers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Characters { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Pencillers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Inkers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Colorists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Letterers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Editors { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Translators { get; set; } = new List<PersonDto>();
public ICollection<TagDto> Tags { get; set; } = new List<TagDto>();
public AgeRating AgeRating { get; set; }
public string ReleaseDate { get; set; }
public PublicationStatus PublicationStatus { get; set; }
/// <summary>
/// Summary for the Chapter/Issue
/// </summary>
public string Summary { get; set; }
/// <summary>
/// Language for the Chapter/Issue
/// </summary>
public string Language { get; set; }
/// <summary>
/// Number in the TotalCount of issues
/// </summary>
public int Count { get; set; }
/// <summary>
/// Total number of issues for the series
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Number of Words for this chapter. Only applies to Epub
/// </summary>
public long WordCount { get; set; }
public ICollection<GenreTagDto> Genres { get; set; } = new List<GenreTagDto>();
/// <summary>
/// Collection of all Tags from underlying chapters for a Series
/// </summary>
public ICollection<TagDto> Tags { get; set; } = new List<TagDto>();
public AgeRating AgeRating { get; set; }
public string ReleaseDate { get; set; }
public PublicationStatus PublicationStatus { get; set; }
/// <summary>
/// Summary for the Chapter/Issue
/// </summary>
public string Summary { get; set; }
/// <summary>
/// Language for the Chapter/Issue
/// </summary>
public string Language { get; set; }
/// <summary>
/// Number in the TotalCount of issues
/// </summary>
public int Count { get; set; }
/// <summary>
/// Total number of issues for the series
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Number of Words for this chapter. Only applies to Epub
/// </summary>
public long WordCount { get; set; }
}
}

View file

@ -1,8 +1,7 @@
namespace API.DTOs.Metadata
namespace API.DTOs.Metadata;
public class GenreTagDto
{
public class GenreTagDto
{
public int Id { get; set; }
public string Title { get; set; }
}
public int Id { get; set; }
public string Title { get; set; }
}

View file

@ -2,61 +2,60 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
/// <summary>
///
/// </summary>
[XmlRoot("feed", Namespace = "http://www.w3.org/2005/Atom")]
public class Feed
{
/// <summary>
///
/// </summary>
[XmlRoot("feed", Namespace = "http://www.w3.org/2005/Atom")]
public class Feed
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
[XmlElement("id")]
public string Id { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("icon")]
public string Icon { get; set; } = "/favicon.ico";
[XmlElement("author")]
public FeedAuthor Author { get; set; } = new FeedAuthor()
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
Name = "Kavita",
Uri = "https://kavitareader.com"
};
[XmlElement("id")]
public string Id { get; set; }
[XmlElement("totalResults", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? Total { get; set; } = null;
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("itemsPerPage", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? ItemsPerPage { get; set; } = null;
[XmlElement("icon")]
public string Icon { get; set; } = "/favicon.ico";
[XmlElement("startIndex", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? StartIndex { get; set; } = null;
[XmlElement("author")]
public FeedAuthor Author { get; set; } = new FeedAuthor()
{
Name = "Kavita",
Uri = "https://kavitareader.com"
};
[XmlElement("link")]
public List<FeedLink> Links { get; set; } = new List<FeedLink>() ;
[XmlElement("totalResults", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? Total { get; set; } = null;
[XmlElement("entry")]
public List<FeedEntry> Entries { get; set; } = new List<FeedEntry>();
[XmlElement("itemsPerPage", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? ItemsPerPage { get; set; } = null;
public bool ShouldSerializeTotal()
{
return Total.HasValue;
}
[XmlElement("startIndex", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? StartIndex { get; set; } = null;
public bool ShouldSerializeItemsPerPage()
{
return ItemsPerPage.HasValue;
}
[XmlElement("link")]
public List<FeedLink> Links { get; set; } = new List<FeedLink>() ;
[XmlElement("entry")]
public List<FeedEntry> Entries { get; set; } = new List<FeedEntry>();
public bool ShouldSerializeTotal()
{
return Total.HasValue;
}
public bool ShouldSerializeItemsPerPage()
{
return ItemsPerPage.HasValue;
}
public bool ShouldSerializeStartIndex()
{
return StartIndex.HasValue;
}
public bool ShouldSerializeStartIndex()
{
return StartIndex.HasValue;
}
}

View file

@ -1,12 +1,11 @@
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public class FeedAuthor
{
public class FeedAuthor
{
[XmlElement("name")]
public string Name { get; set; }
[XmlElement("uri")]
public string Uri { get; set; }
}
[XmlElement("name")]
public string Name { get; set; }
[XmlElement("uri")]
public string Uri { get; set; }
}

View file

@ -2,50 +2,49 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public class FeedEntry
{
public class FeedEntry
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
[XmlElement("id")]
public string Id { get; set; }
[XmlElement("id")]
public string Id { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("summary")]
public string Summary { get; set; }
[XmlElement("summary")]
public string Summary { get; set; }
/// <summary>
/// Represents Size of the Entry
/// Tag: , ElementName = "dcterms:extent"
/// <example>2 MB</example>
/// </summary>
[XmlElement("extent", Namespace = "http://purl.org/dc/terms/")]
public string Extent { get; set; }
/// <summary>
/// Represents Size of the Entry
/// Tag: , ElementName = "dcterms:extent"
/// <example>2 MB</example>
/// </summary>
[XmlElement("extent", Namespace = "http://purl.org/dc/terms/")]
public string Extent { get; set; }
/// <summary>
/// Format of the file
/// https://dublincore.org/specifications/dublin-core/dcmi-terms/
/// </summary>
[XmlElement("format", Namespace = "http://purl.org/dc/terms/format")]
public string Format { get; set; }
/// <summary>
/// Format of the file
/// https://dublincore.org/specifications/dublin-core/dcmi-terms/
/// </summary>
[XmlElement("format", Namespace = "http://purl.org/dc/terms/format")]
public string Format { get; set; }
[XmlElement("language", Namespace = "http://purl.org/dc/terms/")]
public string Language { get; set; }
[XmlElement("language", Namespace = "http://purl.org/dc/terms/")]
public string Language { get; set; }
[XmlElement("content")]
public FeedEntryContent Content { get; set; }
[XmlElement("content")]
public FeedEntryContent Content { get; set; }
[XmlElement("link")]
public List<FeedLink> Links = new List<FeedLink>();
[XmlElement("link")]
public List<FeedLink> Links = new List<FeedLink>();
// [XmlElement("author")]
// public List<FeedAuthor> Authors = new List<FeedAuthor>();
// [XmlElement("author")]
// public List<FeedAuthor> Authors = new List<FeedAuthor>();
// [XmlElement("category")]
// public List<FeedCategory> Categories = new List<FeedCategory>();
}
// [XmlElement("category")]
// public List<FeedCategory> Categories = new List<FeedCategory>();
}

View file

@ -1,12 +1,11 @@
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public class FeedEntryContent
{
public class FeedEntryContent
{
[XmlAttribute("type")]
public string Type = "text";
[XmlText]
public string Text;
}
[XmlAttribute("type")]
public string Type = "text";
[XmlText]
public string Text;
}

View file

@ -1,33 +1,32 @@
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public class FeedLink
{
public class FeedLink
/// <summary>
/// Relation on the Link
/// </summary>
[XmlAttribute("rel")]
public string Rel { get; set; }
/// <summary>
/// Should be any of the types here <see cref="FeedLinkType"/>
/// </summary>
[XmlAttribute("type")]
public string Type { get; set; }
[XmlAttribute("href")]
public string Href { get; set; }
[XmlAttribute("title")]
public string Title { get; set; }
[XmlAttribute("count", Namespace = "http://vaemendis.net/opds-pse/ns")]
public int TotalPages { get; set; }
public bool ShouldSerializeTotalPages()
{
/// <summary>
/// Relation on the Link
/// </summary>
[XmlAttribute("rel")]
public string Rel { get; set; }
/// <summary>
/// Should be any of the types here <see cref="FeedLinkType"/>
/// </summary>
[XmlAttribute("type")]
public string Type { get; set; }
[XmlAttribute("href")]
public string Href { get; set; }
[XmlAttribute("title")]
public string Title { get; set; }
[XmlAttribute("count", Namespace = "http://vaemendis.net/opds-pse/ns")]
public int TotalPages { get; set; }
public bool ShouldSerializeTotalPages()
{
return TotalPages > 0;
}
return TotalPages > 0;
}
}

View file

@ -1,24 +1,23 @@
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public static class FeedLinkRelation
{
public static class FeedLinkRelation
{
public const string Debug = "debug";
public const string Search = "search";
public const string Self = "self";
public const string Start = "start";
public const string Next = "next";
public const string Prev = "prev";
public const string Alternate = "alternate";
public const string SubSection = "subsection";
public const string Related = "related";
public const string Image = "http://opds-spec.org/image";
public const string Thumbnail = "http://opds-spec.org/image/thumbnail";
/// <summary>
/// This will allow for a download to occur
/// </summary>
public const string Acquisition = "http://opds-spec.org/acquisition/open-access";
public const string Debug = "debug";
public const string Search = "search";
public const string Self = "self";
public const string Start = "start";
public const string Next = "next";
public const string Prev = "prev";
public const string Alternate = "alternate";
public const string SubSection = "subsection";
public const string Related = "related";
public const string Image = "http://opds-spec.org/image";
public const string Thumbnail = "http://opds-spec.org/image/thumbnail";
/// <summary>
/// This will allow for a download to occur
/// </summary>
public const string Acquisition = "http://opds-spec.org/acquisition/open-access";
#pragma warning disable S1075
public const string Stream = "http://vaemendis.net/opds-pse/stream";
public const string Stream = "http://vaemendis.net/opds-pse/stream";
#pragma warning restore S1075
}
}

View file

@ -1,11 +1,10 @@
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public static class FeedLinkType
{
public static class FeedLinkType
{
public const string Atom = "application/atom+xml";
public const string AtomSearch = "application/opensearchdescription+xml";
public const string AtomNavigation = "application/atom+xml;profile=opds-catalog;kind=navigation";
public const string AtomAcquisition = "application/atom+xml;profile=opds-catalog;kind=acquisition";
public const string Image = "image/jpeg";
}
public const string Atom = "application/atom+xml";
public const string AtomSearch = "application/opensearchdescription+xml";
public const string AtomNavigation = "application/atom+xml;profile=opds-catalog;kind=navigation";
public const string AtomAcquisition = "application/atom+xml;profile=opds-catalog;kind=acquisition";
public const string Image = "image/jpeg";
}

View file

@ -1,42 +1,41 @@
using System.Xml.Serialization;
namespace API.DTOs.OPDS
{
[XmlRoot("OpenSearchDescription", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public class OpenSearchDescription
{
/// <summary>
/// Contains a brief human-readable title that identifies this search engine.
/// </summary>
public string ShortName { get; set; }
/// <summary>
/// Contains an extended human-readable title that identifies this search engine.
/// </summary>
public string LongName { get; set; }
/// <summary>
/// Contains a human-readable text description of the search engine.
/// </summary>
public string Description { get; set; }
/// <summary>
/// https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md#the-url-element
/// </summary>
public SearchLink Url { get; set; }
/// <summary>
/// Contains a set of words that are used as keywords to identify and categorize this search content.
/// Tags must be a single word and are delimited by the space character (' ').
/// </summary>
public string Tags { get; set; }
/// <summary>
/// Contains a URL that identifies the location of an image that can be used in association with this search content.
/// <example><Image height="64" width="64" type="image/png">http://example.com/websearch.png</Image></example>
/// </summary>
public string Image { get; set; }
public string InputEncoding { get; set; } = "UTF-8";
public string OutputEncoding { get; set; } = "UTF-8";
/// <summary>
/// Contains the human-readable name or identifier of the creator or maintainer of the description document.
/// </summary>
public string Developer { get; set; } = "kavitareader.com";
namespace API.DTOs.OPDS;
[XmlRoot("OpenSearchDescription", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public class OpenSearchDescription
{
/// <summary>
/// Contains a brief human-readable title that identifies this search engine.
/// </summary>
public string ShortName { get; set; }
/// <summary>
/// Contains an extended human-readable title that identifies this search engine.
/// </summary>
public string LongName { get; set; }
/// <summary>
/// Contains a human-readable text description of the search engine.
/// </summary>
public string Description { get; set; }
/// <summary>
/// https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md#the-url-element
/// </summary>
public SearchLink Url { get; set; }
/// <summary>
/// Contains a set of words that are used as keywords to identify and categorize this search content.
/// Tags must be a single word and are delimited by the space character (' ').
/// </summary>
public string Tags { get; set; }
/// <summary>
/// Contains a URL that identifies the location of an image that can be used in association with this search content.
/// <example><Image height="64" width="64" type="image/png">http://example.com/websearch.png</Image></example>
/// </summary>
public string Image { get; set; }
public string InputEncoding { get; set; } = "UTF-8";
public string OutputEncoding { get; set; } = "UTF-8";
/// <summary>
/// Contains the human-readable name or identifier of the creator or maintainer of the description document.
/// </summary>
public string Developer { get; set; } = "kavitareader.com";
}
}

View file

@ -1,16 +1,15 @@
using System.Xml.Serialization;
namespace API.DTOs.OPDS
namespace API.DTOs.OPDS;
public class SearchLink
{
public class SearchLink
{
[XmlAttribute("type")]
public string Type { get; set; }
[XmlAttribute("type")]
public string Type { get; set; }
[XmlAttribute("rel")]
public string Rel { get; set; } = "results";
[XmlAttribute("rel")]
public string Rel { get; set; } = "results";
[XmlAttribute("template")]
public string Template { get; set; }
}
[XmlAttribute("template")]
public string Template { get; set; }
}

View file

@ -1,11 +1,10 @@
using API.Entities.Enums;
namespace API.DTOs
namespace API.DTOs;
public class PersonDto
{
public class PersonDto
{
public int Id { get; set; }
public string Name { get; set; }
public PersonRole Role { get; set; }
}
public int Id { get; set; }
public string Name { get; set; }
public PersonRole Role { get; set; }
}

View file

@ -1,21 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs
namespace API.DTOs;
public class ProgressDto
{
public class ProgressDto
{
[Required]
public int VolumeId { get; set; }
[Required]
public int ChapterId { get; set; }
[Required]
public int PageNum { get; set; }
[Required]
public int SeriesId { get; set; }
/// <summary>
/// For Book reader, this can be an optional string of the id of a part marker, to help resume reading position
/// on pages that combine multiple "chapters".
/// </summary>
public string BookScrollId { get; set; }
}
[Required]
public int VolumeId { get; set; }
[Required]
public int ChapterId { get; set; }
[Required]
public int PageNum { get; set; }
[Required]
public int SeriesId { get; set; }
/// <summary>
/// For Book reader, this can be an optional string of the id of a part marker, to help resume reading position
/// on pages that combine multiple "chapters".
/// </summary>
public string BookScrollId { get; set; }
}

View file

@ -1,21 +1,20 @@
using System.Collections.Generic;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class BookChapterItem
{
public class BookChapterItem
{
/// <summary>
/// Name of the Chapter
/// </summary>
public string Title { get; set; }
/// <summary>
/// A part represents the id of the anchor so we can scroll to it. 01_values.xhtml#h_sVZPaxUSy/
/// </summary>
public string Part { get; set; }
/// <summary>
/// Page Number to load for the chapter
/// </summary>
public int Page { get; set; }
public ICollection<BookChapterItem> Children { get; set; }
}
/// <summary>
/// Name of the Chapter
/// </summary>
public string Title { get; set; }
/// <summary>
/// A part represents the id of the anchor so we can scroll to it. 01_values.xhtml#h_sVZPaxUSy/
/// </summary>
public string Part { get; set; }
/// <summary>
/// Page Number to load for the chapter
/// </summary>
public int Page { get; set; }
public ICollection<BookChapterItem> Children { get; set; }
}

View file

@ -1,19 +1,18 @@
using API.Entities.Enums;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class BookInfoDto : IChapterInfoDto
{
public class BookInfoDto : IChapterInfoDto
{
public string BookTitle { get; set; }
public int SeriesId { get; set; }
public int VolumeId { get; set; }
public MangaFormat SeriesFormat { get; set; }
public string SeriesName { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int LibraryId { get; set; }
public int Pages { get; set; }
public bool IsSpecial { get; set; }
public string ChapterTitle { get; set; }
}
public string BookTitle { get; set; }
public int SeriesId { get; set; }
public int VolumeId { get; set; }
public MangaFormat SeriesFormat { get; set; }
public string SeriesName { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int LibraryId { get; set; }
public int Pages { get; set; }
public bool IsSpecial { get; set; }
public string ChapterTitle { get; set; }
}

View file

@ -1,17 +1,16 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class BookmarkDto
{
public class BookmarkDto
{
public int Id { get; set; }
[Required]
public int Page { get; set; }
[Required]
public int VolumeId { get; set; }
[Required]
public int SeriesId { get; set; }
[Required]
public int ChapterId { get; set; }
}
public int Id { get; set; }
[Required]
public int Page { get; set; }
[Required]
public int VolumeId { get; set; }
[Required]
public int SeriesId { get; set; }
[Required]
public int ChapterId { get; set; }
}

View file

@ -1,9 +1,8 @@
using System.Collections.Generic;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class BulkRemoveBookmarkForSeriesDto
{
public class BulkRemoveBookmarkForSeriesDto
{
public ICollection<int> SeriesIds { get; init; }
}
public ICollection<int> SeriesIds { get; init; }
}

View file

@ -1,19 +1,18 @@
using API.Entities.Enums;
namespace API.DTOs.Reader
{
public interface IChapterInfoDto
{
public int SeriesId { get; set; }
public int VolumeId { get; set; }
public MangaFormat SeriesFormat { get; set; }
public string SeriesName { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int LibraryId { get; set; }
public int Pages { get; set; }
public bool IsSpecial { get; set; }
public string ChapterTitle { get; set; }
namespace API.DTOs.Reader;
public interface IChapterInfoDto
{
public int SeriesId { get; set; }
public int VolumeId { get; set; }
public MangaFormat SeriesFormat { get; set; }
public string SeriesName { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int LibraryId { get; set; }
public int Pages { get; set; }
public bool IsSpecial { get; set; }
public string ChapterTitle { get; set; }
}
}

View file

@ -1,9 +1,8 @@
using System.Collections.Generic;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class MarkMultipleSeriesAsReadDto
{
public class MarkMultipleSeriesAsReadDto
{
public IReadOnlyList<int> SeriesIds { get; init; }
}
public IReadOnlyList<int> SeriesIds { get; init; }
}

View file

@ -1,7 +1,6 @@
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class MarkReadDto
{
public class MarkReadDto
{
public int SeriesId { get; init; }
}
public int SeriesId { get; init; }
}

View file

@ -1,8 +1,7 @@
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class MarkVolumeReadDto
{
public class MarkVolumeReadDto
{
public int SeriesId { get; init; }
public int VolumeId { get; init; }
}
public int SeriesId { get; init; }
public int VolumeId { get; init; }
}

View file

@ -1,20 +1,19 @@
using System.Collections.Generic;
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
/// <summary>
/// This is used for bulk updating a set of volume and or chapters in one go
/// </summary>
public class MarkVolumesReadDto
{
public int SeriesId { get; set; }
/// <summary>
/// This is used for bulk updating a set of volume and or chapters in one go
/// A list of Volumes to mark read
/// </summary>
public class MarkVolumesReadDto
{
public int SeriesId { get; set; }
/// <summary>
/// A list of Volumes to mark read
/// </summary>
public IReadOnlyList<int> VolumeIds { get; set; }
/// <summary>
/// A list of additional Chapters to mark as read
/// </summary>
public IReadOnlyList<int> ChapterIds { get; set; }
}
public IReadOnlyList<int> VolumeIds { get; set; }
/// <summary>
/// A list of additional Chapters to mark as read
/// </summary>
public IReadOnlyList<int> ChapterIds { get; set; }
}

View file

@ -1,7 +1,6 @@
namespace API.DTOs.Reader
namespace API.DTOs.Reader;
public class RemoveBookmarkForSeriesDto
{
public class RemoveBookmarkForSeriesDto
{
public int SeriesId { get; init; }
}
public int SeriesId { get; init; }
}

View file

@ -1,7 +1,6 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class CreateReadingListDto
{
public class CreateReadingListDto
{
public string Title { get; init; }
}
public string Title { get; init; }
}

View file

@ -1,18 +1,17 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class ReadingListDto
{
public class ReadingListDto
{
public int Id { get; init; }
public string Title { get; set; }
public string Summary { get; set; }
/// <summary>
/// Reading lists that are promoted are only done by admins
/// </summary>
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// This is used to tell the UI if it should request a Cover Image or not. If null or empty, it has not been set.
/// </summary>
public string CoverImage { get; set; } = string.Empty;
}
public int Id { get; init; }
public string Title { get; set; }
public string Summary { get; set; }
/// <summary>
/// Reading lists that are promoted are only done by admins
/// </summary>
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// This is used to tell the UI if it should request a Cover Image or not. If null or empty, it has not been set.
/// </summary>
public string CoverImage { get; set; } = string.Empty;
}

View file

@ -1,25 +1,24 @@
using API.Entities.Enums;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class ReadingListItemDto
{
public class ReadingListItemDto
{
public int Id { get; init; }
public int Order { get; init; }
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public string SeriesName { get; set; }
public MangaFormat SeriesFormat { get; set; }
public int PagesRead { get; set; }
public int PagesTotal { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int VolumeId { get; set; }
public int LibraryId { get; set; }
public string Title { get; set; }
/// <summary>
/// Used internally only
/// </summary>
public int ReadingListId { get; set; }
}
public int Id { get; init; }
public int Order { get; init; }
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public string SeriesName { get; set; }
public MangaFormat SeriesFormat { get; set; }
public int PagesRead { get; set; }
public int PagesTotal { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int VolumeId { get; set; }
public int LibraryId { get; set; }
public string Title { get; set; }
/// <summary>
/// Used internally only
/// </summary>
public int ReadingListId { get; set; }
}

View file

@ -1,9 +1,8 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByChapterDto
{
public class UpdateReadingListByChapterDto
{
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,12 +1,11 @@
using System.Collections.Generic;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByMultipleDto
{
public class UpdateReadingListByMultipleDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
public IReadOnlyList<int> VolumeIds { get; init; }
public IReadOnlyList<int> ChapterIds { get; init; }
}
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
public IReadOnlyList<int> VolumeIds { get; init; }
public IReadOnlyList<int> ChapterIds { get; init; }
}

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByMultipleSeriesDto
{
public class UpdateReadingListByMultipleSeriesDto
{
public int ReadingListId { get; init; }
public IReadOnlyList<int> SeriesIds { get; init; }
}
public int ReadingListId { get; init; }
public IReadOnlyList<int> SeriesIds { get; init; }
}

View file

@ -1,8 +1,7 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListBySeriesDto
{
public class UpdateReadingListBySeriesDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,9 +1,8 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByVolumeDto
{
public class UpdateReadingListByVolumeDto
{
public int VolumeId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int VolumeId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,11 +1,10 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListDto
{
public class UpdateReadingListDto
{
public int ReadingListId { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
}
public int ReadingListId { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
}

View file

@ -1,18 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
/// <summary>
/// DTO for moving a reading list item to another position within the same list
/// </summary>
public class UpdateReadingListPosition
{
/// <summary>
/// DTO for moving a reading list item to another position within the same list
/// </summary>
public class UpdateReadingListPosition
{
[Required]
public int ReadingListId { get; set; }
[Required]
public int ReadingListItemId { get; set; }
public int FromPosition { get; set; }
[Required]
public int ToPosition { get; set; }
}
[Required] public int ReadingListId { get; set; }
[Required] public int ReadingListItemId { get; set; }
public int FromPosition { get; set; }
[Required] public int ToPosition { get; set; }
}

View file

@ -1,22 +1,21 @@
namespace API.DTOs
namespace API.DTOs;
/// <summary>
/// Used for running some task against a Series.
/// </summary>
public class RefreshSeriesDto
{
/// <summary>
/// Used for running some task against a Series.
/// Library Id series belongs to
/// </summary>
public class RefreshSeriesDto
{
/// <summary>
/// Library Id series belongs to
/// </summary>
public int LibraryId { get; init; }
/// <summary>
/// Series Id
/// </summary>
public int SeriesId { get; init; }
/// <summary>
/// Should the task force opening/re-calculation.
/// </summary>
/// <remarks>This is expensive if true. Defaults to true.</remarks>
public bool ForceUpdate { get; init; } = true;
}
public int LibraryId { get; init; }
/// <summary>
/// Series Id
/// </summary>
public int SeriesId { get; init; }
/// <summary>
/// Should the task force opening/re-calculation.
/// </summary>
/// <remarks>This is expensive if true. Defaults to true.</remarks>
public bool ForceUpdate { get; init; } = true;
}

View file

@ -1,15 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs
namespace API.DTOs;
public class RegisterDto
{
public class RegisterDto
{
[Required]
public string Username { get; init; }
[Required]
public string Email { get; init; }
[Required]
[StringLength(32, MinimumLength = 6)]
public string Password { get; set; }
}
[Required]
public string Username { get; init; }
[Required]
public string Email { get; init; }
[Required]
[StringLength(32, MinimumLength = 6)]
public string Password { get; set; }
}

View file

@ -1,18 +1,17 @@
using API.Entities.Enums;
namespace API.DTOs.Search
{
public class SearchResultDto
{
public int SeriesId { get; init; }
public string Name { get; init; }
public string OriginalName { get; init; }
public string SortName { get; init; }
public string LocalizedName { get; init; }
public MangaFormat Format { get; init; }
namespace API.DTOs.Search;
// Grouping information
public string LibraryName { get; set; }
public int LibraryId { get; set; }
}
public class SearchResultDto
{
public int SeriesId { get; init; }
public string Name { get; init; }
public string OriginalName { get; init; }
public string SortName { get; init; }
public string LocalizedName { get; init; }
public MangaFormat Format { get; init; }
// Grouping information
public string LibraryName { get; set; }
public int LibraryId { get; set; }
}

View file

@ -1,7 +1,6 @@
namespace API.DTOs
namespace API.DTOs;
public class SeriesByIdsDto
{
public class SeriesByIdsDto
{
public int[] SeriesIds { get; init; }
}
public int[] SeriesIds { get; init; }
}

View file

@ -2,65 +2,64 @@
using API.Entities.Enums;
using API.Entities.Interfaces;
namespace API.DTOs
namespace API.DTOs;
public class SeriesDto : IHasReadTimeEstimate
{
public class SeriesDto : IHasReadTimeEstimate
{
public int Id { get; init; }
public string Name { get; init; }
public string OriginalName { get; init; }
public string LocalizedName { get; init; }
public string SortName { get; init; }
public string Summary { get; init; }
public int Pages { get; init; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// Sum of pages read from linked Volumes. Calculated at API-time.
/// </summary>
public int PagesRead { get; set; }
/// <summary>
/// DateTime representing last time the series was Read. Calculated at API-time.
/// </summary>
public DateTime LatestReadDate { get; set; }
/// <summary>
/// DateTime representing last time a chapter was added to the Series
/// </summary>
public DateTime LastChapterAdded { get; set; }
/// <summary>
/// Rating from logged in user. Calculated at API-time.
/// </summary>
public int UserRating { get; set; }
/// <summary>
/// Review from logged in user. Calculated at API-time.
/// </summary>
public string UserReview { get; set; }
public MangaFormat Format { get; set; }
public int Id { get; init; }
public string Name { get; init; }
public string OriginalName { get; init; }
public string LocalizedName { get; init; }
public string SortName { get; init; }
public string Summary { get; init; }
public int Pages { get; init; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// Sum of pages read from linked Volumes. Calculated at API-time.
/// </summary>
public int PagesRead { get; set; }
/// <summary>
/// DateTime representing last time the series was Read. Calculated at API-time.
/// </summary>
public DateTime LatestReadDate { get; set; }
/// <summary>
/// DateTime representing last time a chapter was added to the Series
/// </summary>
public DateTime LastChapterAdded { get; set; }
/// <summary>
/// Rating from logged in user. Calculated at API-time.
/// </summary>
public int UserRating { get; set; }
/// <summary>
/// Review from logged in user. Calculated at API-time.
/// </summary>
public string UserReview { get; set; }
public MangaFormat Format { get; set; }
public DateTime Created { get; set; }
public DateTime Created { get; set; }
public bool NameLocked { get; set; }
public bool SortNameLocked { get; set; }
public bool LocalizedNameLocked { get; set; }
/// <summary>
/// Total number of words for the series. Only applies to epubs.
/// </summary>
public long WordCount { get; set; }
public bool NameLocked { get; set; }
public bool SortNameLocked { get; set; }
public bool LocalizedNameLocked { get; set; }
/// <summary>
/// Total number of words for the series. Only applies to epubs.
/// </summary>
public long WordCount { get; set; }
public int LibraryId { get; set; }
public string LibraryName { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
/// <summary>
/// The highest level folder for this Series
/// </summary>
public string FolderPath { get; set; }
/// <summary>
/// The last time the folder for this series was scanned
/// </summary>
public DateTime LastFolderScanned { get; set; }
}
public int LibraryId { get; set; }
public string LibraryName { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
/// <summary>
/// The highest level folder for this Series
/// </summary>
public string FolderPath { get; set; }
/// <summary>
/// The last time the folder for this series was scanned
/// </summary>
public DateTime LastFolderScanned { get; set; }
}

View file

@ -4,83 +4,82 @@ using API.DTOs.CollectionTags;
using API.DTOs.Metadata;
using API.Entities.Enums;
namespace API.DTOs
namespace API.DTOs;
public class SeriesMetadataDto
{
public class SeriesMetadataDto
{
public int Id { get; set; }
public string Summary { get; set; } = string.Empty;
/// <summary>
/// Collections the Series belongs to
/// </summary>
public ICollection<CollectionTagDto> CollectionTags { get; set; }
/// <summary>
/// Genres for the Series
/// </summary>
public ICollection<GenreTagDto> Genres { get; set; }
/// <summary>
/// Collection of all Tags from underlying chapters for a Series
/// </summary>
public ICollection<TagDto> Tags { get; set; }
public ICollection<PersonDto> Writers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> CoverArtists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Publishers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Characters { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Pencillers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Inkers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Colorists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Letterers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Editors { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Translators { get; set; } = new List<PersonDto>();
/// <summary>
/// Highest Age Rating from all Chapters
/// </summary>
public AgeRating AgeRating { get; set; } = AgeRating.Unknown;
/// <summary>
/// Earliest Year from all chapters
/// </summary>
public int ReleaseYear { get; set; }
/// <summary>
/// Language of the content (BCP-47 code)
/// </summary>
public string Language { get; set; } = string.Empty;
/// <summary>
/// Max number of issues/volumes in the series (Max of Volume/Issue field in ComicInfo)
/// </summary>
public int MaxCount { get; set; } = 0;
/// <summary>
/// Total number of issues/volumes for the series
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Publication status of the Series
/// </summary>
public PublicationStatus PublicationStatus { get; set; }
public int Id { get; set; }
public string Summary { get; set; } = string.Empty;
/// <summary>
/// Collections the Series belongs to
/// </summary>
public ICollection<CollectionTagDto> CollectionTags { get; set; }
/// <summary>
/// Genres for the Series
/// </summary>
public ICollection<GenreTagDto> Genres { get; set; }
/// <summary>
/// Collection of all Tags from underlying chapters for a Series
/// </summary>
public ICollection<TagDto> Tags { get; set; }
public ICollection<PersonDto> Writers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> CoverArtists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Publishers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Characters { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Pencillers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Inkers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Colorists { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Letterers { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Editors { get; set; } = new List<PersonDto>();
public ICollection<PersonDto> Translators { get; set; } = new List<PersonDto>();
/// <summary>
/// Highest Age Rating from all Chapters
/// </summary>
public AgeRating AgeRating { get; set; } = AgeRating.Unknown;
/// <summary>
/// Earliest Year from all chapters
/// </summary>
public int ReleaseYear { get; set; }
/// <summary>
/// Language of the content (BCP-47 code)
/// </summary>
public string Language { get; set; } = string.Empty;
/// <summary>
/// Max number of issues/volumes in the series (Max of Volume/Issue field in ComicInfo)
/// </summary>
public int MaxCount { get; set; } = 0;
/// <summary>
/// Total number of issues/volumes for the series
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Publication status of the Series
/// </summary>
public PublicationStatus PublicationStatus { get; set; }
public bool LanguageLocked { get; set; }
public bool SummaryLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override AgeRating
/// </summary>
public bool AgeRatingLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override PublicationStatus
/// </summary>
public bool PublicationStatusLocked { get; set; }
public bool GenresLocked { get; set; }
public bool TagsLocked { get; set; }
public bool WritersLocked { get; set; }
public bool CharactersLocked { get; set; }
public bool ColoristsLocked { get; set; }
public bool EditorsLocked { get; set; }
public bool InkersLocked { get; set; }
public bool LetterersLocked { get; set; }
public bool PencillersLocked { get; set; }
public bool PublishersLocked { get; set; }
public bool TranslatorsLocked { get; set; }
public bool CoverArtistsLocked { get; set; }
public bool LanguageLocked { get; set; }
public bool SummaryLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override AgeRating
/// </summary>
public bool AgeRatingLocked { get; set; }
/// <summary>
/// Locked by user so metadata updates from scan loop will not override PublicationStatus
/// </summary>
public bool PublicationStatusLocked { get; set; }
public bool GenresLocked { get; set; }
public bool TagsLocked { get; set; }
public bool WritersLocked { get; set; }
public bool CharactersLocked { get; set; }
public bool ColoristsLocked { get; set; }
public bool EditorsLocked { get; set; }
public bool InkersLocked { get; set; }
public bool LetterersLocked { get; set; }
public bool PencillersLocked { get; set; }
public bool PublishersLocked { get; set; }
public bool TranslatorsLocked { get; set; }
public bool CoverArtistsLocked { get; set; }
public int SeriesId { get; set; }
}
public int SeriesId { get; set; }
}

View file

@ -1,64 +1,63 @@
using API.Services;
namespace API.DTOs.Settings
{
public class ServerSettingDto
{
public string CacheDirectory { get; set; }
public string TaskScan { get; set; }
/// <summary>
/// Logging level for server. Managed in appsettings.json.
/// </summary>
public string LoggingLevel { get; set; }
public string TaskBackup { get; set; }
/// <summary>
/// Port the server listens on. Managed in appsettings.json.
/// </summary>
public int Port { get; set; }
/// <summary>
/// Allows anonymous information to be collected and sent to KavitaStats
/// </summary>
public bool AllowStatCollection { get; set; }
/// <summary>
/// Enables OPDS connections to be made to the server.
/// </summary>
public bool EnableOpds { get; set; }
/// <summary>
/// Base Url for the kavita. Requires restart to take effect.
/// </summary>
public string BaseUrl { get; set; }
/// <summary>
/// Where Bookmarks are stored.
/// </summary>
/// <remarks>If null or empty string, will default back to default install setting aka <see cref="DirectoryService.BookmarkDirectory"/></remarks>
public string BookmarksDirectory { get; set; }
/// <summary>
/// Email service to use for the invite user flow, forgot password, etc.
/// </summary>
/// <remarks>If null or empty string, will default back to default install setting aka <see cref="EmailService.DefaultApiUrl"/></remarks>
public string EmailServiceUrl { get; set; }
public string InstallVersion { get; set; }
/// <summary>
/// Represents a unique Id to this Kavita installation. Only used in Stats to identify unique installs.
/// </summary>
public string InstallId { get; set; }
/// <summary>
/// If the server should save bookmarks as WebP encoding
/// </summary>
public bool ConvertBookmarkToWebP { get; set; }
/// <summary>
/// If the Swagger UI Should be exposed. Does not require authentication, but does require a JWT.
/// </summary>
public bool EnableSwaggerUi { get; set; }
namespace API.DTOs.Settings;
/// <summary>
/// The amount of Backups before cleanup
/// </summary>
/// <remarks>Value should be between 1 and 30</remarks>
public int TotalBackups { get; set; } = 30;
/// <summary>
/// If Kavita should watch the library folders and process changes
/// </summary>
public bool EnableFolderWatching { get; set; } = true;
}
public class ServerSettingDto
{
public string CacheDirectory { get; set; }
public string TaskScan { get; set; }
/// <summary>
/// Logging level for server. Managed in appsettings.json.
/// </summary>
public string LoggingLevel { get; set; }
public string TaskBackup { get; set; }
/// <summary>
/// Port the server listens on. Managed in appsettings.json.
/// </summary>
public int Port { get; set; }
/// <summary>
/// Allows anonymous information to be collected and sent to KavitaStats
/// </summary>
public bool AllowStatCollection { get; set; }
/// <summary>
/// Enables OPDS connections to be made to the server.
/// </summary>
public bool EnableOpds { get; set; }
/// <summary>
/// Base Url for the kavita. Requires restart to take effect.
/// </summary>
public string BaseUrl { get; set; }
/// <summary>
/// Where Bookmarks are stored.
/// </summary>
/// <remarks>If null or empty string, will default back to default install setting aka <see cref="DirectoryService.BookmarkDirectory"/></remarks>
public string BookmarksDirectory { get; set; }
/// <summary>
/// Email service to use for the invite user flow, forgot password, etc.
/// </summary>
/// <remarks>If null or empty string, will default back to default install setting aka <see cref="EmailService.DefaultApiUrl"/></remarks>
public string EmailServiceUrl { get; set; }
public string InstallVersion { get; set; }
/// <summary>
/// Represents a unique Id to this Kavita installation. Only used in Stats to identify unique installs.
/// </summary>
public string InstallId { get; set; }
/// <summary>
/// If the server should save bookmarks as WebP encoding
/// </summary>
public bool ConvertBookmarkToWebP { get; set; }
/// <summary>
/// If the Swagger UI Should be exposed. Does not require authentication, but does require a JWT.
/// </summary>
public bool EnableSwaggerUi { get; set; }
/// <summary>
/// The amount of Backups before cleanup
/// </summary>
/// <remarks>Value should be between 1 and 30</remarks>
public int TotalBackups { get; set; } = 30;
/// <summary>
/// If Kavita should watch the library folders and process changes
/// </summary>
public bool EnableFolderWatching { get; set; } = true;
}

View file

@ -1,123 +1,122 @@
using API.Entities.Enums;
namespace API.DTOs.Stats
namespace API.DTOs.Stats;
/// <summary>
/// Represents information about a Kavita Installation
/// </summary>
public class ServerInfoDto
{
/// <summary>
/// Represents information about a Kavita Installation
/// Unique Id that represents a unique install
/// </summary>
public class ServerInfoDto
{
/// <summary>
/// Unique Id that represents a unique install
/// </summary>
public string InstallId { get; set; }
public string Os { get; set; }
/// <summary>
/// If the Kavita install is using Docker
/// </summary>
public bool IsDocker { get; set; }
/// <summary>
/// Version of .NET instance is running
/// </summary>
public string DotnetVersion { get; set; }
/// <summary>
/// Version of Kavita
/// </summary>
public string KavitaVersion { get; set; }
/// <summary>
/// Number of Cores on the instance
/// </summary>
public int NumOfCores { get; set; }
/// <summary>
/// The number of libraries on the instance
/// </summary>
public int NumberOfLibraries { get; set; }
/// <summary>
/// Does any user have bookmarks
/// </summary>
public bool HasBookmarks { get; set; }
/// <summary>
/// The site theme the install is using
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public string ActiveSiteTheme { get; set; }
/// <summary>
/// The reading mode the main user has as a preference
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public ReaderMode MangaReaderMode { get; set; }
public string InstallId { get; set; }
public string Os { get; set; }
/// <summary>
/// If the Kavita install is using Docker
/// </summary>
public bool IsDocker { get; set; }
/// <summary>
/// Version of .NET instance is running
/// </summary>
public string DotnetVersion { get; set; }
/// <summary>
/// Version of Kavita
/// </summary>
public string KavitaVersion { get; set; }
/// <summary>
/// Number of Cores on the instance
/// </summary>
public int NumOfCores { get; set; }
/// <summary>
/// The number of libraries on the instance
/// </summary>
public int NumberOfLibraries { get; set; }
/// <summary>
/// Does any user have bookmarks
/// </summary>
public bool HasBookmarks { get; set; }
/// <summary>
/// The site theme the install is using
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public string ActiveSiteTheme { get; set; }
/// <summary>
/// The reading mode the main user has as a preference
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public ReaderMode MangaReaderMode { get; set; }
/// <summary>
/// Number of users on the install
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfUsers { get; set; }
/// <summary>
/// Number of users on the install
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfUsers { get; set; }
/// <summary>
/// Number of collections on the install
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfCollections { get; set; }
/// <summary>
/// Number of reading lists on the install (Sum of all users)
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfReadingLists { get; set; }
/// <summary>
/// Is OPDS enabled
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public bool OPDSEnabled { get; set; }
/// <summary>
/// Total number of files in the instance
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int TotalFiles { get; set; }
/// <summary>
/// Total number of Genres in the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int TotalGenres { get; set; }
/// <summary>
/// Total number of People in the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int TotalPeople { get; set; }
/// <summary>
/// Is this instance storing bookmarks as WebP
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public bool StoreBookmarksAsWebP { get; set; }
/// <summary>
/// Number of users on this instance using Card Layout
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int UsersOnCardLayout { get; set; }
/// <summary>
/// Number of users on this instance using List Layout
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int UsersOnListLayout { get; set; }
/// <summary>
/// Max number of Series for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxSeriesInALibrary { get; set; }
/// <summary>
/// Max number of Volumes for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxVolumesInASeries { get; set; }
/// <summary>
/// Max number of Chapters for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxChaptersInASeries { get; set; }
/// <summary>
/// Does this instance have relationships setup between series
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public bool UsingSeriesRelationships { get; set; }
/// <summary>
/// Number of collections on the install
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfCollections { get; set; }
/// <summary>
/// Number of reading lists on the install (Sum of all users)
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int NumberOfReadingLists { get; set; }
/// <summary>
/// Is OPDS enabled
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public bool OPDSEnabled { get; set; }
/// <summary>
/// Total number of files in the instance
/// </summary>
/// <remarks>Introduced in v0.5.2</remarks>
public int TotalFiles { get; set; }
/// <summary>
/// Total number of Genres in the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int TotalGenres { get; set; }
/// <summary>
/// Total number of People in the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int TotalPeople { get; set; }
/// <summary>
/// Is this instance storing bookmarks as WebP
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public bool StoreBookmarksAsWebP { get; set; }
/// <summary>
/// Number of users on this instance using Card Layout
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int UsersOnCardLayout { get; set; }
/// <summary>
/// Number of users on this instance using List Layout
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int UsersOnListLayout { get; set; }
/// <summary>
/// Max number of Series for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxSeriesInALibrary { get; set; }
/// <summary>
/// Max number of Volumes for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxVolumesInASeries { get; set; }
/// <summary>
/// Max number of Chapters for any library on the instance
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public int MaxChaptersInASeries { get; set; }
/// <summary>
/// Does this instance have relationships setup between series
/// </summary>
/// <remarks>Introduced in v0.5.4</remarks>
public bool UsingSeriesRelationships { get; set; }
}
}

View file

@ -1,42 +1,41 @@
namespace API.DTOs.Update
namespace API.DTOs.Update;
/// <summary>
/// Update Notification denoting a new release available for user to update to
/// </summary>
public class UpdateNotificationDto
{
/// <summary>
/// Update Notification denoting a new release available for user to update to
/// Current installed Version
/// </summary>
public class UpdateNotificationDto
{
/// <summary>
/// Current installed Version
/// </summary>
public string CurrentVersion { get; init; }
/// <summary>
/// Semver of the release version
/// <example>0.4.3</example>
/// </summary>
public string UpdateVersion { get; init; }
/// <summary>
/// Release body in HTML
/// </summary>
public string UpdateBody { get; init; }
/// <summary>
/// Title of the release
/// </summary>
public string UpdateTitle { get; init; }
/// <summary>
/// Github Url
/// </summary>
public string UpdateUrl { get; init; }
/// <summary>
/// If this install is within Docker
/// </summary>
public bool IsDocker { get; init; }
/// <summary>
/// Is this a pre-release
/// </summary>
public bool IsPrerelease { get; init; }
/// <summary>
/// Date of the publish
/// </summary>
public string PublishDate { get; init; }
}
public string CurrentVersion { get; init; }
/// <summary>
/// Semver of the release version
/// <example>0.4.3</example>
/// </summary>
public string UpdateVersion { get; init; }
/// <summary>
/// Release body in HTML
/// </summary>
public string UpdateBody { get; init; }
/// <summary>
/// Title of the release
/// </summary>
public string UpdateTitle { get; init; }
/// <summary>
/// Github Url
/// </summary>
public string UpdateUrl { get; init; }
/// <summary>
/// If this install is within Docker
/// </summary>
public bool IsDocker { get; init; }
/// <summary>
/// Is this a pre-release
/// </summary>
public bool IsPrerelease { get; init; }
/// <summary>
/// Date of the publish
/// </summary>
public string PublishDate { get; init; }
}

View file

@ -1,13 +1,12 @@
using System.Collections.Generic;
using API.Entities.Enums;
namespace API.DTOs
namespace API.DTOs;
public class UpdateLibraryDto
{
public class UpdateLibraryDto
{
public int Id { get; init; }
public string Name { get; init; }
public LibraryType Type { get; set; }
public IEnumerable<string> Folders { get; init; }
}
public int Id { get; init; }
public string Name { get; init; }
public LibraryType Type { get; set; }
public IEnumerable<string> Folders { get; init; }
}

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
namespace API.DTOs
namespace API.DTOs;
public class UpdateLibraryForUserDto
{
public class UpdateLibraryForUserDto
{
public string Username { get; init; }
public IEnumerable<LibraryDto> SelectedLibraries { get; init; }
}
}
public string Username { get; init; }
public IEnumerable<LibraryDto> SelectedLibraries { get; init; }
}

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
namespace API.DTOs
namespace API.DTOs;
public class UpdateRbsDto
{
public class UpdateRbsDto
{
public string Username { get; init; }
public IList<string> Roles { get; init; }
}
}
public string Username { get; init; }
public IList<string> Roles { get; init; }
}

View file

@ -1,15 +1,14 @@
namespace API.DTOs
{
public class UpdateSeriesDto
{
public int Id { get; init; }
public string Name { get; init; }
public string LocalizedName { get; init; }
public string SortName { get; init; }
public bool CoverImageLocked { get; set; }
namespace API.DTOs;
public bool NameLocked { get; set; }
public bool SortNameLocked { get; set; }
public bool LocalizedNameLocked { get; set; }
}
public class UpdateSeriesDto
{
public int Id { get; init; }
public string Name { get; init; }
public string LocalizedName { get; init; }
public string SortName { get; init; }
public bool CoverImageLocked { get; set; }
public bool NameLocked { get; set; }
public bool SortNameLocked { get; set; }
public bool LocalizedNameLocked { get; set; }
}

View file

@ -1,11 +1,10 @@
using System.Collections.Generic;
using API.DTOs.CollectionTags;
namespace API.DTOs
namespace API.DTOs;
public class UpdateSeriesMetadataDto
{
public class UpdateSeriesMetadataDto
{
public SeriesMetadataDto SeriesMetadata { get; set; }
public ICollection<CollectionTagDto> CollectionTags { get; set; }
}
public SeriesMetadataDto SeriesMetadata { get; set; }
public ICollection<CollectionTagDto> CollectionTags { get; set; }
}

View file

@ -1,12 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs
namespace API.DTOs;
public class UpdateSeriesRatingDto
{
public class UpdateSeriesRatingDto
{
public int SeriesId { get; init; }
public int UserRating { get; init; }
[MaxLength(1000)]
public string UserReview { get; init; }
}
}
public int SeriesId { get; init; }
public int UserRating { get; init; }
[MaxLength(1000)]
public string UserReview { get; init; }
}

View file

@ -1,14 +1,13 @@
namespace API.DTOs.Uploads
namespace API.DTOs.Uploads;
public class UploadFileDto
{
public class UploadFileDto
{
/// <summary>
/// Id of the Entity
/// </summary>
public int Id { get; set; }
/// <summary>
/// Base Url encoding of the file to upload from (can be null)
/// </summary>
public string Url { get; set; }
}
/// <summary>
/// Id of the Entity
/// </summary>
public int Id { get; set; }
/// <summary>
/// Base Url encoding of the file to upload from (can be null)
/// </summary>
public string Url { get; set; }
}

View file

@ -1,13 +1,12 @@

namespace API.DTOs
namespace API.DTOs;
public class UserDto
{
public class UserDto
{
public string Username { get; init; }
public string Email { get; init; }
public string Token { get; set; }
public string RefreshToken { get; set; }
public string ApiKey { get; init; }
public UserPreferencesDto Preferences { get; set; }
}
public string Username { get; init; }
public string Email { get; init; }
public string Token { get; set; }
public string RefreshToken { get; set; }
public string ApiKey { get; init; }
public UserPreferencesDto Preferences { get; set; }
}

View file

@ -5,116 +5,115 @@ using API.Entities;
using API.Entities.Enums;
using API.Entities.Enums.UserPreferences;
namespace API.DTOs
namespace API.DTOs;
public class UserPreferencesDto
{
public class UserPreferencesDto
{
/// <summary>
/// Manga Reader Option: What direction should the next/prev page buttons go
/// </summary>
[Required]
public ReadingDirection ReadingDirection { get; set; }
/// <summary>
/// Manga Reader Option: How should the image be scaled to screen
/// </summary>
[Required]
public ScalingOption ScalingOption { get; set; }
/// <summary>
/// Manga Reader Option: Which side of a split image should we show first
/// </summary>
[Required]
public PageSplitOption PageSplitOption { get; set; }
/// <summary>
/// Manga Reader Option: How the manga reader should perform paging or reading of the file
/// <example>
/// Webtoon uses scrolling to page, LeftRight uses paging by clicking left/right side of reader, UpDown uses paging
/// by clicking top/bottom sides of reader.
/// </example>
/// </summary>
[Required]
public ReaderMode ReaderMode { get; set; }
/// <summary>
/// Manga Reader Option: How many pages to display in the reader at once
/// </summary>
[Required]
public LayoutMode LayoutMode { get; set; }
/// <summary>
/// Manga Reader Option: Background color of the reader
/// </summary>
[Required]
public string BackgroundColor { get; set; } = "#000000";
/// <summary>
/// Manga Reader Option: Allow the menu to close after 6 seconds without interaction
/// </summary>
[Required]
public bool AutoCloseMenu { get; set; }
/// <summary>
/// Manga Reader Option: Show screen hints to the user on some actions, ie) pagination direction change
/// </summary>
[Required]
public bool ShowScreenHints { get; set; } = true;
/// <summary>
/// Book Reader Option: Override extra Margin
/// </summary>
[Required]
public int BookReaderMargin { get; set; }
/// <summary>
/// Book Reader Option: Override line-height
/// </summary>
[Required]
public int BookReaderLineSpacing { get; set; }
/// <summary>
/// Book Reader Option: Override font size
/// </summary>
[Required]
public int BookReaderFontSize { get; set; }
/// <summary>
/// Book Reader Option: Maps to the default Kavita font-family (inherit) or an override
/// </summary>
[Required]
public string BookReaderFontFamily { get; set; }
/// <summary>
/// Book Reader Option: Allows tapping on side of screens to paginate
/// </summary>
[Required]
public bool BookReaderTapToPaginate { get; set; }
/// <summary>
/// Book Reader Option: What direction should the next/prev page buttons go
/// </summary>
[Required]
public ReadingDirection BookReaderReadingDirection { get; set; }
/// <summary>
/// UI Site Global Setting: The UI theme the user should use.
/// </summary>
/// <remarks>Should default to Dark</remarks>
[Required]
public SiteTheme Theme { get; set; }
[Required]
public string BookReaderThemeName { get; set; }
[Required]
public BookPageLayoutMode BookReaderLayoutMode { get; set; }
/// <summary>
/// Book Reader Option: A flag that hides the menu-ing system behind a click on the screen. This should be used with tap to paginate, but the app doesn't enforce this.
/// </summary>
/// <remarks>Defaults to false</remarks>
[Required]
public bool BookReaderImmersiveMode { get; set; } = false;
/// <summary>
/// Global Site Option: If the UI should layout items as Cards or List items
/// </summary>
/// <remarks>Defaults to Cards</remarks>
[Required]
public PageLayoutMode GlobalPageLayoutMode { get; set; } = PageLayoutMode.Cards;
/// <summary>
/// UI Site Global Setting: If unread summaries should be blurred until expanded or unless user has read it already
/// </summary>
/// <remarks>Defaults to false</remarks>
[Required]
public bool BlurUnreadSummaries { get; set; } = false;
/// <summary>
/// UI Site Global Setting: Should Kavita prompt user to confirm downloads that are greater than 100 MB.
/// </summary>
[Required]
public bool PromptForDownloadSize { get; set; } = true;
}
/// <summary>
/// Manga Reader Option: What direction should the next/prev page buttons go
/// </summary>
[Required]
public ReadingDirection ReadingDirection { get; set; }
/// <summary>
/// Manga Reader Option: How should the image be scaled to screen
/// </summary>
[Required]
public ScalingOption ScalingOption { get; set; }
/// <summary>
/// Manga Reader Option: Which side of a split image should we show first
/// </summary>
[Required]
public PageSplitOption PageSplitOption { get; set; }
/// <summary>
/// Manga Reader Option: How the manga reader should perform paging or reading of the file
/// <example>
/// Webtoon uses scrolling to page, LeftRight uses paging by clicking left/right side of reader, UpDown uses paging
/// by clicking top/bottom sides of reader.
/// </example>
/// </summary>
[Required]
public ReaderMode ReaderMode { get; set; }
/// <summary>
/// Manga Reader Option: How many pages to display in the reader at once
/// </summary>
[Required]
public LayoutMode LayoutMode { get; set; }
/// <summary>
/// Manga Reader Option: Background color of the reader
/// </summary>
[Required]
public string BackgroundColor { get; set; } = "#000000";
/// <summary>
/// Manga Reader Option: Allow the menu to close after 6 seconds without interaction
/// </summary>
[Required]
public bool AutoCloseMenu { get; set; }
/// <summary>
/// Manga Reader Option: Show screen hints to the user on some actions, ie) pagination direction change
/// </summary>
[Required]
public bool ShowScreenHints { get; set; } = true;
/// <summary>
/// Book Reader Option: Override extra Margin
/// </summary>
[Required]
public int BookReaderMargin { get; set; }
/// <summary>
/// Book Reader Option: Override line-height
/// </summary>
[Required]
public int BookReaderLineSpacing { get; set; }
/// <summary>
/// Book Reader Option: Override font size
/// </summary>
[Required]
public int BookReaderFontSize { get; set; }
/// <summary>
/// Book Reader Option: Maps to the default Kavita font-family (inherit) or an override
/// </summary>
[Required]
public string BookReaderFontFamily { get; set; }
/// <summary>
/// Book Reader Option: Allows tapping on side of screens to paginate
/// </summary>
[Required]
public bool BookReaderTapToPaginate { get; set; }
/// <summary>
/// Book Reader Option: What direction should the next/prev page buttons go
/// </summary>
[Required]
public ReadingDirection BookReaderReadingDirection { get; set; }
/// <summary>
/// UI Site Global Setting: The UI theme the user should use.
/// </summary>
/// <remarks>Should default to Dark</remarks>
[Required]
public SiteTheme Theme { get; set; }
[Required]
public string BookReaderThemeName { get; set; }
[Required]
public BookPageLayoutMode BookReaderLayoutMode { get; set; }
/// <summary>
/// Book Reader Option: A flag that hides the menu-ing system behind a click on the screen. This should be used with tap to paginate, but the app doesn't enforce this.
/// </summary>
/// <remarks>Defaults to false</remarks>
[Required]
public bool BookReaderImmersiveMode { get; set; } = false;
/// <summary>
/// Global Site Option: If the UI should layout items as Cards or List items
/// </summary>
/// <remarks>Defaults to Cards</remarks>
[Required]
public PageLayoutMode GlobalPageLayoutMode { get; set; } = PageLayoutMode.Cards;
/// <summary>
/// UI Site Global Setting: If unread summaries should be blurred until expanded or unless user has read it already
/// </summary>
/// <remarks>Defaults to false</remarks>
[Required]
public bool BlurUnreadSummaries { get; set; } = false;
/// <summary>
/// UI Site Global Setting: Should Kavita prompt user to confirm downloads that are greater than 100 MB.
/// </summary>
[Required]
public bool PromptForDownloadSize { get; set; } = true;
}

View file

@ -4,26 +4,25 @@ using System.Collections.Generic;
using API.Entities;
using API.Entities.Interfaces;
namespace API.DTOs
namespace API.DTOs;
public class VolumeDto : IHasReadTimeEstimate
{
public class VolumeDto : IHasReadTimeEstimate
{
public int Id { get; set; }
/// <inheritdoc cref="Volume.Number"/>
public int Number { get; set; }
/// <inheritdoc cref="Volume.Name"/>
public string Name { get; set; }
public int Pages { get; set; }
public int PagesRead { get; set; }
public DateTime LastModified { get; set; }
public DateTime Created { get; set; }
public int SeriesId { get; set; }
public ICollection<ChapterDto> Chapters { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
}
public int Id { get; set; }
/// <inheritdoc cref="Volume.Number"/>
public int Number { get; set; }
/// <inheritdoc cref="Volume.Name"/>
public string Name { get; set; }
public int Pages { get; set; }
public int PagesRead { get; set; }
public DateTime LastModified { get; set; }
public DateTime Created { get; set; }
public int SeriesId { get; set; }
public ICollection<ChapterDto> Chapters { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MinHoursToRead"/>
public int MinHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.MaxHoursToRead"/>
public int MaxHoursToRead { get; set; }
/// <inheritdoc cref="IHasReadTimeEstimate.AvgHoursToRead"/>
public int AvgHoursToRead { get; set; }
}