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

@ -76,6 +76,8 @@ public class AppUser : IdentityUser<int>, IHasConcurrencyToken
/// </summary>
public string? MalAccessToken { get; set; }
/// <summary>
/// A list of Series the user doesn't want scrobbling for
/// </summary>

View file

@ -0,0 +1,31 @@
using System;
using API.Entities.Interfaces;
using Microsoft.EntityFrameworkCore;
namespace API.Entities;
/// <summary>
/// Records all emails that are sent from Kavita
/// </summary>
[Index("Sent", "AppUserId", "EmailTemplate", "SendDate")]
public class EmailHistory : IEntityDate
{
public long Id { get; set; }
public bool Sent { get; set; }
public DateTime SendDate { get; set; } = DateTime.UtcNow;
public string EmailTemplate { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public string DeliveryStatus { get; set; }
public string ErrorMessage { get; set; }
public int AppUserId { get; set; }
public virtual AppUser AppUser { get; set; }
public DateTime Created { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime LastModified { get; set; }
public DateTime LastModifiedUtc { get; set; }
}

View file

@ -0,0 +1,9 @@
namespace API.Entities.History;
/// <summary>
/// Records history of actions Kavita+ takes
/// </summary>
// public class KavitaPlusHistory
// {
//
// }

View file

@ -1,6 +1,6 @@
using System;
namespace API.Entities;
namespace API.Entities.History;
/// <summary>
/// This will track manual migrations so that I can use simple selects to check if a Manual Migration is needed

View file

@ -23,7 +23,7 @@ public class ExternalSeriesMetadata
/// <summary>
/// Average External Rating. -1 means not set, 0 - 100
/// </summary>
public int AverageExternalRating { get; set; } = 0;
public int AverageExternalRating { get; set; } = -1;
public int AniListId { get; set; }
public long MalId { get; set; }

View file

@ -5,10 +5,12 @@ namespace API.Entities.Metadata;
/// <summary>
/// A blacklist of Series for Kavita+
/// </summary>
[Obsolete("Kavita v0.8.5 moved the implementation to Series.IsBlacklisted")]
public class SeriesBlacklist
{
public int Id { get; set; }
public DateTime LastChecked { get; set; } = DateTime.UtcNow;
public int SeriesId { get; set; }
public Series Series { get; set; }
public DateTime LastChecked { get; set; } = DateTime.UtcNow;
}

View file

@ -28,7 +28,7 @@ public class ScrobbleEvent : IEntityDate
/// </summary>
public string? ReviewBody { get; set; }
public string? ReviewTitle { get; set; }
public required MediaFormat Format { get; set; }
public required PlusMediaFormat Format { get; set; }
/// <summary>
/// Depends on the ScrobbleEvent if filled in
/// </summary>

View file

@ -103,6 +103,17 @@ public class Series : IEntityDate, IHasReadTimeEstimate, IHasCoverImage
public int MaxHoursToRead { get; set; }
public float AvgHoursToRead { 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 SeriesMetadata Metadata { get; set; } = null!;
public ExternalSeriesMetadata ExternalSeriesMetadata { get; set; } = null!;
@ -151,4 +162,14 @@ public class Series : IEntityDate, IHasReadTimeEstimate, IHasCoverImage
PrimaryColor = string.Empty;
SecondaryColor = string.Empty;
}
/// <summary>
/// Is this Series capable of Scrobbling
/// </summary>
/// <remarks>This includes if there is no Match/Manual Match needed, the series is blacklisted, or has a NoMatch</remarks>
/// <returns></returns>
public bool WillScrobble()
{
return !IsBlacklisted && !DontMatch;
}
}