Fixed meta parsing logic

This commit is contained in:
erri120 2019-12-15 12:27:00 +01:00
parent f3c8b26b1f
commit 77539b6142
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -373,25 +373,24 @@ namespace Wabbajack.Lib
Utils.Log($"File {f} is not in ActiveArchives"); Utils.Log($"File {f} is not in ActiveArchives");
var lines = File.ReadAllLines(f); var lines = File.ReadAllLines(f);
if (lines.Length == 0 || !lines.Any(line => line.Contains("directURL=")))
if (lines.Length == 0)
return;
lines.Do(line =>
{ {
if (lines.Length == 0) var tag = "";
if (line.Contains("tag="))
tag = line.Substring("tag=".Length);
if (tag != Consts.WABBAJACK_VORTEX_MANUAL)
return; return;
lines.Do(line => Utils.Log($"File {f} contains the {Consts.WABBAJACK_VORTEX_MANUAL} tag, adding to ActiveArchives");
{ ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
var tag = ""; });
if (line.Contains("tag="))
tag = line.Substring("tag=".Length);
if (tag != Consts.WABBAJACK_VORTEX_MANUAL) if (lines.Any(line => line.Contains("directURL=")))
return;
Utils.Log($"File {f} contains the {Consts.WABBAJACK_VORTEX_MANUAL} tag, adding to ActiveArchives");
ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
});
}
else
{ {
Utils.Log($"File {f} appears to not come from the Nexus, adding to ActiveArchives"); Utils.Log($"File {f} appears to not come from the Nexus, adding to ActiveArchives");
ActiveArchives.Add(Path.GetFileNameWithoutExtension(f)); ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));