some fixes

This commit is contained in:
2024-09-29 09:58:32 +02:00
parent 31f557cc8d
commit 934b8db71b
4 changed files with 125 additions and 67 deletions

View File

@@ -25,8 +25,16 @@ internal class UpdatesCollectorFeature : PluginFunction, IPluginFeatureProvider<
if (!ucDialog.ShowDialog(p.Api.MainWindow).IsOk() || ucDialog.CurrentUpdates is null)
return null;
// Path install actions
// Collect versions with changes
var updates = new List<UpdatesCollectorUi.ModUpdateInfo>();
foreach (var update in ucDialog.CurrentUpdates.List)
{
if (update.Origin.SourceTag != update.AvailableVersions[update.NewVersion].Value)
updates.Add(update);
}
// Path install actions
foreach (var update in updates)
{
update.Origin.SourceTag = update.AvailableVersions[update.NewVersion].Value;
p.Api.UpdateItem(update.Origin);
@@ -34,7 +42,7 @@ internal class UpdatesCollectorFeature : PluginFunction, IPluginFeatureProvider<
// Create update actions
var updateSet = new UpdateInfo();
foreach (var update in ucDialog.CurrentUpdates.List)
foreach (var update in updates)
{
updateSet.Actions.Add(new()
{