Customized Scheduler + Saved Kavita+ Details (#2644)

This commit is contained in:
Joe Milazzo 2024-01-22 12:10:57 -06:00 committed by GitHub
parent 2092e120c3
commit ad74871623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 6076 additions and 3370 deletions

View file

@ -182,5 +182,9 @@ public enum ServerSettingKey
[Description("EmailCustomizedTemplates")]
EmailCustomizedTemplates = 36,
#endregion
/// <summary>
/// When the cleanup task should run - Critical to keeping Kavita working
/// </summary>
[Description("TaskCleanup")]
TaskCleanup = 37
}

View file

@ -0,0 +1,17 @@
using System.Collections.Generic;
using API.Services.Plus;
namespace API.Entities.Metadata;
public class ExternalRating
{
public int Id { get; set; }
public int AverageScore { get; set; }
public int FavoriteCount { get; set; }
public ScrobbleProvider Provider { get; set; }
public string? ProviderUrl { get; set; }
public int SeriesId { get; set; }
public ICollection<ExternalSeriesMetadata> ExternalSeriesMetadatas { get; set; } = null!;
}

View file

@ -0,0 +1,26 @@
using System.Collections.Generic;
using API.Services.Plus;
namespace API.Entities.Metadata;
public class ExternalRecommendation
{
public int Id { get; set; }
public required string Name { get; set; }
public required string CoverUrl { get; set; }
public required string Url { get; set; }
public string? Summary { get; set; }
public int? AniListId { get; set; }
public long? MalId { get; set; }
public ScrobbleProvider Provider { get; set; } = ScrobbleProvider.AniList;
/// <summary>
/// When null, represents an external series. When set, it is a Series
/// </summary>
public int? SeriesId { get; set; }
public virtual Series Series { get; set; }
// Relationships
public ICollection<ExternalSeriesMetadata> ExternalSeriesMetadatas { get; set; } = null!;
}

View file

@ -0,0 +1,43 @@
using System.Collections.Generic;
using API.Services.Plus;
namespace API.Entities.Metadata;
/// <summary>
/// Represents an Externally supplied Review for a given Series
/// </summary>
public class ExternalReview
{
public int Id { get; set; }
public string Tagline { get; set; }
public required string Body { get; set; }
/// <summary>
/// Pure text version of the body
/// </summary>
public required string BodyJustText { get; set; }
/// <summary>
/// Raw from the provider. Usually Markdown
/// </summary>
public string RawBody { get; set; }
public required ScrobbleProvider Provider { get; set; }
public string SiteUrl { get; set; }
/// <summary>
/// Reviewer's username
/// </summary>
public string Username { get; set; }
/// <summary>
/// An Optional Rating coming from the Review
/// </summary>
public int Rating { get; set; } = 0;
/// <summary>
/// The media's overall Score
/// </summary>
public int Score { get; set; }
public int TotalVotes { get; set; }
public int SeriesId { get; set; }
// Relationships
public ICollection<ExternalSeriesMetadata> ExternalSeriesMetadatas { get; set; } = null!;
}

View file

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
namespace API.Entities.Metadata;
/// <summary>
/// External Metadata from Kavita+ for a Series
/// </summary>
public class ExternalSeriesMetadata
{
public int Id { get; set; }
/// <summary>
/// External Reviews for the Series. Managed by Kavita for Kavita+ users
/// </summary>
public ICollection<ExternalReview> ExternalReviews { get; set; } = null!;
public ICollection<ExternalRating> ExternalRatings { get; set; } = null!;
/// <summary>
/// External recommendations will include all recommendations and will have a seriesId if it's on this Kavita instance.
/// </summary>
/// <remarks>Cleanup Service will perform matching to tie new series with recommendations</remarks>
public ICollection<ExternalRecommendation> ExternalRecommendations { get; set; } = null!;
/// <summary>
/// Average External Rating. -1 means not set
/// </summary>
public int AverageExternalRating { get; set; } = 0;
public int AniListId { get; set; }
public long MalId { get; set; }
public string GoogleBooksId { get; set; }
public DateTime LastUpdatedUtc { get; set; }
public Series Series { get; set; } = null!;
public int SeriesId { get; set; }
}

View file

@ -96,6 +96,7 @@ public class Series : IEntityDate, IHasReadTimeEstimate
public int AvgHoursToRead { get; set; }
public SeriesMetadata Metadata { get; set; } = null!;
public ExternalSeriesMetadata ExternalSeriesMetadata { get; set; } = null!;
public ICollection<AppUserRating> Ratings { get; set; } = null!;
public ICollection<AppUserProgress> Progress { get; set; } = null!;
@ -113,6 +114,7 @@ public class Series : IEntityDate, IHasReadTimeEstimate
public Library Library { get; set; } = null!;
public int LibraryId { get; set; }
public void UpdateLastFolderScanned()
{
LastFolderScanned = DateTime.Now;