Exemple #1
0
 public void Update(VpdbFile file)
 {
     Name        = file.Name;
     Bytes       = file.Bytes;
     CreatedAt   = file.CreatedAt;
     MimeType    = file.MimeType;
     FileType    = file.FileType;
     Metadata    = file.Metadata;
     Variations  = file.Variations;
     Counter     = file.Counter;
     IsActive    = file.IsActive;
     IsProtected = file.IsProtected;
     Url         = file.Url;
 }
Exemple #2
0
        public void AddOrReplaceFile(VpdbFile file)
        {
            if (!Database.Files.ContainsKey(file.Id)) {
                Database.Files.Add(file.Id, file);

            } else {
                Database.Files[file.Id] = file;
            }
        }
Exemple #3
0
 public Message LogReleaseDownloaded(VpdbRelease release, VpdbVersion version, VpdbFile file, double bytesPerSecond)
 {
     var msg = new Message(MessageType.ReleaseDownloaded, MessageLevel.Info, new Dictionary<string, string> {
         { DataRelease, release.Id },
         { DataReleaseName, release.Name },
         { DataVersion, version.Name },
         { DataFile, file.Id },
         { DataSubject, release.Game.DisplayName },
         { DownloadSpeed, $"{bytesPerSecond.Bytes().ToString("#.0")}/s" },
     });
     return Log(msg);
 }