mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Ensure not adding duplicate seen devices to database. Fixes #312.
This commit is contained in:
@@ -1341,6 +1341,12 @@ namespace Aaru.Core
|
||||
|
||||
using var ctx = AaruContext.Create(Settings.Settings.LocalDbPath);
|
||||
|
||||
if(ctx.SeenDevices.Any(d => d.Manufacturer == dev.Manufacturer &&
|
||||
d.Model == dev.Model &&
|
||||
d.Revision == dev.FirmwareRevision &&
|
||||
d.Bus == deviceBus))
|
||||
return;
|
||||
|
||||
ctx.SeenDevices.Add(new DeviceStat
|
||||
{
|
||||
Bus = deviceBus, Manufacturer = dev.Manufacturer, Model = dev.Model,
|
||||
|
||||
Reference in New Issue
Block a user