mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Fix statistical queries.
This commit is contained in:
@@ -581,11 +581,21 @@ namespace RomRepoMgr.Core.Workers
|
|||||||
Version = romSet.Version,
|
Version = romSet.Version,
|
||||||
TotalMachines = romSet.Machines.Count,
|
TotalMachines = romSet.Machines.Count,
|
||||||
CompleteMachines =
|
CompleteMachines =
|
||||||
romSet.Machines.Count(m => m.Files.All(f => f.File.IsInRepo) &&
|
romSet.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count == 0 &&
|
||||||
|
m.Files.All(f => f.File.IsInRepo)) +
|
||||||
|
romSet.Machines.Count(m => m.Disks.Count > 0 && m.Files.Count == 0 &&
|
||||||
|
m.Disks.All(f => f.Disk.IsInRepo)) +
|
||||||
|
romSet.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count > 0 &&
|
||||||
|
m.Files.All(f => f.File.IsInRepo) &&
|
||||||
m.Disks.All(f => f.Disk.IsInRepo)),
|
m.Disks.All(f => f.Disk.IsInRepo)),
|
||||||
IncompleteMachines =
|
IncompleteMachines =
|
||||||
romSet.Machines.Count(m => m.Files.Any(f => !f.File.IsInRepo) ||
|
romSet.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count == 0 &&
|
||||||
m.Disks.Any(f => !f.Disk.IsInRepo)),
|
m.Files.Any(f => !f.File.IsInRepo)) +
|
||||||
|
romSet.Machines.Count(m => m.Disks.Count > 0 && m.Files.Count == 0 &&
|
||||||
|
m.Disks.Any(f => !f.Disk.IsInRepo)) +
|
||||||
|
romSet.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count > 0 &&
|
||||||
|
(m.Files.Any(f => !f.File.IsInRepo) ||
|
||||||
|
m.Disks.Any(f => !f.Disk.IsInRepo))),
|
||||||
TotalRoms = romSet.Machines.Sum(m => m.Files.Count) + romSet.Machines.Sum(m => m.Disks.Count),
|
TotalRoms = romSet.Machines.Sum(m => m.Files.Count) + romSet.Machines.Sum(m => m.Disks.Count),
|
||||||
HaveRoms = romSet.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
HaveRoms = romSet.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
||||||
romSet.Machines.Sum(m => m.Disks.Count(f => f.Disk.IsInRepo)),
|
romSet.Machines.Sum(m => m.Disks.Count(f => f.Disk.IsInRepo)),
|
||||||
|
|||||||
@@ -317,23 +317,33 @@ namespace RomRepoMgr.ViewModels
|
|||||||
ThenBy(r => r.Date).ThenBy(r => r.Description).ThenBy(r => r.Comment).
|
ThenBy(r => r.Date).ThenBy(r => r.Description).ThenBy(r => r.Comment).
|
||||||
ThenBy(r => r.Filename).Select(r => new RomSetModel
|
ThenBy(r => r.Filename).Select(r => new RomSetModel
|
||||||
{
|
{
|
||||||
Id = r.Id,
|
Id = r.Id,
|
||||||
Author = r.Author,
|
Author = r.Author,
|
||||||
Comment = r.Comment,
|
Comment = r.Comment,
|
||||||
Date = r.Date,
|
Date = r.Date,
|
||||||
Description = r.Description,
|
Description = r.Description,
|
||||||
Filename = r.Filename,
|
Filename = r.Filename,
|
||||||
Homepage = r.Homepage,
|
Homepage = r.Homepage,
|
||||||
Name = r.Name,
|
Name = r.Name,
|
||||||
Sha384 = r.Sha384,
|
Sha384 = r.Sha384,
|
||||||
Version = r.Version,
|
Version = r.Version,
|
||||||
TotalMachines = r.Machines.Count,
|
TotalMachines = r.Machines.Count,
|
||||||
CompleteMachines =
|
CompleteMachines =
|
||||||
r.Machines.Count(m => m.Files.All(f => f.File.IsInRepo) &&
|
r.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count == 0 &&
|
||||||
|
m.Files.All(f => f.File.IsInRepo)) +
|
||||||
|
r.Machines.Count(m => m.Disks.Count > 0 && m.Files.Count == 0 &&
|
||||||
|
m.Disks.All(f => f.Disk.IsInRepo)) +
|
||||||
|
r.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count > 0 &&
|
||||||
|
m.Files.All(f => f.File.IsInRepo) &&
|
||||||
m.Disks.All(f => f.Disk.IsInRepo)),
|
m.Disks.All(f => f.Disk.IsInRepo)),
|
||||||
IncompleteMachines =
|
IncompleteMachines =
|
||||||
r.Machines.Count(m => m.Files.Any(f => !f.File.IsInRepo) ||
|
r.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count == 0 &&
|
||||||
m.Disks.Any(f => !f.Disk.IsInRepo)),
|
m.Files.Any(f => !f.File.IsInRepo)) +
|
||||||
|
r.Machines.Count(m => m.Disks.Count > 0 && m.Files.Count == 0 &&
|
||||||
|
m.Disks.Any(f => !f.Disk.IsInRepo)) +
|
||||||
|
r.Machines.Count(m => m.Files.Count > 0 && m.Disks.Count > 0 &&
|
||||||
|
(m.Files.Any(f => !f.File.IsInRepo) ||
|
||||||
|
m.Disks.Any(f => !f.Disk.IsInRepo))),
|
||||||
TotalRoms = r.Machines.Sum(m => m.Files.Count) +
|
TotalRoms = r.Machines.Sum(m => m.Files.Count) +
|
||||||
r.Machines.Sum(m => m.Disks.Count),
|
r.Machines.Sum(m => m.Disks.Count),
|
||||||
HaveRoms = r.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
HaveRoms = r.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)) +
|
||||||
|
|||||||
Reference in New Issue
Block a user