OPDS-PS v1.2 Support + a few bugfixes (#1869)

* Fixed up a localization lookup test case

* Refactored some webp to a unified method

* Cleaned up some code

* Expanded webp conversion for covers to all entities

* Code cleanup

* Prompt the user when they are about to delete multiple series via bulk actions

* Aligned Kavita to OPDS-PS 1.2.

* Fixed a bug where clearing metadata filter of series name didn't clear the actual field.

* Added some documentation

* Refactored how covert covers to webp works. Now we will handle all custom covers for all entities. Volumes and Series will not be touched but instead be updated via a RefreshCovers call. This will fix up the references much faster.

* Fixed up the OPDS-PS 1.2 attributes to only show on PS links
This commit is contained in:
Joe Milazzo 2023-03-09 18:41:42 -06:00 committed by GitHub
parent 1f34068662
commit 47269b4c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 334 additions and 99 deletions

View file

@ -26,7 +26,7 @@ public class Feed
public FeedAuthor Author { get; set; } = new FeedAuthor()
{
Name = "Kavita",
Uri = "https://kavitareader.com"
Uri = "https://www.kavitareader.com"
};
[XmlElement("totalResults", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]

View file

@ -1,9 +1,12 @@
using System.Xml.Serialization;
using System;
using System.Xml.Serialization;
namespace API.DTOs.OPDS;
public class FeedLink
{
[XmlIgnore]
public bool IsPageStream { get; set; }
/// <summary>
/// Relation on the Link
/// </summary>
@ -25,6 +28,34 @@ public class FeedLink
[XmlAttribute("count", Namespace = "http://vaemendis.net/opds-pse/ns")]
public int TotalPages { get; set; }
/// <summary>
/// lastRead MUST provide the last page read for this document. The numbering starts at 1.
/// </summary>
[XmlAttribute("lastRead", Namespace = "http://vaemendis.net/opds-pse/ns")]
public int LastRead { get; set; } = -1;
/// <summary>
/// lastReadDate MAY provide the date of when the lastRead attribute was last updated.
/// </summary>
/// <remarks>Attribute MUST conform Atom's Date construct</remarks>
[XmlAttribute("lastReadDate", Namespace = "http://vaemendis.net/opds-pse/ns")]
public DateTime LastReadDate { get; set; }
public bool ShouldSerializeLastReadDate()
{
return IsPageStream;
}
public bool ShouldSerializeLastRead()
{
return LastRead >= 0;
}
public bool ShouldSerializeTitle()
{
return !string.IsNullOrEmpty(Title);
}
public bool ShouldSerializeTotalPages()
{
return TotalPages > 0;

View file

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.ComponentModel.DataAnnotations;
namespace API.DTOs;
@ -19,4 +20,6 @@ public class ProgressDto
/// on pages that combine multiple "chapters".
/// </summary>
public string? BookScrollId { get; set; }
public DateTime LastModifiedUtc { get; set; }
}

View file

@ -46,10 +46,10 @@ public class UserPreferencesDto
/// </summary>
[Required]
public string BackgroundColor { get; set; } = "#000000";
[Required]
/// <summary>
/// Manga Reader Option: Should swiping trigger pagination
/// </summary>
[Required]
public bool SwipeToPaginate { get; set; }
/// <summary>
/// Manga Reader Option: Allow the menu to close after 6 seconds without interaction