Kavita/API/DTOs/Scrobbling/ScrobbleDto.cs
Joe Milazzo a0a6da9c60
Personal Table of Contents (#2148)
* Fixed a bad default setting for token key

* Changed the payment link to support Google Pay

* Fixed duplicate events occurring on newly added series from a scan.

Fixed the version update code from not firing and made it check every 4-6 hours (random per user per restart)

* Check for new releases on startup as well.

Added Personal Table of Contents (called Bookmarks on epub and pdf reader). The idea is that sometimes you want to bookmark certain parts of pages to get back to quickly later. This mechanism will allow you to do that without having to edit the underlying ToC.

* Added a button to update modal to show how to update for those unaware.

* Darkened the link text within tables to be more visible.

* Update link for how to update now is dynamic for docker users

* Refactored to send proper star/end dates for scrobble read events for upcoming changes in the API.

Added GoogleBooks Rating UI code if I go forward with API changes.

* When Scrobbling, send when the first and last progress for the series was.

Added OpenLibrary icon for upcoming enhancements for Kavita+.

Changed the Update checker to execute at start.

* Fixed backups not saving favicons in the correct place

* Refactored the layout code for Personal ToC

* More bugfixes around toc

* Box alignment

* Fixed up closing the overlay when bookmark mode is active

* Fixed up closing the overlay when bookmark mode is active

---------

Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
2023-07-21 15:29:35 -07:00

82 lines
2.4 KiB
C#

using System;
using System.ComponentModel;
namespace API.DTOs.Scrobbling;
#nullable enable
public enum ScrobbleEventType
{
[Description("Chapter Read")]
ChapterRead = 0,
[Description("Add to Want to Read")]
AddWantToRead = 1,
[Description("Remove from Want to Read")]
RemoveWantToRead = 2,
[Description("Score Updated")]
ScoreUpdated = 3,
[Description("Review Added/Updated")]
Review = 4
}
public enum MediaFormat
{
Manga = 1,
Comic = 2,
LightNovel = 3,
Book = 4
}
public class ScrobbleDto
{
/// <summary>
/// User's access token to allow us to talk on their behalf
/// </summary>
public string AniListToken { get; set; }
public string SeriesName { get; set; }
public string LocalizedSeriesName { get; set; }
public MediaFormat Format { get; set; }
public int? Year { get; set; }
/// <summary>
/// Optional AniListId if present on Kavita's WebLinks
/// </summary>
public int? AniListId { get; set; } = 0;
public int? MALId { get; set; } = 0;
public string BakaUpdatesId { get; set; } = string.Empty;
public ScrobbleEventType ScrobbleEventType { get; set; }
/// <summary>
/// Number of chapters read
/// </summary>
/// <remarks>If completed series, this can consider the Series Read (AniList)</remarks>
public int? ChapterNumber { get; set; }
/// <summary>
/// Number of Volumes read
/// </summary>
/// <remarks>This will not consider the series Completed, even if all Volumes have been read (AniList)</remarks>
public int? VolumeNumber { get; set; }
/// <summary>
/// Rating for the Series
/// </summary>
public float? Rating { get; set; }
public string? ReviewTitle { get; set; }
public string? ReviewBody { get; set; }
/// <summary>
/// The date that the series was started reading. Will be null for non ReadingProgress events
/// </summary>
public DateTime? StartedReadingDateUtc { get; set; }
/// <summary>
/// The latest date the series was read. Will be null for non ReadingProgress events
/// </summary>
public DateTime? LatestReadingDateUtc { get; set; }
/// <summary>
/// The date that the series was scrobbled. Will be null for non ReadingProgress events
/// </summary>
public DateTime? ScrobbleDateUtc { get; set; }
/// <summary>
/// Optional but can help with matching
/// </summary>
public string? Isbn { get; set; }
}