Workshop - Fix installing new versions of profiles

This commit is contained in:
Robert committed 2024-07-02 22:34:25 +02:00
1 parent 648b7765ef
commit 00948de9d6
3 files changed
+8 -23

No files matched your search

@@ -42,11 +42,16 @@ public class ProfileEntryInstallationHandler : IEntryInstallationHandler
ProfileConfiguration? existing = _profileService.ProfileCategories.SelectMany(c => c.ProfileConfigurations).FirstOrDefault(c => c.ProfileId == profileId);
if (existing != null)
{
ProfileConfiguration overwritten = await _profileService.OverwriteProfile(stream, existing);
ProfileConfiguration overwritten = await _profileService.ImportProfile(stream, existing.Category, true, false, null, existing);
overwritten.Name = existing.Name;
// Update the release
installedEntry.SetMetadata("ProfileId", overwritten.ProfileId);
// Update the release and return the profile configuration
UpdateRelease(installedEntry, release);
// With everything updated, remove the old profile
_profileService.RemoveProfileConfiguration(existing);
return EntryInstallResult.FromSuccess(installedEntry);
}
}