small bug fixes that came up during testing for a 0.7 release

This commit is contained in:
Timothy Baldridge 2019-08-22 16:05:16 -06:00
parent 0c74967dd8
commit 07df55383e
4 changed files with 26 additions and 8 deletions

View File

@ -16,7 +16,7 @@ namespace Wabbajack.Common
public static string MegaPrefix = "https://mega.nz/#!";
public static HashSet<string> SupportedArchives = new HashSet<string>() { ".zip", ".rar", ".7z", ".7zip" };
public static HashSet<string> SupportedBSAs = new HashSet<string>() { ".bsa", ".ba2" };
public static HashSet<string> SupportedBSAs = new HashSet<string>() { ".bsa" };
public static String UserAgent {
get

View File

@ -210,6 +210,8 @@ namespace Wabbajack
public void SetQueueSize(int max, int current)
{
if (max == 0)
max = 1;
var total = current * 100 / max;
QueueProgress = total;
}
@ -292,13 +294,9 @@ namespace Wabbajack
{
installer.Install();
}
catch (AggregateException ex)
{
LogMsg(ex.StackTrace);
LogMsg(ex.InnerException.ToString());
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
LogMsg(ex.StackTrace);
LogMsg(ex.InnerException.ToString());
LogMsg($"{ex.Message} - Can't continue");
@ -320,6 +318,7 @@ namespace Wabbajack
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
LogMsg(ex.StackTrace);
LogMsg(ex.InnerException.ToString());
LogMsg($"{ex.Message} - Can't continue");

View File

@ -158,6 +158,7 @@ namespace Wabbajack
.Select(f => new IndexedArchive()
{
File = VFS.Lookup(f),
Name = Path.GetFileName(f),
IniData = (f + ".meta").LoadIniFile(),
Meta = File.ReadAllText(f + ".meta")
})
@ -362,7 +363,7 @@ namespace Wabbajack
Status($"Getting Nexus info for {found.Name}");
try
{
// var link = NexusAPI.GetNexusDownloadLink((NexusMod)result, NexusKey);
var link = NexusAPI.GetNexusDownloadLink((NexusMod)result, NexusKey);
}
catch (Exception ex)
{
@ -481,6 +482,7 @@ namespace Wabbajack
return new List<Func<RawSourceFile, Directive>>()
{
IgnoreStartsWith("logs\\"),
IncludeRegex("^downloads\\\\.*\\.meta"),
IgnoreStartsWith("downloads\\"),
IgnoreStartsWith("webcache\\"),
IgnoreStartsWith("overwrite\\"),
@ -844,6 +846,23 @@ namespace Wabbajack
};
}
private Func<RawSourceFile, Directive> IncludeRegex(string pattern)
{
var regex = new Regex(pattern);
return source =>
{
if (regex.IsMatch(source.Path))
{
var result = source.EvolveTo<InlineFile>();
result.SourceData = File.ReadAllBytes(source.AbsolutePath).ToBase64();
return result;
}
return null;
};
}
private Func<RawSourceFile, Directive> DropAll()
{
return source => {

View File

@ -229,7 +229,7 @@ namespace Wabbajack
private void InstallArchive(Archive archive, string absolutePath, IGrouping<string, FromArchive> grouping)
{
Status("Extracting {0}", archive.Name);
Status($"Extracting {archive.Name}");
var files = grouping.GroupBy(e => e.FullPath)
.ToDictionary(e => e.Key);