diff --git a/Penumbra/Configuration.Migration.cs b/Penumbra/Configuration.Migration.cs index 2b0b1586..3df24ae7 100644 --- a/Penumbra/Configuration.Migration.cs +++ b/Penumbra/Configuration.Migration.cs @@ -63,6 +63,7 @@ public partial class Configuration // The forced collection was removed due to general inheritance. // Sort Order was moved to a separate file and may contain empty folders. // Active collections in general were moved to their own file. + // Delete the penumbrametatmp folder if it exists. private void Version1To2() { if( _config.Version != 1 ) @@ -71,6 +72,7 @@ public partial class Configuration } // Ensure the right meta files are loaded. + DeleteMetaTmp(); Penumbra.CharacterUtility.LoadCharacterResources(); ResettleSortOrder(); ResettleCollectionSettings(); @@ -78,6 +80,22 @@ public partial class Configuration _config.Version = 2; } + private void DeleteMetaTmp() + { + var path = Path.Combine( _config.ModDirectory, "penumbrametatmp" ); + if( Directory.Exists( path ) ) + { + try + { + Directory.Delete( path, true ); + } + catch( Exception e ) + { + PluginLog.Error( $"Could not delete the outdated penumbrametatmp folder:\n{e}" ); + } + } + } + private void ResettleForcedCollection() { ForcedCollection = _data[ nameof( ForcedCollection ) ]?.ToObject< string >() ?? ForcedCollection;