mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Add statistics to list of rom sets.
This commit is contained in:
@@ -114,22 +114,6 @@ namespace RomRepoMgr.Core.Workers
|
||||
Context.Singleton.RomSets.Add(romSet);
|
||||
Context.Singleton.SaveChanges();
|
||||
|
||||
RomSetAdded?.Invoke(this, new RomSetEventArgs
|
||||
{
|
||||
RomSet = new RomSetModel
|
||||
{
|
||||
Author = romSet.Author,
|
||||
Comment = romSet.Comment,
|
||||
Date = romSet.Date,
|
||||
Description = romSet.Description,
|
||||
Filename = romSet.Filename,
|
||||
Homepage = romSet.Homepage,
|
||||
Name = romSet.Name,
|
||||
Sha384 = romSet.Sha384,
|
||||
Version = romSet.Version
|
||||
}
|
||||
});
|
||||
|
||||
SetMessage?.Invoke(this, new MessageEventArgs
|
||||
{
|
||||
Message = "Compressing DAT file..."
|
||||
@@ -473,6 +457,30 @@ namespace RomRepoMgr.Core.Workers
|
||||
});
|
||||
|
||||
WorkFinished?.Invoke(this, System.EventArgs.Empty);
|
||||
|
||||
romSet = Context.Singleton.RomSets.Find(romSet.Id);
|
||||
|
||||
RomSetAdded?.Invoke(this, new RomSetEventArgs
|
||||
{
|
||||
RomSet = new RomSetModel
|
||||
{
|
||||
Author = romSet.Author,
|
||||
Comment = romSet.Comment,
|
||||
Date = romSet.Date,
|
||||
Description = romSet.Description,
|
||||
Filename = romSet.Filename,
|
||||
Homepage = romSet.Homepage,
|
||||
Name = romSet.Name,
|
||||
Sha384 = romSet.Sha384,
|
||||
Version = romSet.Version,
|
||||
TotalMachines = romSet.Machines.Count,
|
||||
CompleteMachines = romSet.Machines.Count(m => m.Files.All(f => f.File.IsInRepo)),
|
||||
IncompleteMachines = romSet.Machines.Count(m => m.Files.Any(f => !f.File.IsInRepo)),
|
||||
TotalRoms = romSet.Machines.Sum(m => m.Files.Count),
|
||||
HaveRoms = romSet.Machines.Sum(m => m.Files.Count(f => f.File.IsInRepo)),
|
||||
MissRoms = romSet.Machines.Sum(m => m.Files.Count(f => !f.File.IsInRepo))
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user