Kavita+ Overhaul & New Changelog (#3507)

This commit is contained in:
Joe Milazzo 2025-01-20 08:14:57 -06:00 committed by GitHub
parent d880c1690c
commit a5707617f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
249 changed files with 14775 additions and 2300 deletions

View file

@ -0,0 +1,14 @@
using System;
namespace API.DTOs.Email;
public class EmailHistoryDto
{
public long Id { get; set; }
public bool Sent { get; set; }
public DateTime SendDate { get; set; } = DateTime.UtcNow;
public string EmailTemplate { get; set; }
public string ErrorMessage { get; set; }
public string ToUserName { get; set; }
}

View file

@ -1,4 +1,4 @@
namespace API.DTOs.Account;
namespace API.DTOs.KavitaPlus.Account;
public class AniListUpdateDto
{

View file

@ -0,0 +1,16 @@
using System;
namespace API.DTOs.KavitaPlus.Account;
/// <summary>
/// Represents information around a user's tokens and their status
/// </summary>
public class UserTokenInfo
{
public int UserId { get; set; }
public string Username { get; set; }
public bool IsAniListTokenSet { get; set; }
public bool IsAniListTokenValid { get; set; }
public DateTime AniListValidUntilUtc { get; set; }
public bool IsMalTokenSet { get; set; }
}

View file

@ -0,0 +1,16 @@
using API.DTOs.Scrobbling;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
/// <summary>
/// Used for matching and fetching metadata on a series
/// </summary>
internal class ExternalMetadataIdsDto
{
public long? MalId { get; set; }
public int? AniListId { get; set; }
public string? SeriesName { get; set; }
public string? LocalizedSeriesName { get; set; }
public PlusMediaFormat? PlusMediaFormat { get; set; } = DTOs.Scrobbling.PlusMediaFormat.Unknown;
}

View file

@ -0,0 +1,16 @@
using System.Collections.Generic;
using API.DTOs.Scrobbling;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
internal class MatchSeriesRequestDto
{
public string SeriesName { get; set; }
public ICollection<string> AlternativeNames { get; set; }
public int Year { get; set; } = 0;
public string Query { get; set; }
public int? AniListId { get; set; }
public long? MalId { get; set; }
public string? HardcoverId { get; set; }
public PlusMediaFormat Format { get; set; }
}

View file

@ -0,0 +1,14 @@
using System.Collections.Generic;
using API.DTOs.Scrobbling;
using API.DTOs.SeriesDetail;
namespace API.DTOs.KavitaPlus.ExternalMetadata;
internal class SeriesDetailPlusApiDto
{
public IEnumerable<MediaRecommendationDto> Recommendations { get; set; }
public IEnumerable<UserReviewDto> Reviews { get; set; }
public IEnumerable<RatingDto> Ratings { get; set; }
public int? AniListId { get; set; }
public long? MalId { get; set; }
}

View file

@ -1,4 +1,4 @@
namespace API.DTOs.License;
namespace API.DTOs.KavitaPlus.License;
public class EncryptLicenseDto
{

View file

@ -0,0 +1,35 @@
using System;
namespace API.DTOs.KavitaPlus.License;
public class LicenseInfoDto
{
/// <summary>
/// If cancelled, will represent cancellation date. If not, will represent repayment date
/// </summary>
public DateTime ExpirationDate { get; set; }
/// <summary>
/// If cancelled or not
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// If will be or is cancelled
/// </summary>
public bool IsCancelled { get; set; }
/// <summary>
/// Is the installed version valid for Kavita+ (aka within 3 releases)
/// </summary>
public bool IsValidVersion { get; set; }
/// <summary>
/// The email on file
/// </summary>
public string RegisteredEmail { get; set; }
/// <summary>
/// Number of months user has been subscribed
/// </summary>
public int TotalMonthsSubbed { get; set; }
/// <summary>
/// A license is stored within Kavita
/// </summary>
public bool HasLicense { get; set; }
}

View file

@ -1,4 +1,4 @@
namespace API.DTOs.Account;
namespace API.DTOs.KavitaPlus.License;
public class LicenseValidDto
{

View file

@ -1,4 +1,4 @@
namespace API.DTOs.License;
namespace API.DTOs.KavitaPlus.License;
public class ResetLicenseDto
{

View file

@ -1,4 +1,4 @@
namespace API.DTOs.License;
namespace API.DTOs.KavitaPlus.License;
public class UpdateLicenseDto
{

View file

@ -0,0 +1,19 @@
namespace API.DTOs.KavitaPlus.Manage;
/// <summary>
/// Represents an option in the UI layer for Filtering
/// </summary>
public enum MatchStateOption
{
All = 0,
Matched = 1,
NotMatched = 2,
Error = 3,
DontMatch = 4
}
public class ManageMatchFilterDto
{
public MatchStateOption MatchStateOption { get; set; } = MatchStateOption.All;
public string SearchTerm { get; set; } = string.Empty;
}

View file

@ -0,0 +1,10 @@
using System;
namespace API.DTOs.KavitaPlus.Manage;
public class ManageMatchSeriesDto
{
public SeriesDto Series { get; set; }
public bool IsMatched { get; set; }
public DateTime ValidUntilUtc { get; set; }
}

View file

@ -0,0 +1,9 @@
using API.DTOs.Recommendation;
namespace API.DTOs.Metadata.Matching;
public class ExternalSeriesMatchDto
{
public ExternalSeriesDetailDto Series { get; set; }
public float MatchRating { get; set; }
}

View file

@ -0,0 +1,20 @@
namespace API.DTOs.Metadata.Matching;
/// <summary>
/// Used for matching a series with Kavita+ for metadata and scrobbling
/// </summary>
public class MatchSeriesDto
{
/// <summary>
/// When set, Kavita will stop attempting to match this series and will not perform any scrobbling
/// </summary>
public bool DontMatch { get; set; }
/// <summary>
/// Series Id to pull internal metadata from to improve matching
/// </summary>
public int SeriesId { get; set; }
/// <summary>
/// Free form text to query for. Can be a url and ids will be parsed from it
/// </summary>
public string Query { get; set; }
}

View file

@ -11,7 +11,7 @@ public class ExternalSeriesDetailDto
public int? AniListId { get; set; }
public long? MALId { get; set; }
public IList<string> Synonyms { get; set; }
public MediaFormat PlusMediaFormat { get; set; }
public PlusMediaFormat PlusMediaFormat { get; set; }
public string? SiteUrl { get; set; }
public string? CoverUrl { get; set; }
public IList<string> Genres { get; set; }

View file

@ -12,4 +12,6 @@ public class ExternalSeriesDto
public int? AniListId { get; set; }
public long? MalId { get; set; }
public ScrobbleProvider Provider { get; set; } = ScrobbleProvider.AniList;
}

View file

@ -8,7 +8,7 @@ public record PlusSeriesDto
public string? MangaDexId { get; set; }
public string SeriesName { get; set; }
public string? AltSeriesName { get; set; }
public MediaFormat MediaFormat { get; set; }
public PlusMediaFormat MediaFormat { get; set; }
/// <summary>
/// Optional but can help with matching
/// </summary>

View file

@ -22,7 +22,7 @@ public enum ScrobbleEventType
/// <summary>
/// Represents PlusMediaFormat
/// </summary>
public enum MediaFormat
public enum PlusMediaFormat
{
[Description("Manga")]
Manga = 1,
@ -44,7 +44,7 @@ public class ScrobbleDto
public string AniListToken { get; set; }
public string SeriesName { get; set; }
public string LocalizedSeriesName { get; set; }
public MediaFormat Format { get; set; }
public PlusMediaFormat Format { get; set; }
public int? Year { get; set; }
/// <summary>
/// Optional AniListId if present on Kavita's WebLinks

View file

@ -67,6 +67,16 @@ public class SeriesDto : IHasReadTimeEstimate, IHasCoverImage
/// The last time the folder for this series was scanned
/// </summary>
public DateTime LastFolderScanned { get; set; }
#region KavitaPlus
/// <summary>
/// Do not match the series with any external Metadata service. This will automatically opt it out of scrobbling.
/// </summary>
public bool DontMatch { get; set; }
/// <summary>
/// If the series was unable to match, it will be blacklisted until a manual metadata match overrides it
/// </summary>
public bool IsBlacklisted { get; set; }
#endregion
public string? CoverImage { get; set; }
public string PrimaryColor { get; set; }

View file

@ -1,4 +1,7 @@
namespace API.DTOs.Update;
using System.Collections.Generic;
using System.Runtime.InteropServices.JavaScript;
namespace API.DTOs.Update;
/// <summary>
/// Update Notification denoting a new release available for user to update to
@ -21,11 +24,11 @@ public class UpdateNotificationDto
/// <summary>
/// Title of the release
/// </summary>
public required string UpdateTitle { get; init; }
public required string UpdateTitle { get; set; }
/// <summary>
/// Github Url
/// </summary>
public required string UpdateUrl { get; init; }
public required string UpdateUrl { get; set; }
/// <summary>
/// If this install is within Docker
/// </summary>
@ -37,7 +40,8 @@ public class UpdateNotificationDto
/// <summary>
/// Date of the publish
/// </summary>
public required string PublishDate { get; init; }
public required string PublishDate { get; set
; }
/// <summary>
/// Is the server on a nightly within this release
/// </summary>
@ -50,4 +54,16 @@ public class UpdateNotificationDto
/// Is the server on this version
/// </summary>
public bool IsReleaseEqual { get; set; }
public IList<string> Added { get; set; }
public IList<string> Removed { get; set; }
public IList<string> Changed { get; set; }
public IList<string> Fixed { get; set; }
public IList<string> Theme { get; set; }
public IList<string> Developer { get; set; }
public IList<string> Api { get; set; }
/// <summary>
/// The part above the changelog part
/// </summary>
public string BlogPart { get; set; }
}