mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Workshop - Implemented workshop installation, layout selection and removal
This commit is contained in:
1 parent
dad6a56238
commit
28edabae89
23 files changed
+226
-168
No files matched your search
@@ -20,7 +20,7 @@ internal class DeviceService : IDeviceService
|
||||
private readonly IPluginManagementService _pluginManagementService;
|
||||
private readonly IDeviceRepository _deviceRepository;
|
||||
private readonly Lazy<IRenderService> _renderService;
|
||||
private readonly LazyEnumerable<ILayoutProvider> _layoutProviders;
|
||||
private readonly Func<List<ILayoutProvider>> _getLayoutProviders;
|
||||
private readonly List<ArtemisDevice> _enabledDevices = new();
|
||||
private readonly List<ArtemisDevice> _devices = new();
|
||||
|
||||
@@ -28,13 +28,13 @@ internal class DeviceService : IDeviceService
|
||||
IPluginManagementService pluginManagementService,
|
||||
IDeviceRepository deviceRepository,
|
||||
Lazy<IRenderService> renderService,
|
||||
LazyEnumerable<ILayoutProvider> layoutProviders)
|
||||
Func<List<ILayoutProvider>> getLayoutProviders)
|
||||
{
|
||||
_logger = logger;
|
||||
_pluginManagementService = pluginManagementService;
|
||||
_deviceRepository = deviceRepository;
|
||||
_renderService = renderService;
|
||||
_layoutProviders = layoutProviders;
|
||||
_getLayoutProviders = getLayoutProviders;
|
||||
|
||||
EnabledDevices = new ReadOnlyCollection<ArtemisDevice>(_enabledDevices);
|
||||
Devices = new ReadOnlyCollection<ArtemisDevice>(_devices);
|
||||
@@ -167,7 +167,7 @@ internal class DeviceService : IDeviceService
|
||||
/// <inheritdoc />
|
||||
public void LoadDeviceLayout(ArtemisDevice device)
|
||||
{
|
||||
ILayoutProvider? provider = _layoutProviders.FirstOrDefault(p => p.IsMatch(device));
|
||||
ILayoutProvider? provider = _getLayoutProviders().FirstOrDefault(p => p.IsMatch(device));
|
||||
if (provider == null)
|
||||
_logger.Warning("Could not find a layout provider for type {LayoutType} of device {Device}", device.LayoutSelection.Type, device);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ internal class PluginManagementService : IPluginManagementService
|
||||
|
||||
// Remove the old directory if it exists
|
||||
if (Directory.Exists(pluginDirectory.FullName))
|
||||
pluginDirectory.DeleteRecursively();
|
||||
pluginDirectory.Delete(true);
|
||||
|
||||
// Extract everything in the same archive directory to the unique plugin directory
|
||||
Utilities.CreateAccessibleDirectory(pluginDirectory.FullName);
|
||||
|
||||
Reference in new issue
Block a user