Skip to content

Commit 3b89405

Browse files
committed
Account for weird double-zipped PMPs
1 parent 032718c commit 3b89405

File tree

1 file changed

+18
-0
lines changed
  • xivModdingFramework/Mods/FileTypes

1 file changed

+18
-0
lines changed

xivModdingFramework/Mods/FileTypes/PMP.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ await IOUtil.UnzipFiles(path, tempFolder, (file) =>
8282
});
8383
path = tempFolder;
8484
}
85+
86+
var metaPath = Path.GetFullPath(Path.Combine(path, "meta.json"));
87+
if (!File.Exists(metaPath))
88+
{
89+
if (Directory.Exists(path))
90+
{
91+
var subs = Directory.EnumerateDirectories(path).ToList();
92+
if(subs.Count == 1)
93+
{
94+
metaPath = Path.GetFullPath(Path.Combine(path, subs[0], "meta.json"));
95+
if (File.Exists(metaPath))
96+
{
97+
path = Path.GetFullPath(Path.Combine(path, subs[0]));
98+
}
99+
}
100+
}
101+
}
102+
85103
return path;
86104
}
87105

0 commit comments

Comments
 (0)