Storage - Replace LiteDB with SQLite + EF Core (#843)

Storage - Added LiteDB to SQLite migration
UI - Try to die a bit more gracefully
Core - Delay start watching plugins for hot reload after initializing
UI - Simplify category management logic
UI - Avoid crash during profile icon load
Storage - Fix entry metadata retrieval
This commit is contained in:
RobertBeekman authored and GitHub committed 2024-03-13 20:19:21 +01:00
1 parent 9132301dbf
commit 551921db9f
130 files changed
+2965 -1135

No files matched your search

@@ -21,6 +21,7 @@
<PackageReference Include="Material.Icons.Avalonia" />
<PackageReference Include="ReactiveUI" />
<PackageReference Include="ReactiveUI.Validation" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
@@ -46,17 +46,10 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable
? new MaterialIcon {Kind = parsedIcon!}
: new MaterialIcon {Kind = MaterialIconKind.QuestionMark};
}
else if (ConfigurationIcon.IconBytes != null)
Dispatcher.UIThread.Post(LoadFromBitmap, DispatcherPriority.ApplicationIdle);
else
{
Dispatcher.UIThread.Post(() =>
{
Stream? stream = ConfigurationIcon?.GetIconStream();
if (stream == null || ConfigurationIcon == null)
Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark};
else
LoadFromBitmap(ConfigurationIcon, stream);
}, DispatcherPriority.ApplicationIdle);
}
Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark};
}
catch (Exception)
{
@@ -64,22 +57,32 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable
}
}
private void LoadFromBitmap(Core.ProfileConfigurationIcon configurationIcon, Stream stream)
private void LoadFromBitmap()
{
_stream = stream;
if (!configurationIcon.Fill)
try
{
Content = new Image {Source = new Bitmap(stream)};
return;
}
if (ConfigurationIcon?.IconBytes == null)
return;
Content = new Border
_stream = new MemoryStream(ConfigurationIcon.IconBytes);
if (!ConfigurationIcon.Fill)
{
Content = new Image {Source = new Bitmap(_stream)};
return;
}
Content = new Border
{
Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(_stream))
};
}
catch (Exception)
{
Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(stream))
};
Content = new MaterialIcon {Kind = MaterialIconKind.QuestionMark};
}
}
private void OnDetachedFromLogicalTree(object? sender, LogicalTreeAttachmentEventArgs e)