Kavita/API/DTOs/OPDS/Feed.cs
Joseph Milazzo fb71d54fe6
Misc Fixes and Changes (#927)
* Cleaned up a ton of warnings/suggestions from the IDE.

* Fixed a bug when clearing the filters some presets could be undone.

* Renamed a class in the OPDS spec

* Simplified logic for when Fit To Screen rendering logic occurs. It now works always rather than only on cover images.

* Give some additional info to the user on what the differences between Library Types are

* Don't scan .qpkg folders (QNAP devices)

* Refactored some code to enable ability to test CoverImage Test. This is a broken test, test.zip is waiting on an issue in NetVips.

* Fixed an issue where Extra might get flagged as special too early, if in a word like Extraordinary

* Cleaned up the regex for the extra issue to be more flexible
2022-01-12 15:00:00 -08:00

63 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace API.DTOs.OPDS
{
/// <summary>
///
/// </summary>
[XmlRoot("feed", Namespace = "http://www.w3.org/2005/Atom")]
public class Feed
{
[XmlElement("updated")]
public string Updated { get; init; } = DateTime.UtcNow.ToString("s");
[XmlElement("id")]
public string Id { get; set; }
[XmlElement("title")]
public string Title { get; set; }
[XmlElement("icon")]
public string Icon { get; set; } = "/favicon.ico";
[XmlElement("author")]
public FeedAuthor Author { get; set; } = new FeedAuthor()
{
Name = "Kavita",
Uri = "https://kavitareader.com"
};
[XmlElement("totalResults", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? Total { get; set; } = null;
[XmlElement("itemsPerPage", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? ItemsPerPage { get; set; } = null;
[XmlElement("startIndex", Namespace = "http://a9.com/-/spec/opensearch/1.1/")]
public int? StartIndex { get; set; } = null;
[XmlElement("link")]
public List<FeedLink> Links { get; set; } = new List<FeedLink>() ;
[XmlElement("entry")]
public List<FeedEntry> Entries { get; set; } = new List<FeedEntry>();
public bool ShouldSerializeTotal()
{
return Total.HasValue;
}
public bool ShouldSerializeItemsPerPage()
{
return ItemsPerPage.HasValue;
}
public bool ShouldSerializeStartIndex()
{
return StartIndex.HasValue;
}
}
}