diff --git a/API/DTOs/Account/AgeRestrictionDto.cs b/API/DTOs/Account/AgeRestrictionDto.cs
index 0aaec9b97..6505bdbff 100644
--- a/API/DTOs/Account/AgeRestrictionDto.cs
+++ b/API/DTOs/Account/AgeRestrictionDto.cs
@@ -2,15 +2,15 @@
namespace API.DTOs.Account;
-public class AgeRestrictionDto
+public sealed record AgeRestrictionDto
{
///
/// The maximum age rating a user has access to. -1 if not applicable
///
- public required AgeRating AgeRating { get; set; } = AgeRating.NotApplicable;
+ public required AgeRating AgeRating { get; init; } = AgeRating.NotApplicable;
///
/// Are Unknowns explicitly allowed against age rating
///
/// Unknown is always lowest and default age rating. Setting this to false will ensure Teen age rating applies and unknowns are still filtered
- public required bool IncludeUnknowns { get; set; } = false;
+ public required bool IncludeUnknowns { get; init; } = false;
}
diff --git a/API/DTOs/Account/ConfirmEmailDto.cs b/API/DTOs/Account/ConfirmEmailDto.cs
index 2f5849e74..413f9f34a 100644
--- a/API/DTOs/Account/ConfirmEmailDto.cs
+++ b/API/DTOs/Account/ConfirmEmailDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Account;
-public class ConfirmEmailDto
+public sealed record ConfirmEmailDto
{
[Required]
public string Email { get; set; } = default!;
diff --git a/API/DTOs/Account/ConfirmEmailUpdateDto.cs b/API/DTOs/Account/ConfirmEmailUpdateDto.cs
index 42abb1295..2a0738e35 100644
--- a/API/DTOs/Account/ConfirmEmailUpdateDto.cs
+++ b/API/DTOs/Account/ConfirmEmailUpdateDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Account;
-public class ConfirmEmailUpdateDto
+public sealed record ConfirmEmailUpdateDto
{
[Required]
public string Email { get; set; } = default!;
diff --git a/API/DTOs/Account/ConfirmMigrationEmailDto.cs b/API/DTOs/Account/ConfirmMigrationEmailDto.cs
index efb42b8fd..cdfc1505c 100644
--- a/API/DTOs/Account/ConfirmMigrationEmailDto.cs
+++ b/API/DTOs/Account/ConfirmMigrationEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Account;
-public class ConfirmMigrationEmailDto
+public sealed record ConfirmMigrationEmailDto
{
public string Email { get; set; } = default!;
public string Token { get; set; } = default!;
diff --git a/API/DTOs/Account/ConfirmPasswordResetDto.cs b/API/DTOs/Account/ConfirmPasswordResetDto.cs
index 16dd86f9a..00aff301b 100644
--- a/API/DTOs/Account/ConfirmPasswordResetDto.cs
+++ b/API/DTOs/Account/ConfirmPasswordResetDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Account;
-public class ConfirmPasswordResetDto
+public sealed record ConfirmPasswordResetDto
{
[Required]
public string Email { get; set; } = default!;
diff --git a/API/DTOs/Account/InviteUserDto.cs b/API/DTOs/Account/InviteUserDto.cs
index 112013053..c12bebc2b 100644
--- a/API/DTOs/Account/InviteUserDto.cs
+++ b/API/DTOs/Account/InviteUserDto.cs
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
-public class InviteUserDto
+public sealed record InviteUserDto
{
[Required]
public string Email { get; set; } = default!;
diff --git a/API/DTOs/Account/InviteUserResponse.cs b/API/DTOs/Account/InviteUserResponse.cs
index a7e0d86ea..ed16bd05e 100644
--- a/API/DTOs/Account/InviteUserResponse.cs
+++ b/API/DTOs/Account/InviteUserResponse.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Account;
-public class InviteUserResponse
+public sealed record InviteUserResponse
{
///
/// Email link used to setup the user account
diff --git a/API/DTOs/Account/LoginDto.cs b/API/DTOs/Account/LoginDto.cs
index fe8fce088..97338640b 100644
--- a/API/DTOs/Account/LoginDto.cs
+++ b/API/DTOs/Account/LoginDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.Account;
#nullable enable
-public class LoginDto
+public sealed record LoginDto
{
public string Username { get; init; } = default!;
public string Password { get; set; } = default!;
diff --git a/API/DTOs/Account/MigrateUserEmailDto.cs b/API/DTOs/Account/MigrateUserEmailDto.cs
index 60d042165..4630c510f 100644
--- a/API/DTOs/Account/MigrateUserEmailDto.cs
+++ b/API/DTOs/Account/MigrateUserEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Account;
-public class MigrateUserEmailDto
+public sealed record MigrateUserEmailDto
{
public string Email { get; set; } = default!;
public string Username { get; set; } = default!;
diff --git a/API/DTOs/Account/ResetPasswordDto.cs b/API/DTOs/Account/ResetPasswordDto.cs
index 51a195131..545ca5ba6 100644
--- a/API/DTOs/Account/ResetPasswordDto.cs
+++ b/API/DTOs/Account/ResetPasswordDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Account;
-public class ResetPasswordDto
+public sealed record ResetPasswordDto
{
///
/// The Username of the User
diff --git a/API/DTOs/Account/TokenRequestDto.cs b/API/DTOs/Account/TokenRequestDto.cs
index 85ab9f87a..5c798721c 100644
--- a/API/DTOs/Account/TokenRequestDto.cs
+++ b/API/DTOs/Account/TokenRequestDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Account;
-public class TokenRequestDto
+public sealed record TokenRequestDto
{
public string Token { get; init; } = default!;
public string RefreshToken { get; init; } = default!;
diff --git a/API/DTOs/Account/UpdateAgeRestrictionDto.cs b/API/DTOs/Account/UpdateAgeRestrictionDto.cs
index ef6be1bba..2fa9c89d2 100644
--- a/API/DTOs/Account/UpdateAgeRestrictionDto.cs
+++ b/API/DTOs/Account/UpdateAgeRestrictionDto.cs
@@ -3,7 +3,7 @@ using API.Entities.Enums;
namespace API.DTOs.Account;
-public class UpdateAgeRestrictionDto
+public sealed record UpdateAgeRestrictionDto
{
[Required]
public AgeRating AgeRating { get; set; }
diff --git a/API/DTOs/Account/UpdateEmailDto.cs b/API/DTOs/Account/UpdateEmailDto.cs
index eac06be53..873862ba1 100644
--- a/API/DTOs/Account/UpdateEmailDto.cs
+++ b/API/DTOs/Account/UpdateEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Account;
-public class UpdateEmailDto
+public sealed record UpdateEmailDto
{
public string Email { get; set; } = default!;
public string Password { get; set; } = default!;
diff --git a/API/DTOs/Account/UpdateUserDto.cs b/API/DTOs/Account/UpdateUserDto.cs
index c40124b7b..71e2d6af4 100644
--- a/API/DTOs/Account/UpdateUserDto.cs
+++ b/API/DTOs/Account/UpdateUserDto.cs
@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Account;
#nullable enable
-public record UpdateUserDto
+public sealed record UpdateUserDto
{
public int UserId { get; set; }
public string Username { get; set; } = default!;
diff --git a/API/DTOs/BulkActionDto.cs b/API/DTOs/BulkActionDto.cs
index d3ce75293..c26a73e9c 100644
--- a/API/DTOs/BulkActionDto.cs
+++ b/API/DTOs/BulkActionDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs;
-public class BulkActionDto
+public sealed record BulkActionDto
{
public List Ids { get; set; }
/**
diff --git a/API/DTOs/ChapterDetailPlusDto.cs b/API/DTOs/ChapterDetailPlusDto.cs
index 9f9cfb8ab..d99482e55 100644
--- a/API/DTOs/ChapterDetailPlusDto.cs
+++ b/API/DTOs/ChapterDetailPlusDto.cs
@@ -4,7 +4,7 @@ using API.DTOs.SeriesDetail;
namespace API.DTOs;
-public class ChapterDetailPlusDto
+public sealed record ChapterDetailPlusDto
{
public float Rating { get; set; }
public bool HasBeenRated { get; set; }
diff --git a/API/DTOs/Collection/AppUserCollectionDto.cs b/API/DTOs/Collection/AppUserCollectionDto.cs
index ecfb5c062..0634b5d83 100644
--- a/API/DTOs/Collection/AppUserCollectionDto.cs
+++ b/API/DTOs/Collection/AppUserCollectionDto.cs
@@ -6,52 +6,52 @@ using API.Services.Plus;
namespace API.DTOs.Collection;
#nullable enable
-public class AppUserCollectionDto : IHasCoverImage
+public sealed record AppUserCollectionDto : IHasCoverImage
{
public int Id { get; init; }
- public string Title { get; set; } = default!;
- public string? Summary { get; set; } = default!;
- public bool Promoted { get; set; }
- public AgeRating AgeRating { get; set; }
+ public string Title { get; init; } = default!;
+ public string? Summary { get; init; } = default!;
+ public bool Promoted { get; init; }
+ public AgeRating AgeRating { get; init; }
///
/// 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.
///
public string? CoverImage { get; set; } = string.Empty;
- public string PrimaryColor { get; set; } = string.Empty;
- public string SecondaryColor { get; set; } = string.Empty;
- public bool CoverImageLocked { get; set; }
+ public string? PrimaryColor { get; set; } = string.Empty;
+ public string? SecondaryColor { get; set; } = string.Empty;
+ public bool CoverImageLocked { get; init; }
///
/// Number of Series in the Collection
///
- public int ItemCount { get; set; }
+ public int ItemCount { get; init; }
///
/// Owner of the Collection
///
- public string? Owner { get; set; }
+ public string? Owner { get; init; }
///
/// Last time Kavita Synced the Collection with an upstream source (for non Kavita sourced collections)
///
- public DateTime LastSyncUtc { get; set; }
+ public DateTime LastSyncUtc { get; init; }
///
/// Who created/manages the list. Non-Kavita lists are not editable by the user, except to promote
///
- public ScrobbleProvider Source { get; set; } = ScrobbleProvider.Kavita;
+ public ScrobbleProvider Source { get; init; } = ScrobbleProvider.Kavita;
///
/// For Non-Kavita sourced collections, the url to sync from
///
- public string? SourceUrl { get; set; }
+ public string? SourceUrl { get; init; }
///
/// Total number of items as of the last sync. Not applicable for Kavita managed collections.
///
- public int TotalSourceCount { get; set; }
+ public int TotalSourceCount { get; init; }
///
/// A
separated string of all missing series
///
- public string? MissingSeriesFromSource { get; set; }
+ public string? MissingSeriesFromSource { get; init; }
public void ResetColorScape()
{
diff --git a/API/DTOs/CollectionTags/CollectionTagBulkAddDto.cs b/API/DTOs/CollectionTags/CollectionTagBulkAddDto.cs
index 1d078959d..0a2270fbf 100644
--- a/API/DTOs/CollectionTags/CollectionTagBulkAddDto.cs
+++ b/API/DTOs/CollectionTags/CollectionTagBulkAddDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.CollectionTags;
-public class CollectionTagBulkAddDto
+public sealed record CollectionTagBulkAddDto
{
///
/// Collection Tag Id
diff --git a/API/DTOs/CollectionTags/CollectionTagDto.cs b/API/DTOs/CollectionTags/CollectionTagDto.cs
index ec9939ebd..dccaebdb7 100644
--- a/API/DTOs/CollectionTags/CollectionTagDto.cs
+++ b/API/DTOs/CollectionTags/CollectionTagDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.CollectionTags;
[Obsolete("Use AppUserCollectionDto")]
-public class CollectionTagDto
+public sealed record CollectionTagDto
{
public int Id { get; set; }
public string Title { get; set; } = default!;
diff --git a/API/DTOs/CollectionTags/UpdateSeriesForTagDto.cs b/API/DTOs/CollectionTags/UpdateSeriesForTagDto.cs
index 19e9a11e2..139834a60 100644
--- a/API/DTOs/CollectionTags/UpdateSeriesForTagDto.cs
+++ b/API/DTOs/CollectionTags/UpdateSeriesForTagDto.cs
@@ -4,7 +4,7 @@ using API.DTOs.Collection;
namespace API.DTOs.CollectionTags;
-public class UpdateSeriesForTagDto
+public sealed record UpdateSeriesForTagDto
{
public AppUserCollectionDto Tag { get; init; } = default!;
public IEnumerable SeriesIdsToRemove { get; init; } = default!;
diff --git a/API/DTOs/ColorScape.cs b/API/DTOs/ColorScape.cs
index d95346af7..5351f2351 100644
--- a/API/DTOs/ColorScape.cs
+++ b/API/DTOs/ColorScape.cs
@@ -4,7 +4,7 @@
///
/// A primary and secondary color
///
-public class ColorScape
+public sealed record ColorScape
{
public required string? Primary { get; set; }
public required string? Secondary { get; set; }
diff --git a/API/DTOs/CopySettingsFromLibraryDto.cs b/API/DTOs/CopySettingsFromLibraryDto.cs
index ee75f7422..5ca5ead51 100644
--- a/API/DTOs/CopySettingsFromLibraryDto.cs
+++ b/API/DTOs/CopySettingsFromLibraryDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs;
-public class CopySettingsFromLibraryDto
+public sealed record CopySettingsFromLibraryDto
{
public int SourceLibraryId { get; set; }
public List TargetLibraryIds { get; set; }
diff --git a/API/DTOs/CoverDb/CoverDbAuthor.cs b/API/DTOs/CoverDb/CoverDbAuthor.cs
index 2f023398a..ca924801f 100644
--- a/API/DTOs/CoverDb/CoverDbAuthor.cs
+++ b/API/DTOs/CoverDb/CoverDbAuthor.cs
@@ -3,7 +3,7 @@ using YamlDotNet.Serialization;
namespace API.DTOs.CoverDb;
-public class CoverDbAuthor
+public sealed record CoverDbAuthor
{
[YamlMember(Alias = "name", ApplyNamingConventions = false)]
public string Name { get; set; }
diff --git a/API/DTOs/CoverDb/CoverDbPeople.cs b/API/DTOs/CoverDb/CoverDbPeople.cs
index c0f5e327e..2e825eac7 100644
--- a/API/DTOs/CoverDb/CoverDbPeople.cs
+++ b/API/DTOs/CoverDb/CoverDbPeople.cs
@@ -3,7 +3,7 @@ using YamlDotNet.Serialization;
namespace API.DTOs.CoverDb;
-public class CoverDbPeople
+public sealed record CoverDbPeople
{
[YamlMember(Alias = "people", ApplyNamingConventions = false)]
public List People { get; set; } = new List();
diff --git a/API/DTOs/CoverDb/CoverDbPersonIds.cs b/API/DTOs/CoverDb/CoverDbPersonIds.cs
index 9c59415e6..5816bb479 100644
--- a/API/DTOs/CoverDb/CoverDbPersonIds.cs
+++ b/API/DTOs/CoverDb/CoverDbPersonIds.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.CoverDb;
#nullable enable
-public class CoverDbPersonIds
+public sealed record CoverDbPersonIds
{
[YamlMember(Alias = "hardcover_id", ApplyNamingConventions = false)]
public string? HardcoverId { get; set; } = null;
diff --git a/API/DTOs/Dashboard/DashboardStreamDto.cs b/API/DTOs/Dashboard/DashboardStreamDto.cs
index 59e5f4f7d..297a706b1 100644
--- a/API/DTOs/Dashboard/DashboardStreamDto.cs
+++ b/API/DTOs/Dashboard/DashboardStreamDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.Dashboard;
-public class DashboardStreamDto
+public sealed record DashboardStreamDto
{
public int Id { get; set; }
public required string Name { get; set; }
diff --git a/API/DTOs/Dashboard/GroupedSeriesDto.cs b/API/DTOs/Dashboard/GroupedSeriesDto.cs
index 3b283de34..940e42c40 100644
--- a/API/DTOs/Dashboard/GroupedSeriesDto.cs
+++ b/API/DTOs/Dashboard/GroupedSeriesDto.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.Dashboard;
///
/// This is a representation of a Series with some amount of underlying files within it. This is used for Recently Updated Series section
///
-public class GroupedSeriesDto
+public sealed record GroupedSeriesDto
{
public string SeriesName { get; set; } = default!;
public int SeriesId { get; set; }
diff --git a/API/DTOs/Dashboard/RecentlyAddedItemDto.cs b/API/DTOs/Dashboard/RecentlyAddedItemDto.cs
index 2e5658e2e..bb0360b30 100644
--- a/API/DTOs/Dashboard/RecentlyAddedItemDto.cs
+++ b/API/DTOs/Dashboard/RecentlyAddedItemDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Dashboard;
///
/// A mesh of data for Recently added volume/chapters
///
-public class RecentlyAddedItemDto
+public sealed record RecentlyAddedItemDto
{
public string SeriesName { get; set; } = default!;
public int SeriesId { get; set; }
diff --git a/API/DTOs/Dashboard/SmartFilterDto.cs b/API/DTOs/Dashboard/SmartFilterDto.cs
index b23a74c69..c1bc4d7e1 100644
--- a/API/DTOs/Dashboard/SmartFilterDto.cs
+++ b/API/DTOs/Dashboard/SmartFilterDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Dashboard;
-public class SmartFilterDto
+public sealed record SmartFilterDto
{
public int Id { get; set; }
public required string Name { get; set; }
diff --git a/API/DTOs/Dashboard/UpdateDashboardStreamPositionDto.cs b/API/DTOs/Dashboard/UpdateDashboardStreamPositionDto.cs
index c2320f1a9..476a0732e 100644
--- a/API/DTOs/Dashboard/UpdateDashboardStreamPositionDto.cs
+++ b/API/DTOs/Dashboard/UpdateDashboardStreamPositionDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Dashboard;
-public class UpdateDashboardStreamPositionDto
+public sealed record UpdateDashboardStreamPositionDto
{
public int FromPosition { get; set; }
public int ToPosition { get; set; }
diff --git a/API/DTOs/Dashboard/UpdateStreamPositionDto.cs b/API/DTOs/Dashboard/UpdateStreamPositionDto.cs
index f9005a585..8de0ffa6f 100644
--- a/API/DTOs/Dashboard/UpdateStreamPositionDto.cs
+++ b/API/DTOs/Dashboard/UpdateStreamPositionDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Dashboard;
-public class UpdateStreamPositionDto
+public sealed record UpdateStreamPositionDto
{
public int FromPosition { get; set; }
public int ToPosition { get; set; }
diff --git a/API/DTOs/DeleteChaptersDto.cs b/API/DTOs/DeleteChaptersDto.cs
index cbd21df36..9fad2f1fb 100644
--- a/API/DTOs/DeleteChaptersDto.cs
+++ b/API/DTOs/DeleteChaptersDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs;
-public class DeleteChaptersDto
+public sealed record DeleteChaptersDto
{
public IList ChapterIds { get; set; } = default!;
}
diff --git a/API/DTOs/DeleteSeriesDto.cs b/API/DTOs/DeleteSeriesDto.cs
index 12687fc25..ec9ba0c68 100644
--- a/API/DTOs/DeleteSeriesDto.cs
+++ b/API/DTOs/DeleteSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs;
-public class DeleteSeriesDto
+public sealed record DeleteSeriesDto
{
public IList SeriesIds { get; set; } = default!;
}
diff --git a/API/DTOs/Device/CreateDeviceDto.cs b/API/DTOs/Device/CreateDeviceDto.cs
index 7e59483fa..a8fdb6bc9 100644
--- a/API/DTOs/Device/CreateDeviceDto.cs
+++ b/API/DTOs/Device/CreateDeviceDto.cs
@@ -3,7 +3,7 @@ using API.Entities.Enums.Device;
namespace API.DTOs.Device;
-public class CreateDeviceDto
+public sealed record CreateDeviceDto
{
[Required]
public string Name { get; set; } = default!;
diff --git a/API/DTOs/Device/DeviceDto.cs b/API/DTOs/Device/DeviceDto.cs
index b2e83e6fc..42140dcc1 100644
--- a/API/DTOs/Device/DeviceDto.cs
+++ b/API/DTOs/Device/DeviceDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Device;
///
/// A Device is an entity that can receive data from Kavita (kindle)
///
-public class DeviceDto
+public sealed record DeviceDto
{
///
/// The device Id
diff --git a/API/DTOs/Device/SendSeriesToDeviceDto.cs b/API/DTOs/Device/SendSeriesToDeviceDto.cs
index a0a907464..58ce2293b 100644
--- a/API/DTOs/Device/SendSeriesToDeviceDto.cs
+++ b/API/DTOs/Device/SendSeriesToDeviceDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Device;
-public class SendSeriesToDeviceDto
+public sealed record SendSeriesToDeviceDto
{
public int DeviceId { get; set; }
public int SeriesId { get; set; }
diff --git a/API/DTOs/Device/SendToDeviceDto.cs b/API/DTOs/Device/SendToDeviceDto.cs
index fd88eaf59..a7a4dc0ff 100644
--- a/API/DTOs/Device/SendToDeviceDto.cs
+++ b/API/DTOs/Device/SendToDeviceDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Device;
-public class SendToDeviceDto
+public sealed record SendToDeviceDto
{
public int DeviceId { get; set; }
public IReadOnlyList ChapterIds { get; set; } = default!;
diff --git a/API/DTOs/Device/UpdateDeviceDto.cs b/API/DTOs/Device/UpdateDeviceDto.cs
index d28d372c3..2c3e72ea1 100644
--- a/API/DTOs/Device/UpdateDeviceDto.cs
+++ b/API/DTOs/Device/UpdateDeviceDto.cs
@@ -3,7 +3,7 @@ using API.Entities.Enums.Device;
namespace API.DTOs.Device;
-public class UpdateDeviceDto
+public sealed record UpdateDeviceDto
{
[Required]
public int Id { get; set; }
diff --git a/API/DTOs/Downloads/DownloadBookmarkDto.cs b/API/DTOs/Downloads/DownloadBookmarkDto.cs
index 5b7240b68..00f763dac 100644
--- a/API/DTOs/Downloads/DownloadBookmarkDto.cs
+++ b/API/DTOs/Downloads/DownloadBookmarkDto.cs
@@ -4,7 +4,7 @@ using API.DTOs.Reader;
namespace API.DTOs.Downloads;
-public class DownloadBookmarkDto
+public sealed record DownloadBookmarkDto
{
[Required]
public IEnumerable Bookmarks { get; set; } = default!;
diff --git a/API/DTOs/Email/ConfirmationEmailDto.cs b/API/DTOs/Email/ConfirmationEmailDto.cs
index 1a48c9974..197395794 100644
--- a/API/DTOs/Email/ConfirmationEmailDto.cs
+++ b/API/DTOs/Email/ConfirmationEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Email;
-public class ConfirmationEmailDto
+public sealed record ConfirmationEmailDto
{
public string InvitingUser { get; init; } = default!;
public string EmailAddress { get; init; } = default!;
diff --git a/API/DTOs/Email/EmailHistoryDto.cs b/API/DTOs/Email/EmailHistoryDto.cs
index ca3549550..c2968d091 100644
--- a/API/DTOs/Email/EmailHistoryDto.cs
+++ b/API/DTOs/Email/EmailHistoryDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Email;
-public class EmailHistoryDto
+public sealed record EmailHistoryDto
{
public long Id { get; set; }
public bool Sent { get; set; }
diff --git a/API/DTOs/Email/EmailMigrationDto.cs b/API/DTOs/Email/EmailMigrationDto.cs
index f051e7337..5354afdaa 100644
--- a/API/DTOs/Email/EmailMigrationDto.cs
+++ b/API/DTOs/Email/EmailMigrationDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Email;
-public class EmailMigrationDto
+public sealed record EmailMigrationDto
{
public string EmailAddress { get; init; } = default!;
public string Username { get; init; } = default!;
diff --git a/API/DTOs/Email/EmailTestResultDto.cs b/API/DTOs/Email/EmailTestResultDto.cs
index 263e725c4..9be868eab 100644
--- a/API/DTOs/Email/EmailTestResultDto.cs
+++ b/API/DTOs/Email/EmailTestResultDto.cs
@@ -3,7 +3,7 @@
///
/// Represents if Test Email Service URL was successful or not and if any error occured
///
-public class EmailTestResultDto
+public sealed record EmailTestResultDto
{
public bool Successful { get; set; }
public string ErrorMessage { get; set; } = default!;
diff --git a/API/DTOs/Email/PasswordResetEmailDto.cs b/API/DTOs/Email/PasswordResetEmailDto.cs
index 06abba171..9fda066a9 100644
--- a/API/DTOs/Email/PasswordResetEmailDto.cs
+++ b/API/DTOs/Email/PasswordResetEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Email;
-public class PasswordResetEmailDto
+public sealed record PasswordResetEmailDto
{
public string EmailAddress { get; init; } = default!;
public string ServerConfirmationLink { get; init; } = default!;
diff --git a/API/DTOs/Email/SendToDto.cs b/API/DTOs/Email/SendToDto.cs
index 1261d110c..eacd29449 100644
--- a/API/DTOs/Email/SendToDto.cs
+++ b/API/DTOs/Email/SendToDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Email;
-public class SendToDto
+public sealed record SendToDto
{
public string DestinationEmail { get; set; } = default!;
public IEnumerable FilePaths { get; set; } = default!;
diff --git a/API/DTOs/Email/TestEmailDto.cs b/API/DTOs/Email/TestEmailDto.cs
index 37c12ed30..44c11bd6c 100644
--- a/API/DTOs/Email/TestEmailDto.cs
+++ b/API/DTOs/Email/TestEmailDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Email;
-public class TestEmailDto
+public sealed record TestEmailDto
{
public string Url { get; set; } = default!;
}
diff --git a/API/DTOs/Filtering/FilterDto.cs b/API/DTOs/Filtering/FilterDto.cs
index 9205a7bba..cb3374838 100644
--- a/API/DTOs/Filtering/FilterDto.cs
+++ b/API/DTOs/Filtering/FilterDto.cs
@@ -5,7 +5,7 @@ using API.Entities.Enums;
namespace API.DTOs.Filtering;
#nullable enable
-public class FilterDto
+public sealed record FilterDto
{
///
/// The type of Formats you want to be returned. An empty list will return all formats back
diff --git a/API/DTOs/Filtering/LanguageDto.cs b/API/DTOs/Filtering/LanguageDto.cs
index bc7ebb5cc..dde85f07e 100644
--- a/API/DTOs/Filtering/LanguageDto.cs
+++ b/API/DTOs/Filtering/LanguageDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Filtering;
-public class LanguageDto
+public sealed record LanguageDto
{
public required string IsoCode { get; set; }
public required string Title { get; set; }
diff --git a/API/DTOs/Filtering/Range.cs b/API/DTOs/Filtering/Range.cs
index a75164fa3..e697f26e1 100644
--- a/API/DTOs/Filtering/Range.cs
+++ b/API/DTOs/Filtering/Range.cs
@@ -4,7 +4,7 @@
///
/// Represents a range between two int/float/double
///
-public class Range
+public sealed record Range
{
public T? Min { get; init; }
public T? Max { get; init; }
diff --git a/API/DTOs/Filtering/ReadStatus.cs b/API/DTOs/Filtering/ReadStatus.cs
index eeb786714..81498ecb5 100644
--- a/API/DTOs/Filtering/ReadStatus.cs
+++ b/API/DTOs/Filtering/ReadStatus.cs
@@ -3,7 +3,7 @@
///
/// Represents the Reading Status. This is a flag and allows multiple statues
///
-public class ReadStatus
+public sealed record ReadStatus
{
public bool NotRead { get; set; } = true;
public bool InProgress { get; set; } = true;
diff --git a/API/DTOs/Filtering/SortOptions.cs b/API/DTOs/Filtering/SortOptions.cs
index 00bf91675..a08e2968e 100644
--- a/API/DTOs/Filtering/SortOptions.cs
+++ b/API/DTOs/Filtering/SortOptions.cs
@@ -3,7 +3,7 @@
///
/// Sorting Options for a query
///
-public class SortOptions
+public sealed record SortOptions
{
public SortField SortField { get; set; }
public bool IsAscending { get; set; } = true;
diff --git a/API/DTOs/Filtering/v2/DecodeFilterDto.cs b/API/DTOs/Filtering/v2/DecodeFilterDto.cs
index 18dc166e7..db4c7ecce 100644
--- a/API/DTOs/Filtering/v2/DecodeFilterDto.cs
+++ b/API/DTOs/Filtering/v2/DecodeFilterDto.cs
@@ -3,7 +3,7 @@
///
/// For requesting an encoded filter to be decoded
///
-public class DecodeFilterDto
+public sealed record DecodeFilterDto
{
public string EncodedFilter { get; set; }
}
diff --git a/API/DTOs/Filtering/v2/FilterStatementDto.cs b/API/DTOs/Filtering/v2/FilterStatementDto.cs
index a6192093e..ebe6d16af 100644
--- a/API/DTOs/Filtering/v2/FilterStatementDto.cs
+++ b/API/DTOs/Filtering/v2/FilterStatementDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Filtering.v2;
-public class FilterStatementDto
+public sealed record FilterStatementDto
{
public FilterComparison Comparison { get; set; }
public FilterField Field { get; set; }
diff --git a/API/DTOs/Filtering/v2/FilterV2Dto.cs b/API/DTOs/Filtering/v2/FilterV2Dto.cs
index 5bc50ff2f..11dc42a6b 100644
--- a/API/DTOs/Filtering/v2/FilterV2Dto.cs
+++ b/API/DTOs/Filtering/v2/FilterV2Dto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Filtering.v2;
///
/// Metadata filtering for v2 API only
///
-public class FilterV2Dto
+public sealed record FilterV2Dto
{
///
/// Not used in the UI.
diff --git a/API/DTOs/Jobs/JobDto.cs b/API/DTOs/Jobs/JobDto.cs
index 648765a34..55419811f 100644
--- a/API/DTOs/Jobs/JobDto.cs
+++ b/API/DTOs/Jobs/JobDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Jobs;
-public class JobDto
+public sealed record JobDto
{
///
/// Job Id
diff --git a/API/DTOs/JumpBar/JumpKeyDto.cs b/API/DTOs/JumpBar/JumpKeyDto.cs
index 5a98a85ca..8dc5b4a8e 100644
--- a/API/DTOs/JumpBar/JumpKeyDto.cs
+++ b/API/DTOs/JumpBar/JumpKeyDto.cs
@@ -3,7 +3,7 @@
///
/// Represents an individual button in a Jump Bar
///
-public class JumpKeyDto
+public sealed record JumpKeyDto
{
///
/// Number of items in this Key
diff --git a/API/DTOs/KavitaLocale.cs b/API/DTOs/KavitaLocale.cs
index decfb7395..51868605f 100644
--- a/API/DTOs/KavitaLocale.cs
+++ b/API/DTOs/KavitaLocale.cs
@@ -1,6 +1,6 @@
namespace API.DTOs;
-public class KavitaLocale
+public sealed record KavitaLocale
{
public string FileName { get; set; } // Key
public string RenderName { get; set; }
diff --git a/API/DTOs/KavitaPlus/Account/AniListUpdateDto.cs b/API/DTOs/KavitaPlus/Account/AniListUpdateDto.cs
index c6d2e07cc..c053bd34e 100644
--- a/API/DTOs/KavitaPlus/Account/AniListUpdateDto.cs
+++ b/API/DTOs/KavitaPlus/Account/AniListUpdateDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.Account;
-public class AniListUpdateDto
+public sealed record AniListUpdateDto
{
public string Token { get; set; }
}
diff --git a/API/DTOs/KavitaPlus/Account/UserTokenInfo.cs b/API/DTOs/KavitaPlus/Account/UserTokenInfo.cs
index 220bd9e7e..340ad0f4c 100644
--- a/API/DTOs/KavitaPlus/Account/UserTokenInfo.cs
+++ b/API/DTOs/KavitaPlus/Account/UserTokenInfo.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.KavitaPlus.Account;
///
/// Represents information around a user's tokens and their status
///
-public class UserTokenInfo
+public sealed record UserTokenInfo
{
public int UserId { get; set; }
public string Username { get; set; }
diff --git a/API/DTOs/KavitaPlus/ExternalMetadata/ExternalMetadataIdsDto.cs b/API/DTOs/KavitaPlus/ExternalMetadata/ExternalMetadataIdsDto.cs
index 547bb63a8..2b7dea8e6 100644
--- a/API/DTOs/KavitaPlus/ExternalMetadata/ExternalMetadataIdsDto.cs
+++ b/API/DTOs/KavitaPlus/ExternalMetadata/ExternalMetadataIdsDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.KavitaPlus.ExternalMetadata;
///
/// Used for matching and fetching metadata on a series
///
-internal class ExternalMetadataIdsDto
+internal sealed record ExternalMetadataIdsDto
{
public long? MalId { get; set; }
public int? AniListId { get; set; }
diff --git a/API/DTOs/KavitaPlus/ExternalMetadata/MatchSeriesRequestDto.cs b/API/DTOs/KavitaPlus/ExternalMetadata/MatchSeriesRequestDto.cs
index f63fe5a9e..6cd911700 100644
--- a/API/DTOs/KavitaPlus/ExternalMetadata/MatchSeriesRequestDto.cs
+++ b/API/DTOs/KavitaPlus/ExternalMetadata/MatchSeriesRequestDto.cs
@@ -4,7 +4,7 @@ using API.DTOs.Scrobbling;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
#nullable enable
-internal class MatchSeriesRequestDto
+internal sealed record MatchSeriesRequestDto
{
public string SeriesName { get; set; }
public ICollection AlternativeNames { get; set; }
diff --git a/API/DTOs/KavitaPlus/ExternalMetadata/SeriesDetailPlusApiDto.cs b/API/DTOs/KavitaPlus/ExternalMetadata/SeriesDetailPlusApiDto.cs
index 26411bce7..d0cbb7bd3 100644
--- a/API/DTOs/KavitaPlus/ExternalMetadata/SeriesDetailPlusApiDto.cs
+++ b/API/DTOs/KavitaPlus/ExternalMetadata/SeriesDetailPlusApiDto.cs
@@ -1,11 +1,12 @@
using System.Collections.Generic;
+using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
using API.DTOs.Scrobbling;
using API.DTOs.SeriesDetail;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
-internal class SeriesDetailPlusApiDto
+internal sealed record SeriesDetailPlusApiDto
{
public IEnumerable Recommendations { get; set; }
public IEnumerable Reviews { get; set; }
diff --git a/API/DTOs/KavitaPlus/License/EncryptLicenseDto.cs b/API/DTOs/KavitaPlus/License/EncryptLicenseDto.cs
index eedbed2ef..dd85dd063 100644
--- a/API/DTOs/KavitaPlus/License/EncryptLicenseDto.cs
+++ b/API/DTOs/KavitaPlus/License/EncryptLicenseDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.KavitaPlus.License;
#nullable enable
-public class EncryptLicenseDto
+public sealed record EncryptLicenseDto
{
public required string License { get; set; }
public required string InstallId { get; set; }
diff --git a/API/DTOs/KavitaPlus/License/LicenseInfoDto.cs b/API/DTOs/KavitaPlus/License/LicenseInfoDto.cs
index 398556aac..2cd9b5896 100644
--- a/API/DTOs/KavitaPlus/License/LicenseInfoDto.cs
+++ b/API/DTOs/KavitaPlus/License/LicenseInfoDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.License;
-public class LicenseInfoDto
+public sealed record LicenseInfoDto
{
///
/// If cancelled, will represent cancellation date. If not, will represent repayment date
diff --git a/API/DTOs/KavitaPlus/License/LicenseValidDto.cs b/API/DTOs/KavitaPlus/License/LicenseValidDto.cs
index 56ee6cf73..a7bd476ce 100644
--- a/API/DTOs/KavitaPlus/License/LicenseValidDto.cs
+++ b/API/DTOs/KavitaPlus/License/LicenseValidDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.License;
-public class LicenseValidDto
+public sealed record LicenseValidDto
{
public required string License { get; set; }
public required string InstallId { get; set; }
diff --git a/API/DTOs/KavitaPlus/License/ResetLicenseDto.cs b/API/DTOs/KavitaPlus/License/ResetLicenseDto.cs
index 60496ee0e..d0fd9b666 100644
--- a/API/DTOs/KavitaPlus/License/ResetLicenseDto.cs
+++ b/API/DTOs/KavitaPlus/License/ResetLicenseDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.KavitaPlus.License;
-public class ResetLicenseDto
+public sealed record ResetLicenseDto
{
public required string License { get; set; }
public required string InstallId { get; set; }
diff --git a/API/DTOs/KavitaPlus/License/UpdateLicenseDto.cs b/API/DTOs/KavitaPlus/License/UpdateLicenseDto.cs
index 4621810f0..28b47efbe 100644
--- a/API/DTOs/KavitaPlus/License/UpdateLicenseDto.cs
+++ b/API/DTOs/KavitaPlus/License/UpdateLicenseDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.KavitaPlus.License;
#nullable enable
-public class UpdateLicenseDto
+public sealed record UpdateLicenseDto
{
///
/// License Key received from Kavita+
diff --git a/API/DTOs/KavitaPlus/Manage/ManageMatchFilterDto.cs b/API/DTOs/KavitaPlus/Manage/ManageMatchFilterDto.cs
index 60bed32b0..8eb38c98a 100644
--- a/API/DTOs/KavitaPlus/Manage/ManageMatchFilterDto.cs
+++ b/API/DTOs/KavitaPlus/Manage/ManageMatchFilterDto.cs
@@ -12,7 +12,7 @@ public enum MatchStateOption
DontMatch = 4
}
-public class ManageMatchFilterDto
+public sealed record ManageMatchFilterDto
{
public MatchStateOption MatchStateOption { get; set; } = MatchStateOption.All;
public string SearchTerm { get; set; } = string.Empty;
diff --git a/API/DTOs/KavitaPlus/Manage/ManageMatchSeriesDto.cs b/API/DTOs/KavitaPlus/Manage/ManageMatchSeriesDto.cs
index 14617e7f0..a51e63ee9 100644
--- a/API/DTOs/KavitaPlus/Manage/ManageMatchSeriesDto.cs
+++ b/API/DTOs/KavitaPlus/Manage/ManageMatchSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.Manage;
-public class ManageMatchSeriesDto
+public sealed record ManageMatchSeriesDto
{
public SeriesDto Series { get; set; }
public bool IsMatched { get; set; }
diff --git a/API/DTOs/KavitaPlus/Metadata/ExternalChapterDto.cs b/API/DTOs/KavitaPlus/Metadata/ExternalChapterDto.cs
index 6b711513c..1dcd8494c 100644
--- a/API/DTOs/KavitaPlus/Metadata/ExternalChapterDto.cs
+++ b/API/DTOs/KavitaPlus/Metadata/ExternalChapterDto.cs
@@ -7,7 +7,7 @@ namespace API.DTOs.KavitaPlus.Metadata;
///
/// Information about an individual issue/chapter/book from Kavita+
///
-public class ExternalChapterDto
+public sealed record ExternalChapterDto
{
public string Title { get; set; }
diff --git a/API/DTOs/KavitaPlus/Metadata/ExternalSeriesDetailDto.cs b/API/DTOs/KavitaPlus/Metadata/ExternalSeriesDetailDto.cs
index 2ea746214..a3cd378b2 100644
--- a/API/DTOs/KavitaPlus/Metadata/ExternalSeriesDetailDto.cs
+++ b/API/DTOs/KavitaPlus/Metadata/ExternalSeriesDetailDto.cs
@@ -1,16 +1,16 @@
using System;
using System.Collections.Generic;
-using API.DTOs.KavitaPlus.Metadata;
+using API.DTOs.Recommendation;
using API.DTOs.Scrobbling;
using API.Services.Plus;
-namespace API.DTOs.Recommendation;
+namespace API.DTOs.KavitaPlus.Metadata;
#nullable enable
///
/// This is AniListSeries
///
-public class ExternalSeriesDetailDto
+public sealed record ExternalSeriesDetailDto
{
public string Name { get; set; }
public int? AniListId { get; set; }
diff --git a/API/DTOs/KavitaPlus/Metadata/MetadataFieldMappingDto.cs b/API/DTOs/KavitaPlus/Metadata/MetadataFieldMappingDto.cs
index 796cfeb1a..a9debabd1 100644
--- a/API/DTOs/KavitaPlus/Metadata/MetadataFieldMappingDto.cs
+++ b/API/DTOs/KavitaPlus/Metadata/MetadataFieldMappingDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.KavitaPlus.Metadata;
-public class MetadataFieldMappingDto
+public sealed record MetadataFieldMappingDto
{
public int Id { get; set; }
public MetadataFieldType SourceType { get; set; }
diff --git a/API/DTOs/KavitaPlus/Metadata/MetadataSettingsDto.cs b/API/DTOs/KavitaPlus/Metadata/MetadataSettingsDto.cs
index 1dd26a7bc..e9f6614bc 100644
--- a/API/DTOs/KavitaPlus/Metadata/MetadataSettingsDto.cs
+++ b/API/DTOs/KavitaPlus/Metadata/MetadataSettingsDto.cs
@@ -7,7 +7,7 @@ using NotImplementedException = System.NotImplementedException;
namespace API.DTOs.KavitaPlus.Metadata;
-public class MetadataSettingsDto
+public sealed record MetadataSettingsDto
{
///
/// If writing any sort of metadata from upstream (AniList, Hardcover) source is allowed
diff --git a/API/DTOs/KavitaPlus/Metadata/SeriesCharacter.cs b/API/DTOs/KavitaPlus/Metadata/SeriesCharacter.cs
index bb5a3f20a..2b57548cd 100644
--- a/API/DTOs/KavitaPlus/Metadata/SeriesCharacter.cs
+++ b/API/DTOs/KavitaPlus/Metadata/SeriesCharacter.cs
@@ -9,7 +9,7 @@ public enum CharacterRole
}
-public class SeriesCharacter
+public sealed record SeriesCharacter
{
public string Name { get; set; }
public required string Description { get; set; }
diff --git a/API/DTOs/KavitaPlus/Metadata/SeriesRelationship.cs b/API/DTOs/KavitaPlus/Metadata/SeriesRelationship.cs
index bd42e73a1..0b1f619a2 100644
--- a/API/DTOs/KavitaPlus/Metadata/SeriesRelationship.cs
+++ b/API/DTOs/KavitaPlus/Metadata/SeriesRelationship.cs
@@ -5,7 +5,7 @@ using API.Services.Plus;
namespace API.DTOs.KavitaPlus.Metadata;
-public class ALMediaTitle
+public sealed record ALMediaTitle
{
public string? EnglishTitle { get; set; }
public string RomajiTitle { get; set; }
@@ -13,7 +13,7 @@ public class ALMediaTitle
public string PreferredTitle { get; set; }
}
-public class SeriesRelationship
+public sealed record SeriesRelationship
{
public int AniListId { get; set; }
public int? MalId { get; set; }
diff --git a/API/DTOs/LibraryDto.cs b/API/DTOs/LibraryDto.cs
index 18dea9434..8ba687346 100644
--- a/API/DTOs/LibraryDto.cs
+++ b/API/DTOs/LibraryDto.cs
@@ -1,12 +1,11 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using API.Entities.Enums;
namespace API.DTOs;
#nullable enable
-public class LibraryDto
+public sealed record LibraryDto
{
public int Id { get; init; }
public string? Name { get; init; }
diff --git a/API/DTOs/MangaFileDto.cs b/API/DTOs/MangaFileDto.cs
index 9f2f19a42..23bb37467 100644
--- a/API/DTOs/MangaFileDto.cs
+++ b/API/DTOs/MangaFileDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs;
#nullable enable
-public class MangaFileDto
+public sealed record MangaFileDto
{
public int Id { get; init; }
///
diff --git a/API/DTOs/MediaErrors/MediaErrorDto.cs b/API/DTOs/MediaErrors/MediaErrorDto.cs
index bfaf57124..b77ee88be 100644
--- a/API/DTOs/MediaErrors/MediaErrorDto.cs
+++ b/API/DTOs/MediaErrors/MediaErrorDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.MediaErrors;
-public class MediaErrorDto
+public sealed record MediaErrorDto
{
///
/// Format Type (RAR, ZIP, 7Zip, Epub, PDF)
diff --git a/API/DTOs/MemberDto.cs b/API/DTOs/MemberDto.cs
index 7b750b32f..f5f24b284 100644
--- a/API/DTOs/MemberDto.cs
+++ b/API/DTOs/MemberDto.cs
@@ -8,7 +8,7 @@ namespace API.DTOs;
///
/// Represents a member of a Kavita server.
///
-public class MemberDto
+public sealed record MemberDto
{
public int Id { get; init; }
public string? Username { get; init; }
diff --git a/API/DTOs/Metadata/AgeRatingDto.cs b/API/DTOs/Metadata/AgeRatingDto.cs
index 07523c3fe..bfa835ef5 100644
--- a/API/DTOs/Metadata/AgeRatingDto.cs
+++ b/API/DTOs/Metadata/AgeRatingDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Metadata;
-public class AgeRatingDto
+public sealed record AgeRatingDto
{
public AgeRating Value { get; set; }
public required string Title { get; set; }
diff --git a/API/DTOs/Metadata/ChapterMetadataDto.cs b/API/DTOs/Metadata/ChapterMetadataDto.cs
index bbd93d618..1adc52cd1 100644
--- a/API/DTOs/Metadata/ChapterMetadataDto.cs
+++ b/API/DTOs/Metadata/ChapterMetadataDto.cs
@@ -9,7 +9,7 @@ namespace API.DTOs.Metadata;
/// Exclusively metadata about a given chapter
///
[Obsolete("Will not be maintained as of v0.8.1")]
-public class ChapterMetadataDto
+public sealed record ChapterMetadataDto
{
public int Id { get; set; }
public int ChapterId { get; set; }
diff --git a/API/DTOs/Metadata/GenreTagDto.cs b/API/DTOs/Metadata/GenreTagDto.cs
index cf05ebbff..4846048d2 100644
--- a/API/DTOs/Metadata/GenreTagDto.cs
+++ b/API/DTOs/Metadata/GenreTagDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Metadata;
-public class GenreTagDto
+public sealed record GenreTagDto
{
public int Id { get; set; }
public required string Title { get; set; }
diff --git a/API/DTOs/Metadata/Matching/ExternalSeriesMatchDto.cs b/API/DTOs/Metadata/Matching/ExternalSeriesMatchDto.cs
index aefd697ba..774581b37 100644
--- a/API/DTOs/Metadata/Matching/ExternalSeriesMatchDto.cs
+++ b/API/DTOs/Metadata/Matching/ExternalSeriesMatchDto.cs
@@ -1,8 +1,9 @@
+using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
namespace API.DTOs.Metadata.Matching;
-public class ExternalSeriesMatchDto
+public sealed record ExternalSeriesMatchDto
{
public ExternalSeriesDetailDto Series { get; set; }
public float MatchRating { get; set; }
diff --git a/API/DTOs/Metadata/Matching/MatchSeriesDto.cs b/API/DTOs/Metadata/Matching/MatchSeriesDto.cs
index 1f401e787..bb497b9ab 100644
--- a/API/DTOs/Metadata/Matching/MatchSeriesDto.cs
+++ b/API/DTOs/Metadata/Matching/MatchSeriesDto.cs
@@ -3,7 +3,7 @@ namespace API.DTOs.Metadata.Matching;
///
/// Used for matching a series with Kavita+ for metadata and scrobbling
///
-public class MatchSeriesDto
+public sealed record MatchSeriesDto
{
///
/// When set, Kavita will stop attempting to match this series and will not perform any scrobbling
diff --git a/API/DTOs/Metadata/PublicationStatusDto.cs b/API/DTOs/Metadata/PublicationStatusDto.cs
index b8166a6e5..b4f12500a 100644
--- a/API/DTOs/Metadata/PublicationStatusDto.cs
+++ b/API/DTOs/Metadata/PublicationStatusDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Metadata;
-public class PublicationStatusDto
+public sealed record PublicationStatusDto
{
public PublicationStatus Value { get; set; }
public required string Title { get; set; }
diff --git a/API/DTOs/Metadata/TagDto.cs b/API/DTOs/Metadata/TagDto.cs
index 59e03a279..f8deb6913 100644
--- a/API/DTOs/Metadata/TagDto.cs
+++ b/API/DTOs/Metadata/TagDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Metadata;
-public class TagDto
+public sealed record TagDto
{
public int Id { get; set; }
public required string Title { get; set; }
diff --git a/API/DTOs/OPDS/Feed.cs b/API/DTOs/OPDS/Feed.cs
index 76a740b89..5f4c4b115 100644
--- a/API/DTOs/OPDS/Feed.cs
+++ b/API/DTOs/OPDS/Feed.cs
@@ -4,11 +4,13 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
+// TODO: OPDS Dtos are internal state, shouldn't be in DTO directory
+
///
///
///
[XmlRoot("feed", Namespace = "http://www.w3.org/2005/Atom")]
-public class Feed
+public sealed record Feed
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
diff --git a/API/DTOs/OPDS/FeedAuthor.cs b/API/DTOs/OPDS/FeedAuthor.cs
index 1fd3e6cd2..4196997dd 100644
--- a/API/DTOs/OPDS/FeedAuthor.cs
+++ b/API/DTOs/OPDS/FeedAuthor.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
-public class FeedAuthor
+public sealed record FeedAuthor
{
[XmlElement("name")]
public string Name { get; set; }
diff --git a/API/DTOs/OPDS/FeedCategory.cs b/API/DTOs/OPDS/FeedCategory.cs
index 3129fab60..2352b4af2 100644
--- a/API/DTOs/OPDS/FeedCategory.cs
+++ b/API/DTOs/OPDS/FeedCategory.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
-public class FeedCategory
+public sealed record FeedCategory
{
[XmlAttribute("scheme")]
public string Scheme { get; } = "http://www.bisg.org/standards/bisac_subject/index.html";
diff --git a/API/DTOs/OPDS/FeedEntry.cs b/API/DTOs/OPDS/FeedEntry.cs
index da8b53b74..838ebd124 100644
--- a/API/DTOs/OPDS/FeedEntry.cs
+++ b/API/DTOs/OPDS/FeedEntry.cs
@@ -5,7 +5,7 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
#nullable enable
-public class FeedEntry
+public sealed record FeedEntry
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
diff --git a/API/DTOs/OPDS/FeedEntryContent.cs b/API/DTOs/OPDS/FeedEntryContent.cs
index 3e95ce643..4de9b73bd 100644
--- a/API/DTOs/OPDS/FeedEntryContent.cs
+++ b/API/DTOs/OPDS/FeedEntryContent.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
-public class FeedEntryContent
+public sealed record FeedEntryContent
{
[XmlAttribute("type")]
public string Type = "text";
diff --git a/API/DTOs/OPDS/FeedLink.cs b/API/DTOs/OPDS/FeedLink.cs
index cff3b6736..28c55bbe8 100644
--- a/API/DTOs/OPDS/FeedLink.cs
+++ b/API/DTOs/OPDS/FeedLink.cs
@@ -3,7 +3,7 @@ using System.Xml.Serialization;
namespace API.DTOs.OPDS;
-public class FeedLink
+public sealed record FeedLink
{
[XmlIgnore]
public bool IsPageStream { get; set; }
diff --git a/API/DTOs/OPDS/OpenSearchDescription.cs b/API/DTOs/OPDS/OpenSearchDescription.cs
index cc8392a88..eba26572f 100644
--- a/API/DTOs/OPDS/OpenSearchDescription.cs
+++ b/API/DTOs/OPDS/OpenSearchDescription.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.OPDS;
[XmlRoot("OpenSearchDescription", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
-public class OpenSearchDescription
+public sealed record OpenSearchDescription
{
///
/// Contains a brief human-readable title that identifies this search engine.
diff --git a/API/DTOs/OPDS/SearchLink.cs b/API/DTOs/OPDS/SearchLink.cs
index dba67f3bd..b4698c221 100644
--- a/API/DTOs/OPDS/SearchLink.cs
+++ b/API/DTOs/OPDS/SearchLink.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.OPDS;
-public class SearchLink
+public sealed record SearchLink
{
[XmlAttribute("type")]
public string Type { get; set; } = default!;
diff --git a/API/DTOs/Person/UpdatePersonDto.cs b/API/DTOs/Person/UpdatePersonDto.cs
index d21fb7350..29190151f 100644
--- a/API/DTOs/Person/UpdatePersonDto.cs
+++ b/API/DTOs/Person/UpdatePersonDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs;
#nullable enable
-public class UpdatePersonDto
+public sealed record UpdatePersonDto
{
[Required]
public int Id { get; init; }
diff --git a/API/DTOs/Progress/FullProgressDto.cs b/API/DTOs/Progress/FullProgressDto.cs
index 7d0b47f60..4f97ab44a 100644
--- a/API/DTOs/Progress/FullProgressDto.cs
+++ b/API/DTOs/Progress/FullProgressDto.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.Progress;
///
/// A full progress Record from the DB (not all data, only what's needed for API)
///
-public class FullProgressDto
+public sealed record FullProgressDto
{
public int Id { get; set; }
public int ChapterId { get; set; }
diff --git a/API/DTOs/Progress/ProgressDto.cs b/API/DTOs/Progress/ProgressDto.cs
index 9fc9010aa..0add848c5 100644
--- a/API/DTOs/Progress/ProgressDto.cs
+++ b/API/DTOs/Progress/ProgressDto.cs
@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.Progress;
#nullable enable
-public class ProgressDto
+public sealed record ProgressDto
{
[Required]
public int VolumeId { get; set; }
diff --git a/API/DTOs/RatingDto.cs b/API/DTOs/RatingDto.cs
index 264d2d43c..101aa7ac5 100644
--- a/API/DTOs/RatingDto.cs
+++ b/API/DTOs/RatingDto.cs
@@ -1,14 +1,18 @@
-using API.Entities.Enums;
+using API.Entities;
+using API.Entities.Enums;
+using API.Entities.Metadata;
using API.Services.Plus;
namespace API.DTOs;
#nullable enable
-public class RatingDto
+public sealed record RatingDto
{
+
public int AverageScore { get; set; }
public int FavoriteCount { get; set; }
public ScrobbleProvider Provider { get; set; }
+ ///
public RatingAuthority Authority { get; set; } = RatingAuthority.User;
public string? ProviderUrl { get; set; }
}
diff --git a/API/DTOs/Reader/BookChapterItem.cs b/API/DTOs/Reader/BookChapterItem.cs
index dcfb7b904..892e82e27 100644
--- a/API/DTOs/Reader/BookChapterItem.cs
+++ b/API/DTOs/Reader/BookChapterItem.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Reader;
-public class BookChapterItem
+public sealed record BookChapterItem
{
///
/// Name of the Chapter
diff --git a/API/DTOs/Reader/BookInfoDto.cs b/API/DTOs/Reader/BookInfoDto.cs
index c379f71f8..2473cd5dc 100644
--- a/API/DTOs/Reader/BookInfoDto.cs
+++ b/API/DTOs/Reader/BookInfoDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Reader;
-public class BookInfoDto : IChapterInfoDto
+public sealed record BookInfoDto : IChapterInfoDto
{
public string BookTitle { get; set; } = default! ;
public int SeriesId { get; set; }
diff --git a/API/DTOs/Reader/BookmarkDto.cs b/API/DTOs/Reader/BookmarkDto.cs
index ef4cf3d6d..da18fc28e 100644
--- a/API/DTOs/Reader/BookmarkDto.cs
+++ b/API/DTOs/Reader/BookmarkDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.Reader;
#nullable enable
-public class BookmarkDto
+public sealed record BookmarkDto
{
public int Id { get; set; }
[Required]
diff --git a/API/DTOs/Reader/BulkRemoveBookmarkForSeriesDto.cs b/API/DTOs/Reader/BulkRemoveBookmarkForSeriesDto.cs
index 7490f837c..51ccf5cc3 100644
--- a/API/DTOs/Reader/BulkRemoveBookmarkForSeriesDto.cs
+++ b/API/DTOs/Reader/BulkRemoveBookmarkForSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Reader;
-public class BulkRemoveBookmarkForSeriesDto
+public sealed record BulkRemoveBookmarkForSeriesDto
{
public ICollection SeriesIds { get; init; } = default!;
}
diff --git a/API/DTOs/Reader/ChapterInfoDto.cs b/API/DTOs/Reader/ChapterInfoDto.cs
index 4584a5830..4da08a31d 100644
--- a/API/DTOs/Reader/ChapterInfoDto.cs
+++ b/API/DTOs/Reader/ChapterInfoDto.cs
@@ -7,7 +7,7 @@ namespace API.DTOs.Reader;
///
/// Information about the Chapter for the Reader to render
///
-public class ChapterInfoDto : IChapterInfoDto
+public sealed record ChapterInfoDto : IChapterInfoDto
{
///
/// The Chapter Number
diff --git a/API/DTOs/Reader/CreatePersonalToCDto.cs b/API/DTOs/Reader/CreatePersonalToCDto.cs
index 3b80ece4a..95272ca58 100644
--- a/API/DTOs/Reader/CreatePersonalToCDto.cs
+++ b/API/DTOs/Reader/CreatePersonalToCDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.Reader;
#nullable enable
-public class CreatePersonalToCDto
+public sealed record CreatePersonalToCDto
{
public required int ChapterId { get; set; }
public required int VolumeId { get; set; }
diff --git a/API/DTOs/Reader/FileDimensionDto.cs b/API/DTOs/Reader/FileDimensionDto.cs
index baee20dd0..7a7d2978f 100644
--- a/API/DTOs/Reader/FileDimensionDto.cs
+++ b/API/DTOs/Reader/FileDimensionDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Reader;
-public class FileDimensionDto
+public sealed record FileDimensionDto
{
public int Width { get; set; }
public int Height { get; set; }
diff --git a/API/DTOs/Reader/HourEstimateRangeDto.cs b/API/DTOs/Reader/HourEstimateRangeDto.cs
index 8c8bd11a9..3facf8e56 100644
--- a/API/DTOs/Reader/HourEstimateRangeDto.cs
+++ b/API/DTOs/Reader/HourEstimateRangeDto.cs
@@ -3,7 +3,7 @@
///
/// A range of time to read a selection (series, chapter, etc)
///
-public record HourEstimateRangeDto
+public sealed record HourEstimateRangeDto
{
///
/// Min hours to read the selection
diff --git a/API/DTOs/Reader/MarkMultipleSeriesAsReadDto.cs b/API/DTOs/Reader/MarkMultipleSeriesAsReadDto.cs
index 50187ec81..4c39f7d76 100644
--- a/API/DTOs/Reader/MarkMultipleSeriesAsReadDto.cs
+++ b/API/DTOs/Reader/MarkMultipleSeriesAsReadDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Reader;
-public class MarkMultipleSeriesAsReadDto
+public sealed record MarkMultipleSeriesAsReadDto
{
public IReadOnlyList SeriesIds { get; init; } = default!;
}
diff --git a/API/DTOs/Reader/MarkReadDto.cs b/API/DTOs/Reader/MarkReadDto.cs
index 9bf46a6d5..c6f7367c0 100644
--- a/API/DTOs/Reader/MarkReadDto.cs
+++ b/API/DTOs/Reader/MarkReadDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Reader;
-public class MarkReadDto
+public sealed record MarkReadDto
{
public int SeriesId { get; init; }
}
diff --git a/API/DTOs/Reader/MarkVolumeReadDto.cs b/API/DTOs/Reader/MarkVolumeReadDto.cs
index 47ffd2649..be95d2e98 100644
--- a/API/DTOs/Reader/MarkVolumeReadDto.cs
+++ b/API/DTOs/Reader/MarkVolumeReadDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Reader;
-public class MarkVolumeReadDto
+public sealed record MarkVolumeReadDto
{
public int SeriesId { get; init; }
public int VolumeId { get; init; }
diff --git a/API/DTOs/Reader/MarkVolumesReadDto.cs b/API/DTOs/Reader/MarkVolumesReadDto.cs
index ebe1cd76c..b07bfbc67 100644
--- a/API/DTOs/Reader/MarkVolumesReadDto.cs
+++ b/API/DTOs/Reader/MarkVolumesReadDto.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.Reader;
///
/// This is used for bulk updating a set of volume and or chapters in one go
///
-public class MarkVolumesReadDto
+public sealed record MarkVolumesReadDto
{
public int SeriesId { get; set; }
///
diff --git a/API/DTOs/Reader/PersonalToCDto.cs b/API/DTOs/Reader/PersonalToCDto.cs
index 144ed561f..c979d9d78 100644
--- a/API/DTOs/Reader/PersonalToCDto.cs
+++ b/API/DTOs/Reader/PersonalToCDto.cs
@@ -2,7 +2,7 @@
#nullable enable
-public class PersonalToCDto
+public sealed record PersonalToCDto
{
public required int ChapterId { get; set; }
public required int PageNumber { get; set; }
diff --git a/API/DTOs/Reader/RemoveBookmarkForSeriesDto.cs b/API/DTOs/Reader/RemoveBookmarkForSeriesDto.cs
index ed6368a4f..ecbb744c8 100644
--- a/API/DTOs/Reader/RemoveBookmarkForSeriesDto.cs
+++ b/API/DTOs/Reader/RemoveBookmarkForSeriesDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Reader;
-public class RemoveBookmarkForSeriesDto
+public sealed record RemoveBookmarkForSeriesDto
{
public int SeriesId { get; init; }
}
diff --git a/API/DTOs/ReadingLists/CBL/CblBook.cs b/API/DTOs/ReadingLists/CBL/CblBook.cs
index 08930e208..d51795b8d 100644
--- a/API/DTOs/ReadingLists/CBL/CblBook.cs
+++ b/API/DTOs/ReadingLists/CBL/CblBook.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.ReadingLists.CBL;
[XmlRoot(ElementName="Book")]
-public class CblBook
+public sealed record CblBook
{
[XmlAttribute("Series")]
public string Series { get; set; }
diff --git a/API/DTOs/ReadingLists/CBL/CblConflictsDto.cs b/API/DTOs/ReadingLists/CBL/CblConflictsDto.cs
index 70a002884..35234923f 100644
--- a/API/DTOs/ReadingLists/CBL/CblConflictsDto.cs
+++ b/API/DTOs/ReadingLists/CBL/CblConflictsDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.ReadingLists.CBL;
-public class CblConflictQuestion
+public sealed record CblConflictQuestion
{
public string SeriesName { get; set; }
public IList LibrariesIds { get; set; }
diff --git a/API/DTOs/ReadingLists/CBL/CblImportSummary.cs b/API/DTOs/ReadingLists/CBL/CblImportSummary.cs
index 136a31aa8..b9716421e 100644
--- a/API/DTOs/ReadingLists/CBL/CblImportSummary.cs
+++ b/API/DTOs/ReadingLists/CBL/CblImportSummary.cs
@@ -75,7 +75,7 @@ public enum CblImportReason
InvalidFile = 9,
}
-public class CblBookResult
+public sealed record CblBookResult
{
///
/// Order in the CBL
@@ -114,7 +114,7 @@ public class CblBookResult
///
/// Represents the summary from the Import of a given CBL
///
-public class CblImportSummaryDto
+public sealed record CblImportSummaryDto
{
public string CblName { get; set; }
///
diff --git a/API/DTOs/ReadingLists/CBL/CblReadingList.cs b/API/DTOs/ReadingLists/CBL/CblReadingList.cs
index 001e6434b..15b349f42 100644
--- a/API/DTOs/ReadingLists/CBL/CblReadingList.cs
+++ b/API/DTOs/ReadingLists/CBL/CblReadingList.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.ReadingLists.CBL;
[XmlRoot(ElementName="Books")]
-public class CblBooks
+public sealed record CblBooks
{
[XmlElement(ElementName="Book")]
public List Book { get; set; }
@@ -13,7 +13,7 @@ public class CblBooks
[XmlRoot(ElementName="ReadingList")]
-public class CblReadingList
+public sealed record CblReadingList
{
///
/// Name of the Reading List
diff --git a/API/DTOs/ReadingLists/CreateReadingListDto.cs b/API/DTOs/ReadingLists/CreateReadingListDto.cs
index 783253007..543215722 100644
--- a/API/DTOs/ReadingLists/CreateReadingListDto.cs
+++ b/API/DTOs/ReadingLists/CreateReadingListDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.ReadingLists;
-public class CreateReadingListDto
+public sealed record CreateReadingListDto
{
public string Title { get; init; } = default!;
}
diff --git a/API/DTOs/ReadingLists/DeleteReadingListsDto.cs b/API/DTOs/ReadingLists/DeleteReadingListsDto.cs
index 8417f8132..8ce92f939 100644
--- a/API/DTOs/ReadingLists/DeleteReadingListsDto.cs
+++ b/API/DTOs/ReadingLists/DeleteReadingListsDto.cs
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
namespace API.DTOs.ReadingLists;
-public class DeleteReadingListsDto
+public sealed record DeleteReadingListsDto
{
[Required]
public IList ReadingListIds { get; set; }
diff --git a/API/DTOs/ReadingLists/PromoteReadingListsDto.cs b/API/DTOs/ReadingLists/PromoteReadingListsDto.cs
index f64bbb5ca..8915274de 100644
--- a/API/DTOs/ReadingLists/PromoteReadingListsDto.cs
+++ b/API/DTOs/ReadingLists/PromoteReadingListsDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.ReadingLists;
-public class PromoteReadingListsDto
+public sealed record PromoteReadingListsDto
{
public IList ReadingListIds { get; init; }
public bool Promoted { get; init; }
diff --git a/API/DTOs/ReadingLists/ReadingListCast.cs b/API/DTOs/ReadingLists/ReadingListCast.cs
index 4532df7d5..8f2587426 100644
--- a/API/DTOs/ReadingLists/ReadingListCast.cs
+++ b/API/DTOs/ReadingLists/ReadingListCast.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.ReadingLists;
-public class ReadingListCast
+public sealed record ReadingListCast
{
public ICollection Writers { get; set; } = [];
public ICollection CoverArtists { get; set; } = [];
diff --git a/API/DTOs/ReadingLists/ReadingListDto.cs b/API/DTOs/ReadingLists/ReadingListDto.cs
index 6508e7bd4..d61e2d615 100644
--- a/API/DTOs/ReadingLists/ReadingListDto.cs
+++ b/API/DTOs/ReadingLists/ReadingListDto.cs
@@ -5,7 +5,7 @@ using API.Entities.Interfaces;
namespace API.DTOs.ReadingLists;
#nullable enable
-public class ReadingListDto : IHasCoverImage
+public sealed record ReadingListDto : IHasCoverImage
{
public int Id { get; init; }
public string Title { get; set; } = default!;
diff --git a/API/DTOs/ReadingLists/ReadingListInfoDto.cs b/API/DTOs/ReadingLists/ReadingListInfoDto.cs
index bd95b9226..64a305f43 100644
--- a/API/DTOs/ReadingLists/ReadingListInfoDto.cs
+++ b/API/DTOs/ReadingLists/ReadingListInfoDto.cs
@@ -3,7 +3,7 @@ using API.Entities.Interfaces;
namespace API.DTOs.ReadingLists;
-public class ReadingListInfoDto : IHasReadTimeEstimate
+public sealed record ReadingListInfoDto : IHasReadTimeEstimate
{
///
/// Total Pages across all Reading List Items
diff --git a/API/DTOs/ReadingLists/ReadingListItemDto.cs b/API/DTOs/ReadingLists/ReadingListItemDto.cs
index 4fca5360c..8edec14f1 100644
--- a/API/DTOs/ReadingLists/ReadingListItemDto.cs
+++ b/API/DTOs/ReadingLists/ReadingListItemDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.ReadingLists;
#nullable enable
-public class ReadingListItemDto
+public sealed record ReadingListItemDto
{
public int Id { get; init; }
public int Order { get; init; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListByChapterDto.cs b/API/DTOs/ReadingLists/UpdateReadingListByChapterDto.cs
index 985f86ac0..6624c8a5c 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListByChapterDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListByChapterDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListByChapterDto
+public sealed record UpdateReadingListByChapterDto
{
public int ChapterId { get; init; }
public int SeriesId { get; init; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListByMultipleDto.cs b/API/DTOs/ReadingLists/UpdateReadingListByMultipleDto.cs
index 408963529..ba7625088 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListByMultipleDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListByMultipleDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListByMultipleDto
+public sealed record UpdateReadingListByMultipleDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListByMultipleSeriesDto.cs b/API/DTOs/ReadingLists/UpdateReadingListByMultipleSeriesDto.cs
index f910e9c06..910a5744d 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListByMultipleSeriesDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListByMultipleSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListByMultipleSeriesDto
+public sealed record UpdateReadingListByMultipleSeriesDto
{
public int ReadingListId { get; init; }
public IReadOnlyList SeriesIds { get; init; } = default!;
diff --git a/API/DTOs/ReadingLists/UpdateReadingListBySeriesDto.cs b/API/DTOs/ReadingLists/UpdateReadingListBySeriesDto.cs
index 0590882bd..4bb4aa7bb 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListBySeriesDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListBySeriesDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListBySeriesDto
+public sealed record UpdateReadingListBySeriesDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListByVolumeDto.cs b/API/DTOs/ReadingLists/UpdateReadingListByVolumeDto.cs
index f77c7d63a..422d1cc34 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListByVolumeDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListByVolumeDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListByVolumeDto
+public sealed record UpdateReadingListByVolumeDto
{
public int VolumeId { get; init; }
public int SeriesId { get; init; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListDto.cs b/API/DTOs/ReadingLists/UpdateReadingListDto.cs
index 6b590707a..de273d825 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListDto.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.ReadingLists;
-public class UpdateReadingListDto
+public sealed record UpdateReadingListDto
{
[Required]
public int ReadingListId { get; set; }
diff --git a/API/DTOs/ReadingLists/UpdateReadingListPosition.cs b/API/DTOs/ReadingLists/UpdateReadingListPosition.cs
index 3d0487144..04f2501a8 100644
--- a/API/DTOs/ReadingLists/UpdateReadingListPosition.cs
+++ b/API/DTOs/ReadingLists/UpdateReadingListPosition.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.ReadingLists;
///
/// DTO for moving a reading list item to another position within the same list
///
-public class UpdateReadingListPosition
+public sealed record UpdateReadingListPosition
{
[Required] public int ReadingListId { get; set; }
[Required] public int ReadingListItemId { get; set; }
diff --git a/API/DTOs/Recommendation/ExternalSeriesDto.cs b/API/DTOs/Recommendation/ExternalSeriesDto.cs
index d393443af..752001a39 100644
--- a/API/DTOs/Recommendation/ExternalSeriesDto.cs
+++ b/API/DTOs/Recommendation/ExternalSeriesDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.Recommendation;
#nullable enable
-public class ExternalSeriesDto
+public sealed record ExternalSeriesDto
{
public required string Name { get; set; }
public required string CoverUrl { get; set; }
diff --git a/API/DTOs/Recommendation/MetadataTagDto.cs b/API/DTOs/Recommendation/MetadataTagDto.cs
index b219dedc1..a7eb76284 100644
--- a/API/DTOs/Recommendation/MetadataTagDto.cs
+++ b/API/DTOs/Recommendation/MetadataTagDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Recommendation;
-public class MetadataTagDto
+public sealed record MetadataTagDto
{
public string Name { get; set; }
public string Description { get; private set; }
diff --git a/API/DTOs/Recommendation/RecommendationDto.cs b/API/DTOs/Recommendation/RecommendationDto.cs
index 679245a87..387661324 100644
--- a/API/DTOs/Recommendation/RecommendationDto.cs
+++ b/API/DTOs/Recommendation/RecommendationDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Recommendation;
-public class RecommendationDto
+public sealed record RecommendationDto
{
public IList OwnedSeries { get; set; } = new List();
public IList ExternalSeries { get; set; } = new List();
diff --git a/API/DTOs/Recommendation/SeriesStaffDto.cs b/API/DTOs/Recommendation/SeriesStaffDto.cs
index e4c6f6423..e074e8625 100644
--- a/API/DTOs/Recommendation/SeriesStaffDto.cs
+++ b/API/DTOs/Recommendation/SeriesStaffDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.Recommendation;
#nullable enable
-public class SeriesStaffDto
+public sealed record SeriesStaffDto
{
public required string Name { get; set; }
public string? FirstName { get; set; }
diff --git a/API/DTOs/RefreshSeriesDto.cs b/API/DTOs/RefreshSeriesDto.cs
index 0e94fc44b..ad26afba2 100644
--- a/API/DTOs/RefreshSeriesDto.cs
+++ b/API/DTOs/RefreshSeriesDto.cs
@@ -3,7 +3,7 @@
///
/// Used for running some task against a Series.
///
-public class RefreshSeriesDto
+public sealed record RefreshSeriesDto
{
///
/// Library Id series belongs to
diff --git a/API/DTOs/RegisterDto.cs b/API/DTOs/RegisterDto.cs
index 2d4d3b77f..e117af872 100644
--- a/API/DTOs/RegisterDto.cs
+++ b/API/DTOs/RegisterDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs;
#nullable enable
-public class RegisterDto
+public sealed record RegisterDto
{
[Required]
public string Username { get; init; } = default!;
diff --git a/API/DTOs/ScanFolderDto.cs b/API/DTOs/ScanFolderDto.cs
index 684de909e..141f7f0b5 100644
--- a/API/DTOs/ScanFolderDto.cs
+++ b/API/DTOs/ScanFolderDto.cs
@@ -3,7 +3,7 @@
///
/// DTO for requesting a folder to be scanned
///
-public class ScanFolderDto
+public sealed record ScanFolderDto
{
///
/// Api key for a user with Admin permissions
diff --git a/API/DTOs/Scrobbling/MalUserInfoDto.cs b/API/DTOs/Scrobbling/MalUserInfoDto.cs
index 407639e2a..b6fefc053 100644
--- a/API/DTOs/Scrobbling/MalUserInfoDto.cs
+++ b/API/DTOs/Scrobbling/MalUserInfoDto.cs
@@ -3,7 +3,7 @@
///
/// Information about a User's MAL connection
///
-public class MalUserInfoDto
+public sealed record MalUserInfoDto
{
public required string Username { get; set; }
///
diff --git a/API/DTOs/Scrobbling/MediaRecommendationDto.cs b/API/DTOs/Scrobbling/MediaRecommendationDto.cs
index 3f565296b..476d77279 100644
--- a/API/DTOs/Scrobbling/MediaRecommendationDto.cs
+++ b/API/DTOs/Scrobbling/MediaRecommendationDto.cs
@@ -4,7 +4,7 @@ using API.Services.Plus;
namespace API.DTOs.Scrobbling;
#nullable enable
-public record MediaRecommendationDto
+public sealed record MediaRecommendationDto
{
public int Rating { get; set; }
public IEnumerable RecommendationNames { get; set; } = null!;
diff --git a/API/DTOs/Scrobbling/PlusSeriesDto.cs b/API/DTOs/Scrobbling/PlusSeriesDto.cs
index dca9aca92..4d0ef4ea1 100644
--- a/API/DTOs/Scrobbling/PlusSeriesDto.cs
+++ b/API/DTOs/Scrobbling/PlusSeriesDto.cs
@@ -4,7 +4,7 @@
///
/// Represents information about a potential Series for Kavita+
///
-public record PlusSeriesRequestDto
+public sealed record PlusSeriesRequestDto
{
public int? AniListId { get; set; }
public long? MalId { get; set; }
diff --git a/API/DTOs/Scrobbling/ScrobbleDto.cs b/API/DTOs/Scrobbling/ScrobbleDto.cs
index e8420e785..b90441059 100644
--- a/API/DTOs/Scrobbling/ScrobbleDto.cs
+++ b/API/DTOs/Scrobbling/ScrobbleDto.cs
@@ -36,7 +36,7 @@ public enum PlusMediaFormat
}
-public class ScrobbleDto
+public sealed record ScrobbleDto
{
///
/// User's access token to allow us to talk on their behalf
diff --git a/API/DTOs/Scrobbling/ScrobbleErrorDto.cs b/API/DTOs/Scrobbling/ScrobbleErrorDto.cs
index da85f28f1..7caaad1ca 100644
--- a/API/DTOs/Scrobbling/ScrobbleErrorDto.cs
+++ b/API/DTOs/Scrobbling/ScrobbleErrorDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Scrobbling;
-public class ScrobbleErrorDto
+public sealed record ScrobbleErrorDto
{
///
/// Developer defined string
diff --git a/API/DTOs/Scrobbling/ScrobbleEventDto.cs b/API/DTOs/Scrobbling/ScrobbleEventDto.cs
index b62c87866..7b1ccd75a 100644
--- a/API/DTOs/Scrobbling/ScrobbleEventDto.cs
+++ b/API/DTOs/Scrobbling/ScrobbleEventDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.Scrobbling;
#nullable enable
-public class ScrobbleEventDto
+public sealed record ScrobbleEventDto
{
public string SeriesName { get; set; }
public int SeriesId { get; set; }
diff --git a/API/DTOs/Scrobbling/ScrobbleHoldDto.cs b/API/DTOs/Scrobbling/ScrobbleHoldDto.cs
index dcfe7726f..3e09e4799 100644
--- a/API/DTOs/Scrobbling/ScrobbleHoldDto.cs
+++ b/API/DTOs/Scrobbling/ScrobbleHoldDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Scrobbling;
-public class ScrobbleHoldDto
+public sealed record ScrobbleHoldDto
{
public string SeriesName { get; set; }
public int SeriesId { get; set; }
diff --git a/API/DTOs/Scrobbling/ScrobbleResponseDto.cs b/API/DTOs/Scrobbling/ScrobbleResponseDto.cs
index a63e955d7..53d3a0cc9 100644
--- a/API/DTOs/Scrobbling/ScrobbleResponseDto.cs
+++ b/API/DTOs/Scrobbling/ScrobbleResponseDto.cs
@@ -4,7 +4,7 @@
///
/// Response from Kavita+ Scrobble API
///
-public class ScrobbleResponseDto
+public sealed record ScrobbleResponseDto
{
public bool Successful { get; set; }
public string? ErrorMessage { get; set; }
diff --git a/API/DTOs/Search/BookmarkSearchResultDto.cs b/API/DTOs/Search/BookmarkSearchResultDto.cs
index 5d53add1f..c11d2a2b8 100644
--- a/API/DTOs/Search/BookmarkSearchResultDto.cs
+++ b/API/DTOs/Search/BookmarkSearchResultDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Search;
-public class BookmarkSearchResultDto
+public sealed record BookmarkSearchResultDto
{
public int LibraryId { get; set; }
public int VolumeId { get; set; }
diff --git a/API/DTOs/Search/SearchResultDto.cs b/API/DTOs/Search/SearchResultDto.cs
index 6fcae3b5d..c497b55dd 100644
--- a/API/DTOs/Search/SearchResultDto.cs
+++ b/API/DTOs/Search/SearchResultDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Search;
-public class SearchResultDto
+public sealed record SearchResultDto
{
public int SeriesId { get; init; }
public string Name { get; init; } = default!;
diff --git a/API/DTOs/Search/SearchResultGroupDto.cs b/API/DTOs/Search/SearchResultGroupDto.cs
index f7a622664..20a53f853 100644
--- a/API/DTOs/Search/SearchResultGroupDto.cs
+++ b/API/DTOs/Search/SearchResultGroupDto.cs
@@ -10,7 +10,7 @@ namespace API.DTOs.Search;
///
/// Represents all Search results for a query
///
-public class SearchResultGroupDto
+public sealed record SearchResultGroupDto
{
public IEnumerable Libraries { get; set; } = default!;
public IEnumerable Series { get; set; } = default!;
diff --git a/API/DTOs/SeriesByIdsDto.cs b/API/DTOs/SeriesByIdsDto.cs
index 12e13d96f..cb4c52b1e 100644
--- a/API/DTOs/SeriesByIdsDto.cs
+++ b/API/DTOs/SeriesByIdsDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs;
-public class SeriesByIdsDto
+public sealed record SeriesByIdsDto
{
public int[] SeriesIds { get; init; } = default!;
}
diff --git a/API/DTOs/SeriesDetail/NextExpectedChapterDto.cs b/API/DTOs/SeriesDetail/NextExpectedChapterDto.cs
index 0f1a8eb4b..1bea81c84 100644
--- a/API/DTOs/SeriesDetail/NextExpectedChapterDto.cs
+++ b/API/DTOs/SeriesDetail/NextExpectedChapterDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SeriesDetail;
-public class NextExpectedChapterDto
+public sealed record NextExpectedChapterDto
{
public float ChapterNumber { get; set; }
public float VolumeNumber { get; set; }
diff --git a/API/DTOs/SeriesDetail/RelatedSeriesDto.cs b/API/DTOs/SeriesDetail/RelatedSeriesDto.cs
index 29b9eb263..a186dc295 100644
--- a/API/DTOs/SeriesDetail/RelatedSeriesDto.cs
+++ b/API/DTOs/SeriesDetail/RelatedSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SeriesDetail;
-public class RelatedSeriesDto
+public sealed record RelatedSeriesDto
{
///
/// The parent relationship Series
diff --git a/API/DTOs/SeriesDetail/SeriesDetailDto.cs b/API/DTOs/SeriesDetail/SeriesDetailDto.cs
index 65d657c67..c4f15552d 100644
--- a/API/DTOs/SeriesDetail/SeriesDetailDto.cs
+++ b/API/DTOs/SeriesDetail/SeriesDetailDto.cs
@@ -7,7 +7,7 @@ namespace API.DTOs.SeriesDetail;
/// This is a special DTO for a UI page in Kavita. This performs sorting and grouping and returns exactly what UI requires for layout.
/// This is subject to change, do not rely on this Data model.
///
-public class SeriesDetailDto
+public sealed record SeriesDetailDto
{
///
/// Specials for the Series. These will have their title and range cleaned to remove the special marker and prepare
diff --git a/API/DTOs/SeriesDetail/SeriesDetailPlusDto.cs b/API/DTOs/SeriesDetail/SeriesDetailPlusDto.cs
index 76e77ae2c..95f5f39bd 100644
--- a/API/DTOs/SeriesDetail/SeriesDetailPlusDto.cs
+++ b/API/DTOs/SeriesDetail/SeriesDetailPlusDto.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
namespace API.DTOs.SeriesDetail;
@@ -8,7 +9,7 @@ namespace API.DTOs.SeriesDetail;
/// All the data from Kavita+ for Series Detail
///
/// This is what the UI sees, not what the API sends back
-public class SeriesDetailPlusDto
+public sealed record SeriesDetailPlusDto
{
public RecommendationDto? Recommendations { get; set; }
public IEnumerable Reviews { get; set; }
diff --git a/API/DTOs/SeriesDetail/UpdateRelatedSeriesDto.cs b/API/DTOs/SeriesDetail/UpdateRelatedSeriesDto.cs
index f19ad9ca8..a1bb2057e 100644
--- a/API/DTOs/SeriesDetail/UpdateRelatedSeriesDto.cs
+++ b/API/DTOs/SeriesDetail/UpdateRelatedSeriesDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SeriesDetail;
-public class UpdateRelatedSeriesDto
+public sealed record UpdateRelatedSeriesDto
{
public int SeriesId { get; set; }
public IList Adaptations { get; set; } = default!;
diff --git a/API/DTOs/SeriesDetail/UpdateUserReviewDto.cs b/API/DTOs/SeriesDetail/UpdateUserReviewDto.cs
index adff04d6c..7af9441c1 100644
--- a/API/DTOs/SeriesDetail/UpdateUserReviewDto.cs
+++ b/API/DTOs/SeriesDetail/UpdateUserReviewDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SeriesDetail;
#nullable enable
-public class UpdateUserReviewDto
+public sealed record UpdateUserReviewDto
{
public int SeriesId { get; set; }
public int? ChapterId { get; set; }
diff --git a/API/DTOs/SeriesDetail/UserReviewDto.cs b/API/DTOs/SeriesDetail/UserReviewDto.cs
index c8340a40a..9e05bbd65 100644
--- a/API/DTOs/SeriesDetail/UserReviewDto.cs
+++ b/API/DTOs/SeriesDetail/UserReviewDto.cs
@@ -9,7 +9,7 @@ namespace API.DTOs.SeriesDetail;
/// Represents a User Review for a given Series
///
/// The user does not need to be a Kavita user
-public class UserReviewDto
+public sealed record UserReviewDto
{
///
/// A tagline for the review
diff --git a/API/DTOs/SeriesDto.cs b/API/DTOs/SeriesDto.cs
index 6aa1ecefd..b5365a5f8 100644
--- a/API/DTOs/SeriesDto.cs
+++ b/API/DTOs/SeriesDto.cs
@@ -5,7 +5,7 @@ using API.Entities.Interfaces;
namespace API.DTOs;
#nullable enable
-public class SeriesDto : IHasReadTimeEstimate, IHasCoverImage
+public sealed record SeriesDto : IHasReadTimeEstimate, IHasCoverImage
{
public int Id { get; init; }
public string? Name { get; init; }
diff --git a/API/DTOs/SeriesMetadataDto.cs b/API/DTOs/SeriesMetadataDto.cs
index 3f344dff5..701034d80 100644
--- a/API/DTOs/SeriesMetadataDto.cs
+++ b/API/DTOs/SeriesMetadataDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs;
-public class SeriesMetadataDto
+public sealed record SeriesMetadataDto
{
public int Id { get; set; }
public string Summary { get; set; } = string.Empty;
diff --git a/API/DTOs/Settings/SMTPConfigDto.cs b/API/DTOs/Settings/SMTPConfigDto.cs
index 07cc58cb8..c14140062 100644
--- a/API/DTOs/Settings/SMTPConfigDto.cs
+++ b/API/DTOs/Settings/SMTPConfigDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Settings;
-public class SmtpConfigDto
+public sealed record SmtpConfigDto
{
public string SenderAddress { get; set; } = string.Empty;
public string SenderDisplayName { get; set; } = string.Empty;
diff --git a/API/DTOs/Settings/ServerSettingDTO.cs b/API/DTOs/Settings/ServerSettingDTO.cs
index 78db88d7d..372042250 100644
--- a/API/DTOs/Settings/ServerSettingDTO.cs
+++ b/API/DTOs/Settings/ServerSettingDTO.cs
@@ -6,7 +6,7 @@ using API.Services;
namespace API.DTOs.Settings;
#nullable enable
-public class ServerSettingDto
+public sealed record ServerSettingDto
{
public string CacheDirectory { get; set; } = default!;
diff --git a/API/DTOs/SideNav/BulkUpdateSideNavStreamVisibilityDto.cs b/API/DTOs/SideNav/BulkUpdateSideNavStreamVisibilityDto.cs
index 1b081913d..ae1d927a9 100644
--- a/API/DTOs/SideNav/BulkUpdateSideNavStreamVisibilityDto.cs
+++ b/API/DTOs/SideNav/BulkUpdateSideNavStreamVisibilityDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SideNav;
-public class BulkUpdateSideNavStreamVisibilityDto
+public sealed record BulkUpdateSideNavStreamVisibilityDto
{
public required IList Ids { get; set; }
public required bool Visibility { get; set; }
diff --git a/API/DTOs/SideNav/ExternalSourceDto.cs b/API/DTOs/SideNav/ExternalSourceDto.cs
index e9ae03066..382124e8a 100644
--- a/API/DTOs/SideNav/ExternalSourceDto.cs
+++ b/API/DTOs/SideNav/ExternalSourceDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.SideNav;
-public class ExternalSourceDto
+public sealed record ExternalSourceDto
{
public required int Id { get; set; } = 0;
public required string Name { get; set; }
diff --git a/API/DTOs/SideNav/SideNavStreamDto.cs b/API/DTOs/SideNav/SideNavStreamDto.cs
index fdef82a08..f4c196244 100644
--- a/API/DTOs/SideNav/SideNavStreamDto.cs
+++ b/API/DTOs/SideNav/SideNavStreamDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.SideNav;
#nullable enable
-public class SideNavStreamDto
+public sealed record SideNavStreamDto
{
public int Id { get; set; }
public required string Name { get; set; }
diff --git a/API/DTOs/Statistics/Count.cs b/API/DTOs/Statistics/Count.cs
index 411b44897..1577e682c 100644
--- a/API/DTOs/Statistics/Count.cs
+++ b/API/DTOs/Statistics/Count.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Statistics;
-public class StatCount : ICount
+public sealed record StatCount : ICount
{
public T Value { get; set; } = default!;
public long Count { get; set; }
diff --git a/API/DTOs/Statistics/FileExtensionBreakdownDto.cs b/API/DTOs/Statistics/FileExtensionBreakdownDto.cs
index 1f122d992..7a248caef 100644
--- a/API/DTOs/Statistics/FileExtensionBreakdownDto.cs
+++ b/API/DTOs/Statistics/FileExtensionBreakdownDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.Statistics;
#nullable enable
-public class FileExtensionDto
+public sealed record FileExtensionDto
{
public string? Extension { get; set; }
public MangaFormat Format { get; set; }
@@ -12,7 +12,7 @@ public class FileExtensionDto
public long TotalFiles { get; set; }
}
-public class FileExtensionBreakdownDto
+public sealed record FileExtensionBreakdownDto
{
///
/// Total bytes for all files
diff --git a/API/DTOs/Statistics/PagesReadOnADayCount.cs b/API/DTOs/Statistics/PagesReadOnADayCount.cs
index b1a6bb1ea..fc56d9cc0 100644
--- a/API/DTOs/Statistics/PagesReadOnADayCount.cs
+++ b/API/DTOs/Statistics/PagesReadOnADayCount.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Statistics;
-public class PagesReadOnADayCount : ICount
+public sealed record PagesReadOnADayCount : ICount
{
///
/// The day of the readings
diff --git a/API/DTOs/Statistics/ReadHistoryEvent.cs b/API/DTOs/Statistics/ReadHistoryEvent.cs
index 496148789..5d8262aef 100644
--- a/API/DTOs/Statistics/ReadHistoryEvent.cs
+++ b/API/DTOs/Statistics/ReadHistoryEvent.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Statistics;
///
/// Represents a single User's reading event
///
-public class ReadHistoryEvent
+public sealed record ReadHistoryEvent
{
public int UserId { get; set; }
public required string? UserName { get; set; } = default!;
diff --git a/API/DTOs/Statistics/ServerStatisticsDto.cs b/API/DTOs/Statistics/ServerStatisticsDto.cs
index 57fd5abce..3d22d9a56 100644
--- a/API/DTOs/Statistics/ServerStatisticsDto.cs
+++ b/API/DTOs/Statistics/ServerStatisticsDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs.Statistics;
#nullable enable
-public class ServerStatisticsDto
+public sealed record ServerStatisticsDto
{
public long ChapterCount { get; set; }
public long VolumeCount { get; set; }
diff --git a/API/DTOs/Statistics/TopReadsDto.cs b/API/DTOs/Statistics/TopReadsDto.cs
index 806360533..d11594dca 100644
--- a/API/DTOs/Statistics/TopReadsDto.cs
+++ b/API/DTOs/Statistics/TopReadsDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs.Statistics;
#nullable enable
-public class TopReadDto
+public sealed record TopReadDto
{
public int UserId { get; set; }
public string? Username { get; set; } = default!;
diff --git a/API/DTOs/Statistics/UserReadStatistics.cs b/API/DTOs/Statistics/UserReadStatistics.cs
index 5da4b491e..5c6935c6e 100644
--- a/API/DTOs/Statistics/UserReadStatistics.cs
+++ b/API/DTOs/Statistics/UserReadStatistics.cs
@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace API.DTOs.Statistics;
#nullable enable
-public class UserReadStatistics
+public sealed record UserReadStatistics
{
///
/// Total number of pages read
diff --git a/API/DTOs/Stats/FileExtensionExportDto.cs b/API/DTOs/Stats/FileExtensionExportDto.cs
index 6ed554d75..e881960a5 100644
--- a/API/DTOs/Stats/FileExtensionExportDto.cs
+++ b/API/DTOs/Stats/FileExtensionExportDto.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.Stats;
///
/// Excel export for File Extension Report
///
-public class FileExtensionExportDto
+public sealed record FileExtensionExportDto
{
[Name("Path")]
public string FilePath { get; set; }
diff --git a/API/DTOs/Stats/ServerInfoSlimDto.cs b/API/DTOs/Stats/ServerInfoSlimDto.cs
index 0b47fa2f3..f1abb2e1d 100644
--- a/API/DTOs/Stats/ServerInfoSlimDto.cs
+++ b/API/DTOs/Stats/ServerInfoSlimDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Stats;
///
/// This is just for the Server tab on UI
///
-public class ServerInfoSlimDto
+public sealed record ServerInfoSlimDto
{
///
/// Unique Id that represents a unique install
diff --git a/API/DTOs/Stats/V3/LibraryStatV3.cs b/API/DTOs/Stats/V3/LibraryStatV3.cs
index 51af34b58..33ac86d2b 100644
--- a/API/DTOs/Stats/V3/LibraryStatV3.cs
+++ b/API/DTOs/Stats/V3/LibraryStatV3.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs.Stats.V3;
-public class LibraryStatV3
+public sealed record LibraryStatV3
{
public bool IncludeInDashboard { get; set; }
public bool IncludeInSearch { get; set; }
diff --git a/API/DTOs/Stats/V3/RelationshipStatV3.cs b/API/DTOs/Stats/V3/RelationshipStatV3.cs
index e8e1e7440..37b63cb9a 100644
--- a/API/DTOs/Stats/V3/RelationshipStatV3.cs
+++ b/API/DTOs/Stats/V3/RelationshipStatV3.cs
@@ -5,7 +5,7 @@ namespace API.DTOs.Stats.V3;
///
/// KavitaStats - Information about Series Relationships
///
-public class RelationshipStatV3
+public sealed record RelationshipStatV3
{
public int Count { get; set; }
public RelationKind Relationship { get; set; }
diff --git a/API/DTOs/Stats/V3/ServerInfoV3Dto.cs b/API/DTOs/Stats/V3/ServerInfoV3Dto.cs
index 0bf95403f..8ed3079f5 100644
--- a/API/DTOs/Stats/V3/ServerInfoV3Dto.cs
+++ b/API/DTOs/Stats/V3/ServerInfoV3Dto.cs
@@ -7,7 +7,7 @@ namespace API.DTOs.Stats.V3;
///
/// Represents information about a Kavita Installation for Kavita Stats v3 API
///
-public class ServerInfoV3Dto
+public sealed record ServerInfoV3Dto
{
///
/// Unique Id that represents a unique install
diff --git a/API/DTOs/Stats/V3/UserStatV3.cs b/API/DTOs/Stats/V3/UserStatV3.cs
index 7f4e080ba..450a2e409 100644
--- a/API/DTOs/Stats/V3/UserStatV3.cs
+++ b/API/DTOs/Stats/V3/UserStatV3.cs
@@ -5,7 +5,7 @@ using API.Entities.Enums.Device;
namespace API.DTOs.Stats.V3;
-public class UserStatV3
+public sealed record UserStatV3
{
public AgeRestriction AgeRestriction { get; set; }
///
diff --git a/API/DTOs/System/DirectoryDto.cs b/API/DTOs/System/DirectoryDto.cs
index e6e94f4e4..3b1408f7f 100644
--- a/API/DTOs/System/DirectoryDto.cs
+++ b/API/DTOs/System/DirectoryDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.System;
-public class DirectoryDto
+public sealed record DirectoryDto
{
///
/// Name of the directory
diff --git a/API/DTOs/Theme/ColorScapeDto.cs b/API/DTOs/Theme/ColorScapeDto.cs
index 066e87d84..2ebd96e2b 100644
--- a/API/DTOs/Theme/ColorScapeDto.cs
+++ b/API/DTOs/Theme/ColorScapeDto.cs
@@ -4,7 +4,7 @@
///
/// A set of colors for the color scape system in the UI
///
-public class ColorScapeDto
+public sealed record ColorScapeDto
{
public string? Primary { get; set; }
public string? Secondary { get; set; }
diff --git a/API/DTOs/Theme/DownloadableSiteThemeDto.cs b/API/DTOs/Theme/DownloadableSiteThemeDto.cs
index dbcedfe61..b27263d92 100644
--- a/API/DTOs/Theme/DownloadableSiteThemeDto.cs
+++ b/API/DTOs/Theme/DownloadableSiteThemeDto.cs
@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace API.DTOs.Theme;
-public class DownloadableSiteThemeDto
+public sealed record DownloadableSiteThemeDto
{
///
/// Theme Name
diff --git a/API/DTOs/Theme/SiteThemeDto.cs b/API/DTOs/Theme/SiteThemeDto.cs
index eb2a14904..7ae8369e9 100644
--- a/API/DTOs/Theme/SiteThemeDto.cs
+++ b/API/DTOs/Theme/SiteThemeDto.cs
@@ -7,7 +7,7 @@ namespace API.DTOs.Theme;
///
/// Represents a set of css overrides the user can upload to Kavita and will load into webui
///
-public class SiteThemeDto
+public sealed record SiteThemeDto
{
public int Id { get; set; }
///
diff --git a/API/DTOs/Theme/UpdateDefaultThemeDto.cs b/API/DTOs/Theme/UpdateDefaultThemeDto.cs
index 0f2b129f3..aac0858c3 100644
--- a/API/DTOs/Theme/UpdateDefaultThemeDto.cs
+++ b/API/DTOs/Theme/UpdateDefaultThemeDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Theme;
-public class UpdateDefaultThemeDto
+public sealed record UpdateDefaultThemeDto
{
public int ThemeId { get; set; }
}
diff --git a/API/DTOs/Update/UpdateNotificationDto.cs b/API/DTOs/Update/UpdateNotificationDto.cs
index 2f9550746..b535684f0 100644
--- a/API/DTOs/Update/UpdateNotificationDto.cs
+++ b/API/DTOs/Update/UpdateNotificationDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.Update;
///
/// Update Notification denoting a new release available for user to update to
///
-public class UpdateNotificationDto
+public sealed record UpdateNotificationDto
{
///
/// Current installed Version
diff --git a/API/DTOs/UpdateChapterDto.cs b/API/DTOs/UpdateChapterDto.cs
index 2ca0a12a9..ec2f1cf62 100644
--- a/API/DTOs/UpdateChapterDto.cs
+++ b/API/DTOs/UpdateChapterDto.cs
@@ -5,7 +5,7 @@ using API.Entities.Enums;
namespace API.DTOs;
-public class UpdateChapterDto
+public sealed record UpdateChapterDto
{
public int Id { get; init; }
public string Summary { get; set; } = string.Empty;
diff --git a/API/DTOs/UpdateLibraryDto.cs b/API/DTOs/UpdateLibraryDto.cs
index de02f304d..9bd47fd39 100644
--- a/API/DTOs/UpdateLibraryDto.cs
+++ b/API/DTOs/UpdateLibraryDto.cs
@@ -4,7 +4,7 @@ using API.Entities.Enums;
namespace API.DTOs;
-public class UpdateLibraryDto
+public sealed record UpdateLibraryDto
{
[Required]
public int Id { get; init; }
diff --git a/API/DTOs/UpdateLibraryForUserDto.cs b/API/DTOs/UpdateLibraryForUserDto.cs
index c90b697e2..4ce8d0df8 100644
--- a/API/DTOs/UpdateLibraryForUserDto.cs
+++ b/API/DTOs/UpdateLibraryForUserDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs;
-public class UpdateLibraryForUserDto
+public sealed record UpdateLibraryForUserDto
{
public required string Username { get; init; }
public required IEnumerable SelectedLibraries { get; init; } = new List();
diff --git a/API/DTOs/UpdateRBSDto.cs b/API/DTOs/UpdateRBSDto.cs
index a7e0c3fc9..fa8bb78f9 100644
--- a/API/DTOs/UpdateRBSDto.cs
+++ b/API/DTOs/UpdateRBSDto.cs
@@ -3,7 +3,7 @@
namespace API.DTOs;
#nullable enable
-public class UpdateRbsDto
+public sealed record UpdateRbsDto
{
public required string Username { get; init; }
public IList? Roles { get; init; }
diff --git a/API/DTOs/UpdateRatingDto.cs b/API/DTOs/UpdateRatingDto.cs
index f462fdc2b..472a94fe9 100644
--- a/API/DTOs/UpdateRatingDto.cs
+++ b/API/DTOs/UpdateRatingDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs;
-public class UpdateRatingDto
+public sealed record UpdateRatingDto
{
public int SeriesId { get; init; }
public int? ChapterId { get; init; }
diff --git a/API/DTOs/UpdateSeriesDto.cs b/API/DTOs/UpdateSeriesDto.cs
index ab4ffcb22..a4a9baf8c 100644
--- a/API/DTOs/UpdateSeriesDto.cs
+++ b/API/DTOs/UpdateSeriesDto.cs
@@ -1,7 +1,7 @@
namespace API.DTOs;
#nullable enable
-public class UpdateSeriesDto
+public sealed record UpdateSeriesDto
{
public int Id { get; init; }
public string? LocalizedName { get; init; }
diff --git a/API/DTOs/UpdateSeriesMetadataDto.cs b/API/DTOs/UpdateSeriesMetadataDto.cs
index 75150b3fa..5225f5486 100644
--- a/API/DTOs/UpdateSeriesMetadataDto.cs
+++ b/API/DTOs/UpdateSeriesMetadataDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs;
-public class UpdateSeriesMetadataDto
+public sealed record UpdateSeriesMetadataDto
{
public SeriesMetadataDto SeriesMetadata { get; set; } = null!;
}
diff --git a/API/DTOs/Uploads/UploadFileDto.cs b/API/DTOs/Uploads/UploadFileDto.cs
index 72fe7da9b..8d5cdf4cb 100644
--- a/API/DTOs/Uploads/UploadFileDto.cs
+++ b/API/DTOs/Uploads/UploadFileDto.cs
@@ -1,6 +1,6 @@
namespace API.DTOs.Uploads;
-public class UploadFileDto
+public sealed record UploadFileDto
{
///
/// Id of the Entity
diff --git a/API/DTOs/Uploads/UploadUrlDto.cs b/API/DTOs/Uploads/UploadUrlDto.cs
index f2699befd..3f4e625c3 100644
--- a/API/DTOs/Uploads/UploadUrlDto.cs
+++ b/API/DTOs/Uploads/UploadUrlDto.cs
@@ -2,7 +2,7 @@
namespace API.DTOs.Uploads;
-public class UploadUrlDto
+public sealed record UploadUrlDto
{
///
/// External url
diff --git a/API/DTOs/UserDto.cs b/API/DTOs/UserDto.cs
index e89e17df9..88dc97a5d 100644
--- a/API/DTOs/UserDto.cs
+++ b/API/DTOs/UserDto.cs
@@ -5,7 +5,7 @@ using API.DTOs.Account;
namespace API.DTOs;
#nullable enable
-public class UserDto
+public sealed record UserDto
{
public string Username { get; init; } = null!;
public string Email { get; init; } = null!;
diff --git a/API/DTOs/UserPreferencesDto.cs b/API/DTOs/UserPreferencesDto.cs
index 14987ae77..b550c829c 100644
--- a/API/DTOs/UserPreferencesDto.cs
+++ b/API/DTOs/UserPreferencesDto.cs
@@ -7,7 +7,7 @@ using API.Entities.Enums.UserPreferences;
namespace API.DTOs;
#nullable enable
-public class UserPreferencesDto
+public sealed record UserPreferencesDto
{
///
/// Manga Reader Option: What direction should the next/prev page buttons go
diff --git a/API/DTOs/VolumeDto.cs b/API/DTOs/VolumeDto.cs
index 8ef22a93b..acb552f0f 100644
--- a/API/DTOs/VolumeDto.cs
+++ b/API/DTOs/VolumeDto.cs
@@ -8,7 +8,7 @@ using API.Services.Tasks.Scanner.Parser;
namespace API.DTOs;
-public class VolumeDto : IHasReadTimeEstimate, IHasCoverImage
+public sealed record VolumeDto : IHasReadTimeEstimate, IHasCoverImage
{
public int Id { get; set; }
///
diff --git a/API/DTOs/WantToRead/UpdateWantToReadDto.cs b/API/DTOs/WantToRead/UpdateWantToReadDto.cs
index f1b38cea2..a5be26857 100644
--- a/API/DTOs/WantToRead/UpdateWantToReadDto.cs
+++ b/API/DTOs/WantToRead/UpdateWantToReadDto.cs
@@ -6,7 +6,7 @@ namespace API.DTOs.WantToRead;
///
/// A list of Series to pass when working with Want To Read APIs
///
-public class UpdateWantToReadDto
+public sealed record UpdateWantToReadDto
{
///
/// List of Series Ids that will be Added/Removed
diff --git a/API/Data/Repositories/SeriesRepository.cs b/API/Data/Repositories/SeriesRepository.cs
index 948f35a68..d9c78c770 100644
--- a/API/Data/Repositories/SeriesRepository.cs
+++ b/API/Data/Repositories/SeriesRepository.cs
@@ -13,6 +13,7 @@ using API.DTOs.CollectionTags;
using API.DTOs.Dashboard;
using API.DTOs.Filtering;
using API.DTOs.Filtering.v2;
+using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Metadata;
using API.DTOs.ReadingLists;
using API.DTOs.Recommendation;
diff --git a/API/Entities/Metadata/ExternalRating.cs b/API/Entities/Metadata/ExternalRating.cs
index 9922c7f80..7fc2b9353 100644
--- a/API/Entities/Metadata/ExternalRating.cs
+++ b/API/Entities/Metadata/ExternalRating.cs
@@ -11,6 +11,9 @@ public class ExternalRating
public int AverageScore { get; set; }
public int FavoriteCount { get; set; }
public ScrobbleProvider Provider { get; set; }
+ ///
+ /// Where this rating comes from: Critic or User
+ ///
public RatingAuthority Authority { get; set; } = RatingAuthority.User;
public string? ProviderUrl { get; set; }
public int SeriesId { get; set; }
diff --git a/API/Services/Plus/WantToReadSyncService.cs b/API/Services/Plus/WantToReadSyncService.cs
index 07861710c..a6d536911 100644
--- a/API/Services/Plus/WantToReadSyncService.cs
+++ b/API/Services/Plus/WantToReadSyncService.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using API.Data;
using API.Data.Repositories;
+using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Recommendation;
using API.DTOs.SeriesDetail;
using API.Entities;
diff --git a/API/Startup.cs b/API/Startup.cs
index 188c2b2dd..34af22154 100644
--- a/API/Startup.cs
+++ b/API/Startup.cs
@@ -138,8 +138,8 @@ public class Startup
{
c.SwaggerDoc("v1", new OpenApiInfo
{
- Version = "3.1.0",
- Title = $"Kavita (v{BuildInfo.Version})",
+ Version = BuildInfo.Version.ToString(),
+ Title = $"Kavita",
Description = $"Kavita provides a set of APIs that are authenticated by JWT. JWT token can be copied from local storage. Assume all fields of a payload are required. Built against v{BuildInfo.Version}",
License = new OpenApiLicense
{