public void UpdatePropertiesFromTrovesaurus(TroveMod mod) { if (mod != null) { Id = mod.Id; Name = mod.Name; if (!string.IsNullOrWhiteSpace(mod.Author)) { Author = mod.Author; } Type = mod.Type; SubType = mod.SubType; if (!string.IsNullOrWhiteSpace(mod.Description)) { Description = mod.Description; } DateCreated = mod.DateCreated; TrovesaurusStatus = mod.TrovesaurusStatus; Replaces = mod.Replaces; TotalDownloads = mod.TotalDownloads; Votes = mod.Votes; Views = mod.Views; Downloads = new List <Download>(mod.Downloads); ImagePath = mod.ImagePath; ImageFullPath = mod.ImageFullPath; // Get the current file ID using the file date if it is not already set if (string.IsNullOrEmpty(CurrentFileId)) { var download = Downloads.FirstOrDefault(d => d.Date == UnixTimeSeconds.ToString()); if (download != null) { CurrentFileId = download.FileId; } } } }
public override string ToString() { return(UnixTimeSeconds.ToString()); }