73 lines
3.1 KiB
C#

namespace PlotLine.Models;
public sealed class WriterWorkSession
{
public int ChangesDuringSession { get; set; }
public long AdditionsDuringSession { get; set; }
public long RemovalsDuringSession { get; set; }
public int ChangedParagraphs { get; set; }
public Guid SessionID { get; set; }
public int BookID { get; set; }
public int? ChapterID { get; set; }
public string? ChapterTitle { get; set; }
public long? StartRevision { get; set; }
public long? EndRevision { get; set; }
public int? StartParagraphCount { get; set; }
public int? EndParagraphCount { get; set; }
public string Kind { get; set; } = "Planning";
public DateTime StartedUtc { get; set; }
public DateTime? EndedUtc { get; set; }
public DateTime LastSeenUtc { get; set; }
public int EngagedSeconds { get; set; }
public double PlaybackSeconds { get; set; }
public double UniqueSeconds { get; set; }
public string RangesJson { get; set; } = "[]";
public bool CoveragePartial { get; set; }
public bool PauseOnEdit { get; set; } = true;
public string? Note { get; set; }
public long BrowserSequence { get; set; }
public long MediaSequence { get; set; }
public DateTime? MediaReceivedUtc { get; set; }
public string PlaybackState { get; set; } = "unavailable";
public double? PositionSeconds { get; set; }
public double? DurationSeconds { get; set; }
public double PlaybackRate { get; set; } = 1;
public string? MediaKey { get; set; }
public string? Capabilities { get; set; }
public Guid? NativeInstance { get; set; }
public Guid? NativeDocument { get; set; }
public string? NativeGrant { get; set; }
public Guid? CommandID { get; set; }
public string? Command { get; set; }
public DateTime? CommandUtc { get; set; }
public string? LastError { get; set; }
public int Pauses { get; set; }
public int Seeks { get; set; }
}
public sealed class WriterWorkDay
{
public DateTime Day { get; set; }
public long Added { get; set; }
public long Removed { get; set; }
public int Changes { get; set; }
public int Writing { get; set; }
public int Editing { get; set; }
public int Planning { get; set; }
public int Reading { get; set; }
public int AudioReview { get; set; }
public int EngagedSeconds { get; set; }
public double PlaybackSeconds { get; set; }
public int Intensity => Changes + Writing + Editing + Planning + Reading + AudioReview + (int)Math.Min(24, Math.Floor(Math.Max(EngagedSeconds, PlaybackSeconds)/300));
}
public sealed record WriterSuggestion(string Key,string Observation,string Action,string Controller,string RouteAction,int? EntityID=null,int? ChapterID=null,string? Interpretation=null);
public sealed class WriterWorkPage
{
public int BookID { get; set; }
public int Year { get; set; } = DateTime.UtcNow.Year;
public int Month { get; set; } = DateTime.UtcNow.Month;
public DateTime? Day { get; set; }
public WriterWorkSession? Current { get; set; }
public IReadOnlyList<WriterWorkSession> Sessions { get; set; } = [];
public IReadOnlyList<WriterWorkDay> Days { get; set; } = [];
}
public sealed record WriterWorkToolbar(int BookID,int? ChapterID,string? ChapterTitle,IReadOnlyList<WriterObjectiveChoice>? Choices=null,string DefaultKind="Writing",bool Unified=false);