Add statistics to list of rom sets.

This commit is contained in:
2020-08-24 01:57:15 +01:00
parent 86b63e5e31
commit 3d87c2e778
7 changed files with 108 additions and 44 deletions

View File

@@ -53,15 +53,20 @@ namespace RomRepoMgr.ViewModels
RomSets = new ObservableCollection<RomSetModel>(romSets);
}
public ObservableCollection<RomSetModel> RomSets { get; }
public string RomSetLabel => "ROM sets";
public string RomSetNameLabel => "Name";
public string RomSetVersionLabel => "Version";
public string RomSetAuthorLabel => "Author";
public string RomSetDateLabel => "Date";
public string RomSetDescriptionLabel => "Description";
public string RomSetCommentLabel => "Comment";
public string RomSetHomepageLabel => "Homepage";
public ObservableCollection<RomSetModel> RomSets { get; }
public string RomSetLabel => "ROM sets";
public string RomSetNameLabel => "Name";
public string RomSetVersionLabel => "Version";
public string RomSetAuthorLabel => "Author";
public string RomSetDateLabel => "Date";
public string RomSetDescriptionLabel => "Description";
public string RomSetCommentLabel => "Comment";
public string RomSetTotalMachinesLabel => "Games";
public string RomSetCompleteMachinesLabel => "Complete";
public string RomSetIncompleteMachinesLabel => "Incomplete";
public string RomSetTotalRomsLabel => "ROMs";
public string RomSetHaveRomsLabel => "Have";
public string RomSetMissRomsLabel => "Miss";
public string Greeting => "Hello World!";
public bool NativeMenuSupported =>

View File

@@ -370,15 +370,23 @@ namespace RomRepoMgr.ViewModels
ThenBy(r => r.Date).ThenBy(r => r.Description).ThenBy(r => r.Comment).
ThenBy(r => r.Filename).Select(r => new RomSetModel
{
Author = r.Author,
Comment = r.Comment,
Date = r.Date,
Description = r.Description,
Filename = r.Filename,
Homepage = r.Homepage,
Name = r.Name,
Sha384 = r.Sha384,
Version = r.Version
Author = r.Author,
Comment = r.Comment,
Date = r.Date,
Description = r.Description,
Filename = r.Filename,
Homepage = r.Homepage,
Name = r.Name,
Sha384 = r.Sha384,
Version = r.Version,
TotalMachines = r.Machines.Count,
CompleteMachines =
r.Machines.Count(m => m.Files.All(f => f.File.IsInRepo)),
IncompleteMachines =
r.Machines.Count(m => m.Files.Any(f => !f.File.IsInRepo)),
TotalRoms = r.Machines.Sum(m => m.Files.Count),
HaveRoms = r.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)),
MissRoms = r.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo))
}).ToList()
});