quest-reader/Models/JsonFiles.cs

53 lines
1.6 KiB
C#
Raw Permalink Normal View History

2022-02-19 16:42:47 +00:00
namespace QuestReader.Models;
2022-02-15 18:38:47 +00:00
using System.Text.Json.Serialization;
2022-02-19 16:42:47 +00:00
using QuestReader.Models.ParsedContent;
2022-02-15 18:38:47 +00:00
public record ThreadPost
{
public int Id { get; set; }
public string Author { get; set; }
public string Uid { get; set; }
public string RawHtml { get; set; }
public RootNode? ParsedContent { get; set; }
2022-02-15 18:38:47 +00:00
public string? File { get; set; }
public string? Filename { get; set; }
public string? Title { get; set; }
public string? Tripcode { get; set; }
public DateTime Date { get; set; }
[JsonIgnore]
public bool IsChapterAnnounce { get; set; } = false;
[JsonIgnore]
2022-02-15 18:38:47 +00:00
public ChapterMetadata? Chapter { get; set; }
[JsonIgnore]
public bool AuthorPost { get; set; } = false;
[JsonIgnore]
public int? FileHeight { get; set; }
[JsonIgnore]
public int? FileWidth { get; set; }
2022-02-15 18:38:47 +00:00
}
public record Metadata
{
public string Name { get; set; }
public string Author { get; set; }
public Uri AuthorPage { get; set; }
public string? AuthorTwitter { get; set; }
public string? Description { get; set; }
2022-02-15 18:38:47 +00:00
public Uri AssetsBaseUrl { get; set; }
public string SocialPreview { get; set; }
public List<int> Threads { get; set; }
public List<ChapterMetadata> Chapters { get; set; }
public override string ToString() => $"\"{Name}\" by {Author}";
}
public record ChapterMetadata
{
public int Id { get; set; }
public string Name { get; set; }
public string Subtitle { get; set; }
public int Start { get; set; }
public int? Announce { get; set; }
public int End { get; set; }
}