Browse Source

Modified status counts to reflect current counts, not total lifetime counts

tags/3.0.0
Teknikode 4 years ago
parent
commit
5e5e4c093d
1 changed files with 10 additions and 15 deletions
  1. 10
    15
      Teknik/Areas/Status/Controllers/StatusController.cs

+ 10
- 15
Teknik/Areas/Status/Controllers/StatusController.cs View File

@@ -32,21 +32,16 @@ namespace Teknik.Areas.Status.Controllers
{
// Load initial status info
#region Statistics
Upload.Models.Upload upload = db.Uploads.OrderByDescending(u => u.UploadId).FirstOrDefault();
model.UploadCount = (upload != null) ? upload.UploadId : 0;
model.UploadSize = (upload != null) ? db.Uploads.Sum(u => (long)u.ContentLength) : 0;

Paste.Models.Paste paste = db.Pastes.OrderByDescending(p => p.PasteId).FirstOrDefault();
model.PasteCount = (paste != null) ? paste.PasteId : 0;

Users.Models.User user = db.Users.OrderByDescending(u => u.UserId).FirstOrDefault();
model.UserCount = (user != null) ? user.UserId : 0;

Shortener.Models.ShortenedUrl url = db.ShortenedUrls.OrderByDescending(s => s.ShortenedUrlId).FirstOrDefault();
model.ShortenedUrlCount = (url != null) ? url.ShortenedUrlId : 0;

Vault.Models.Vault vault = db.Vaults.OrderByDescending(v => v.VaultId).FirstOrDefault();
model.VaultCount = (url != null) ? vault.VaultId : 0;
model.UploadCount = db.Uploads.Count();
model.UploadSize = db.Uploads.Sum(u => u.ContentLength);
model.PasteCount = db.Pastes.Count();
model.UserCount = db.Users.Count();
model.ShortenedUrlCount = db.ShortenedUrls.Count();
model.VaultCount = db.Vaults.Count();
#endregion

// Get Transaction Inforomation

Loading…
Cancel
Save