Files
jellyfin-herald/Jellyfin.Plugin.Herald/Stats/IWatchStatsStore.cs
T
JoshiCodes d1ee91b965 feat: track watch time from playback events
Daily per-user aggregates, counted on the server clock between progress
reports. Includes the cleanup task for rows past 90 days.
2026-11-13 18:10:41 +01:00

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);
}