mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-04 14:14:39 -04:00
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);
|
|
}
|
|
}
|
|
}
|