Revert "Changed the stats that are sent back to stat server from installed server."

This reverts commit 644cb6d1f6.
This commit is contained in:
YEGCSharpDev 2021-10-14 16:00:01 -06:00
parent 644cb6d1f6
commit 98b3c483be
7 changed files with 207 additions and 45 deletions

View file

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace API.DTOs.Stats
{
public class InstallationStatsDto
{
public string InstallId { get; set; }
public string Os { get; set; }
public bool IsDocker { get; set; }
public string DotnetVersion { get; set; }
public string KavitaVersion { get; set; }
}
}

View file

@ -1,11 +1,14 @@
namespace API.DTOs.Stats
namespace API.DTOs.Stats
{
public class ServerInfoDto
{
public string InstallId { get; set; }
public string Os { get; set; }
public bool IsDocker { get; set; }
public string DotnetVersion { get; set; }
public string DotNetVersion { get; set; }
public string RunTimeVersion { get; set; }
public string KavitaVersion { get; set; }
public string BuildBranch { get; set; }
public string Culture { get; set; }
public bool IsDocker { get; set; }
public int NumOfCores { get; set; }
}
}

View file

@ -0,0 +1,33 @@
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);
}
}
}