mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 06:15:25 -04:00
Progress Overhaul + Profile Page and a LOT more! (#4262)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.Constants;
|
||||
using API.Entities.Progress;
|
||||
|
||||
namespace API.Entities.User;
|
||||
#nullable enable
|
||||
|
||||
public class ClientDevice
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Client-provided device identifier (from <see cref="Headers.ClientDeviceFingerprint"/> header)
|
||||
/// Null for clients that don't send it (OPDS readers, etc.)
|
||||
/// </summary>
|
||||
public string? UiFingerprint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Server-computed fingerprint for device matching
|
||||
/// Hash of: ClientType + Platform + DeviceType + (Browser+BrowserVersion for web-app)
|
||||
/// </summary>
|
||||
public string DeviceFingerprint { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// User-friendly name, defaults to generated name like "Chrome on Windows"
|
||||
/// </summary>
|
||||
/// <remarks>Generated on first seen, user can customize after the fact</remarks>
|
||||
public string FriendlyName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Most recent stable ClientInfoData (excluding IP/timestamp changes)
|
||||
/// </summary>
|
||||
public ClientInfoData CurrentClientInfo { get; set; } = new();
|
||||
|
||||
public DateTime FirstSeenUtc { get; set; }
|
||||
public DateTime LastSeenUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Soft delete - removed devices stay in DB for history
|
||||
/// </summary>
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
// TODO: Put an optional string? for AppUserAuthKey used (it might change, so it should be last seen)
|
||||
|
||||
// Navigation properties
|
||||
public int AppUserId { get; set; }
|
||||
public virtual AppUser AppUser { get; set; } = null!;
|
||||
public ICollection<ClientDeviceHistory> History { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user