mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Brush presets - Reset properties to default before applying preset
Layer properties - Disable keyframes when resetting to default Device dialogs - Only dim unselected LEDs if a LED is selected Migrations - Renamed to stay in order Migrations - Added migration for color gradients
This commit is contained in:
1 parent
2bc882c814
commit
60df649eb0
22 files changed
+376
-319
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M1AttributeBasedPropertiesMigration : IStorageMigration
|
||||
public class M0001AttributeBasedPropertiesMigration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 1;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M2ProfileEntitiesEnabledMigration : IStorageMigration
|
||||
public class M0002ProfileEntitiesEnabledMigration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 2;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M3PluginEntitiesIndexChangesMigration : IStorageMigration
|
||||
public class M0003PluginEntitiesIndexChangesMigration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 3;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ using System.Linq;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M4ProfileSegmentsMigration : IStorageMigration
|
||||
public class M0004ProfileSegmentsMigration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 4;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M5DataBindingTypes : IStorageMigration
|
||||
public class M0005DataBindingTypes : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 5;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M6PredicateAbstraction : IStorageMigration
|
||||
public class M0006PredicateAbstraction : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 6;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M8PluginFeatures : IStorageMigration
|
||||
public class M0008PluginFeatures : IStorageMigration
|
||||
{
|
||||
private void Migrate(BsonValue bsonValue, Dictionary<string, string> pluginMap)
|
||||
{
|
||||
+1
-1
@@ -3,7 +3,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M9DeviceCalibration : IStorageMigration
|
||||
public class M0009DeviceCalibration : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 9;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M10BetterDataBindings : IStorageMigration
|
||||
public class M0010BetterDataBindings : IStorageMigration
|
||||
{
|
||||
private void Migrate(BsonValue bsonValue)
|
||||
{
|
||||
@@ -0,0 +1,42 @@
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M0011ColorGradients : IStorageMigration
|
||||
{
|
||||
private void Migrate(BsonValue bsonValue)
|
||||
{
|
||||
if (!bsonValue.IsDocument || !bsonValue.AsDocument.TryGetValue("PropertyEntities", out BsonValue propertyEntities))
|
||||
return;
|
||||
|
||||
foreach (BsonValue propertyEntity in propertyEntities.AsArray)
|
||||
{
|
||||
string valueString = propertyEntity["Value"].AsString;
|
||||
if (!valueString.StartsWith("{\"Stops\":[{") || !valueString.EndsWith("}]}"))
|
||||
continue;
|
||||
|
||||
valueString = valueString.Replace("{\"Stops\":[{", "[{");
|
||||
valueString = valueString.Replace("}]}", "}]");
|
||||
propertyEntity["Value"] = valueString;
|
||||
}
|
||||
}
|
||||
|
||||
public int UserVersion => 11;
|
||||
|
||||
public void Apply(LiteRepository repository)
|
||||
{
|
||||
ILiteCollection<BsonDocument> collection = repository.Database.GetCollection("ProfileEntity");
|
||||
foreach (BsonDocument bsonDocument in collection.FindAll())
|
||||
{
|
||||
foreach (BsonValue bsonLayer in bsonDocument["Layers"].AsArray)
|
||||
Migrate(bsonLayer);
|
||||
|
||||
foreach (BsonValue bsonLayer in bsonDocument["Folders"].AsArray)
|
||||
Migrate(bsonLayer);
|
||||
|
||||
collection.Update(bsonDocument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user