Extra Stat collection (#407)
* 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
This commit is contained in:
parent
b9a06d3586
commit
b11bb0e3b5
18 changed files with 64 additions and 57 deletions
37
API/DTOs/Stats/ClientInfoDto.cs
Normal file
37
API/DTOs/Stats/ClientInfoDto.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
|
||||
namespace API.DTOs.Stats
|
||||
{
|
||||
public class ClientInfoDto
|
||||
{
|
||||
public ClientInfoDto()
|
||||
{
|
||||
CollectedAt = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public string KavitaUiVersion { get; set; }
|
||||
public string ScreenResolution { get; set; }
|
||||
public string PlatformType { get; set; }
|
||||
public DetailsVersion Browser { get; set; }
|
||||
public DetailsVersion Os { get; set; }
|
||||
|
||||
public DateTime? CollectedAt { get; set; }
|
||||
public bool UsingDarkTheme { get; set; }
|
||||
|
||||
public bool IsTheSameDevice(ClientInfoDto clientInfoDto)
|
||||
{
|
||||
return (clientInfoDto.ScreenResolution ?? string.Empty).Equals(ScreenResolution) &&
|
||||
(clientInfoDto.PlatformType ?? string.Empty).Equals(PlatformType) &&
|
||||
(clientInfoDto.Browser?.Name ?? string.Empty).Equals(Browser?.Name) &&
|
||||
(clientInfoDto.Os?.Name ?? string.Empty).Equals(Os?.Name) &&
|
||||
clientInfoDto.CollectedAt.GetValueOrDefault().ToString("yyyy-MM-dd")
|
||||
.Equals(CollectedAt.GetValueOrDefault().ToString("yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
|
||||
public class DetailsVersion
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue