mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Consts.MetaFileExtension
This commit is contained in:
parent
4138e644ef
commit
0cb1d3cb0a
@ -89,6 +89,7 @@ namespace Wabbajack.Common
|
||||
}
|
||||
|
||||
public static string HashFileExtension => ".xxHash";
|
||||
public static string MetaFileExtension => ".meta";
|
||||
public static string LocalAppDataPath => Path.Combine(KnownFolders.LocalAppData.Path, "Wabbajack");
|
||||
public static string MetricsKeyHeader => "x-metrics-key";
|
||||
|
||||
|
@ -140,13 +140,13 @@ namespace Wabbajack.Lib
|
||||
UpdateTracker.NextStep("Pre-validating Archives");
|
||||
|
||||
IndexedArchives = Directory.EnumerateFiles(MO2DownloadsFolder)
|
||||
.Where(f => File.Exists(f + ".meta"))
|
||||
.Where(f => File.Exists(f + Consts.MetaFileExtension))
|
||||
.Select(f => new IndexedArchive
|
||||
{
|
||||
File = VFS.Index.ByRootPath[f],
|
||||
Name = Path.GetFileName(f),
|
||||
IniData = (f + ".meta").LoadIniFile(),
|
||||
Meta = File.ReadAllText(f + ".meta")
|
||||
IniData = (f + Consts.MetaFileExtension).LoadIniFile(),
|
||||
Meta = File.ReadAllText(f + Consts.MetaFileExtension)
|
||||
})
|
||||
.ToList();
|
||||
|
||||
@ -324,8 +324,8 @@ namespace Wabbajack.Lib
|
||||
private async Task InferMetas()
|
||||
{
|
||||
var to_find = Directory.EnumerateFiles(MO2DownloadsFolder)
|
||||
.Where(f => !f.EndsWith(".meta") && !f.EndsWith(Consts.HashFileExtension))
|
||||
.Where(f => !File.Exists(f + ".meta"))
|
||||
.Where(f => !f.EndsWith(Consts.MetaFileExtension) && !f.EndsWith(Consts.HashFileExtension))
|
||||
.Where(f => !File.Exists(f + Consts.MetaFileExtension))
|
||||
.ToList();
|
||||
|
||||
if (to_find.Count == 0) return;
|
||||
@ -342,7 +342,7 @@ namespace Wabbajack.Lib
|
||||
|
||||
var ini_data = await response.Content.ReadAsStringAsync();
|
||||
Utils.Log($"Inferred .meta for {Path.GetFileName(vf.FullPath)}, writing to disk");
|
||||
File.WriteAllText(vf.FullPath + ".meta", ini_data);
|
||||
File.WriteAllText(vf.FullPath + Consts.MetaFileExtension, ini_data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ namespace Wabbajack.Lib
|
||||
Utils.Log($"Including {SelectedArchives.Count} .meta files for downloads");
|
||||
await SelectedArchives.PMap(Queue, a =>
|
||||
{
|
||||
var source = Path.Combine(MO2DownloadsFolder, a.Name + ".meta");
|
||||
var source = Path.Combine(MO2DownloadsFolder, a.Name + Consts.MetaFileExtension);
|
||||
InstallDirectives.Add(new ArchiveMeta()
|
||||
{
|
||||
SourceDataID = IncludeFile(File.ReadAllText(source)),
|
||||
|
@ -127,13 +127,13 @@ namespace Wabbajack.Lib
|
||||
|
||||
Info("Indexing Archives");
|
||||
IndexedArchives = Directory.EnumerateFiles(DownloadsFolder)
|
||||
.Where(f => File.Exists(f + ".meta"))
|
||||
.Where(f => File.Exists(f + Consts.MetaFileExtension))
|
||||
.Select(f => new IndexedArchive
|
||||
{
|
||||
File = VFS.Index.ByRootPath[f],
|
||||
Name = Path.GetFileName(f),
|
||||
IniData = (f + ".meta").LoadIniFile(),
|
||||
Meta = File.ReadAllText(f + ".meta")
|
||||
IniData = (f + Consts.MetaFileExtension).LoadIniFile(),
|
||||
Meta = File.ReadAllText(f + Consts.MetaFileExtension)
|
||||
})
|
||||
.ToList();
|
||||
|
||||
@ -331,7 +331,7 @@ namespace Wabbajack.Lib
|
||||
var nexusClient = await NexusApiClient.Get();
|
||||
|
||||
var archives = Directory.EnumerateFiles(DownloadsFolder, "*", SearchOption.TopDirectoryOnly).Where(f =>
|
||||
File.Exists(f) && Path.GetExtension(f) != ".meta" && Path.GetExtension(f) != ".xxHash" &&
|
||||
File.Exists(f) && Path.GetExtension(f) != Consts.MetaFileExtension && Path.GetExtension(f) != ".xxHash" &&
|
||||
!File.Exists($"{f}.meta") && ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)));
|
||||
|
||||
await archives.PMap(Queue, async f =>
|
||||
@ -359,7 +359,7 @@ namespace Wabbajack.Lib
|
||||
$"fileID={md5Response[0].file_details.file_id}\n" +
|
||||
$"version={md5Response[0].file_details.version}\n" +
|
||||
$"hash={hash}\n";
|
||||
File.WriteAllText(f + ".meta", metaString, Encoding.UTF8);
|
||||
File.WriteAllText(f + Consts.MetaFileExtension, metaString, Encoding.UTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -368,7 +368,7 @@ namespace Wabbajack.Lib
|
||||
});
|
||||
|
||||
var otherFiles = Directory.EnumerateFiles(DownloadsFolder, "*", SearchOption.TopDirectoryOnly).Where(f =>
|
||||
Path.GetExtension(f) == ".meta" && !ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)));
|
||||
Path.GetExtension(f) == Consts.MetaFileExtension && !ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)));
|
||||
|
||||
await otherFiles.PMap(Queue, async f =>
|
||||
{
|
||||
|
@ -211,7 +211,7 @@ namespace Wabbajack.Lib
|
||||
await ModList.Directives.OfType<InlineFile>()
|
||||
.PMap(Queue,directive =>
|
||||
{
|
||||
if (directive.To.EndsWith(".meta"))
|
||||
if (directive.To.EndsWith(Consts.MetaFileExtension))
|
||||
return;
|
||||
|
||||
Info($"Writing included file {directive.To}");
|
||||
|
@ -137,7 +137,7 @@ namespace Wabbajack.Test
|
||||
|
||||
await FileExtractor.ExtractAll(Queue, src, Path.Combine(utils.ModsFolder, mod_name));
|
||||
|
||||
File.WriteAllText(dest + ".meta", ini);
|
||||
File.WriteAllText(dest + Consts.MetaFileExtension, ini);
|
||||
}
|
||||
|
||||
private async Task<ModList> CompileAndInstall(string profile)
|
||||
|
@ -147,7 +147,7 @@ namespace Wabbajack.Test
|
||||
});
|
||||
}
|
||||
|
||||
File.WriteAllLines(Path.Combine(DownloadsFolder, name+".meta"),
|
||||
File.WriteAllLines(Path.Combine(DownloadsFolder, name + Consts.MetaFileExtension),
|
||||
|
||||
new string[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user