Added Deduplication button and the ability to point a hdd file to multiple game paths in groups.

This commit is contained in:
Ottermandias 2021-01-18 14:53:28 +01:00 committed by Ottermandias
parent fd2e020eec
commit 06b0fb7e0c
8 changed files with 358 additions and 103 deletions

View file

@ -237,18 +237,18 @@ namespace Penumbra.Importer
GroupName = group.GroupName,
Options = new List<Option>(),
};
foreach( var opt in group.OptionList )
foreach( var opt in group.OptionList )
{
var optio = new Option
{
OptionName = opt.Name,
OptionDesc = String.IsNullOrEmpty( opt.Description ) ? "" : opt.Description,
OptionFiles = new Dictionary<string, string>()
OptionDesc = String.IsNullOrEmpty(opt.Description) ? "" : opt.Description,
OptionFiles = new Dictionary<string, HashSet<string>>()
};
var optDir = new DirectoryInfo( Path.Combine( groupFolder.FullName, opt.Name ) );
foreach( var file in optDir.EnumerateFiles( "*.*", SearchOption.AllDirectories ) )
var optDir = new DirectoryInfo(Path.Combine( groupFolder.FullName, opt.Name));
foreach ( var file in optDir.EnumerateFiles("*.*", SearchOption.AllDirectories) )
{
optio.OptionFiles[file.FullName.Substring( baseFolder.FullName.Length ).TrimStart( '\\' )] = file.FullName.Substring( optDir.FullName.Length ).TrimStart( '\\' ).Replace( '\\', '/' );
optio.AddFile(file.FullName.Substring(baseFolder.FullName.Length).TrimStart('\\'), file.FullName.Substring(optDir.FullName.Length).TrimStart('\\').Replace('\\','/'));
}
Inf.Options.Add( optio );
}
@ -333,4 +333,4 @@ namespace Penumbra.Importer
return encoding.GetString( ms.ToArray() );
}
}
}
}