mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Device calibration - Storage migration
This commit is contained in:
parent
716f115a2d
commit
67451b5867
27
src/Artemis.Storage/Migrations/M9DeviceCalibration.cs
Normal file
27
src/Artemis.Storage/Migrations/M9DeviceCalibration.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M9DeviceCalibration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 9;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Apply(LiteRepository repository)
|
||||
{
|
||||
ILiteCollection<BsonDocument> collection = repository.Database.GetCollection("SurfaceEntity");
|
||||
foreach (BsonDocument bsonDocument in collection.FindAll())
|
||||
{
|
||||
foreach (BsonValue bsonDevice in bsonDocument["DeviceEntities"].AsArray)
|
||||
{
|
||||
bsonDevice["RedScale"] = 1;
|
||||
bsonDevice["GreenScale"] = 1;
|
||||
bsonDevice["BlueScale"] = 1;
|
||||
}
|
||||
|
||||
collection.Update(bsonDocument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user