Daily per-user aggregates, counted on the server clock between progress reports. Includes the cleanup task for rows past 90 days.
31 lines
897 B
C#
31 lines
897 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Jellyfin.Plugin.Herald.Stats;
|
|
|
|
/// <summary>
|
|
/// Persistence for daily watch-time aggregates.
|
|
/// </summary>
|
|
public interface IWatchStatsStore
|
|
{
|
|
/// <summary>
|
|
/// Adds increments to the daily aggregates.
|
|
/// </summary>
|
|
/// <param name="increments">The increments.</param>
|
|
void Add(IReadOnlyCollection<WatchIncrement> increments);
|
|
|
|
/// <summary>
|
|
/// Gets the aggregates from a day onwards.
|
|
/// </summary>
|
|
/// <param name="from">The first day to include.</param>
|
|
/// <returns>The aggregates.</returns>
|
|
IReadOnlyList<DailyWatchStat> GetSince(DateOnly from);
|
|
|
|
/// <summary>
|
|
/// Deletes aggregates older than a day.
|
|
/// </summary>
|
|
/// <param name="cutoff">The first day to keep.</param>
|
|
/// <returns>The number of deleted rows.</returns>
|
|
int DeleteBefore(DateOnly cutoff);
|
|
}
|