mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-03 13:44:31 -04:00
* Cleaned up error interceptor to avoid sending auth errors (when a 500 occurs) to sentry as auth errors aren't issues. * Added extra stat collection * Fixed a bad gitignore which ignored anything in a stats directory
34 lines
863 B
C#
34 lines
863 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace API.DTOs.Stats
|
|
{
|
|
public class UsageStatisticsDto
|
|
{
|
|
public UsageStatisticsDto()
|
|
{
|
|
MarkAsUpdatedNow();
|
|
ClientsInfo = new List<ClientInfoDto>();
|
|
}
|
|
|
|
public string InstallId { get; set; }
|
|
public DateTime LastUpdate { get; set; }
|
|
public UsageInfoDto UsageInfo { get; set; }
|
|
public ServerInfoDto ServerInfo { get; set; }
|
|
public List<ClientInfoDto> ClientsInfo { get; set; }
|
|
|
|
public void MarkAsUpdatedNow()
|
|
{
|
|
LastUpdate = DateTime.UtcNow;
|
|
}
|
|
|
|
public void AddClientInfo(ClientInfoDto clientInfoDto)
|
|
{
|
|
if (ClientsInfo.Any(x => x.IsTheSameDevice(clientInfoDto))) return;
|
|
|
|
ClientsInfo.Add(clientInfoDto);
|
|
}
|
|
}
|
|
}
|