Browse Source

Fix Dictionary error when launch arguments saved with duplicate arguments

pull/109/head
Ionite 1 year ago
parent
commit
be2f5f8f26
No known key found for this signature in database
  1. 1
      CHANGELOG.md
  2. 9
      StabilityMatrix.Core/Models/LaunchOptionCard.cs

1
CHANGELOG.md

@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
- Fixed issue where Checkpoints page may not show all checkpoints after clearing search filter - Fixed issue where Checkpoints page may not show all checkpoints after clearing search filter
- Fixed issue where Checkpoints page may show incorrect checkpoints for the given filter after changing pages - Fixed issue where Checkpoints page may show incorrect checkpoints for the given filter after changing pages
- Fixed issue where Open Web UI button would try to load 0.0.0.0 addresses - Fixed issue where Open Web UI button would try to load 0.0.0.0 addresses
- Fixed Dictionary error when launch arguments saved with duplicate arguments
### Changed ### Changed
- Changed update method for SD.Next to use the built-in upgrade functionality - Changed update method for SD.Next to use the built-in upgrade functionality
- Model Browser navigation buttons are no longer disabled while changing pages - Model Browser navigation buttons are no longer disabled while changing pages

9
StabilityMatrix.Core/Models/LaunchOptionCard.cs

@ -45,8 +45,13 @@ public readonly record struct LaunchOptionCard
// During card creation, store dict of options with initial values // During card creation, store dict of options with initial values
var initialOptions = new Dictionary<string, object>(); var initialOptions = new Dictionary<string, object>();
// Dict of // To dictionary ignoring duplicates
var launchArgsDict = launchArgs.ToDictionary(launchArg => launchArg.Name); var launchArgsDict = launchArgs
.ToLookup(launchArg => launchArg.Name)
.ToDictionary(
group => group.Key,
group => group.First()
);
// Create cards // Create cards
foreach (var definition in definitions) foreach (var definition in definitions)

Loading…
Cancel
Save