namespace slskd.API.DTO { using Soulseek; public class UserDataResponse { /// /// The average upload speed of the user. /// public int AverageSpeed { get; set; } /// /// The user's country code, if provided. /// public string CountryCode { get; set; } /// /// The number of directories shared by the user. /// public int DirectoryCount { get; set; } /// /// The number of active user downloads. /// public long DownloadCount { get; set; } /// /// The number of files shared by the user. /// public int FileCount { get; set; } /// /// A value indicating whether this user data belongs to the currently logged in user. /// public bool? Self { get; set; } /// /// The number of the user's free download slots, if provided. /// public int? SlotsFree { get; set; } /// /// The status of the user (0 = offline, 1 = away, 2 = online). /// public UserPresence Status { get; set; } /// /// The username of the user. /// public string Username { get; set; } public static UserDataResponse FromUserData(UserData userData, bool self = false) { return new UserDataResponse() { AverageSpeed = userData.AverageSpeed, CountryCode = userData.CountryCode, DirectoryCount = userData.DirectoryCount, DownloadCount = userData.DownloadCount, FileCount = userData.FileCount, SlotsFree = userData.SlotsFree, Status = userData.Status, Username = userData.Username, Self = self ? self : (bool?)null }; } } }