Skip to content

Commit

Permalink
Fix file extraction logic - now the whole file is extracted, not just…
Browse files Browse the repository at this point in the history
… a placeholder file
  • Loading branch information
bookdude13 authored and tommaier123 committed Oct 22, 2022
1 parent b6f19d1 commit 28d99b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NoodleManagerX/Models/StorageAbstraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public static bool FileExists(string path)
}
}

public static string GetFullComputerPath(string pathRelativeToSynthDir)
{
return Path.Combine(MainViewModel.s_instance.settings.synthDirectory, pathRelativeToSynthDir);
}

public static void DeleteFile(string path)
{
if (MtpDevice.connected)
Expand Down
8 changes: 6 additions & 2 deletions NoodleManagerX/Mods/ModItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ private async Task<bool> ExtractModFilesToSynthDir(string synthmodPath)
if (StorageAbstraction.FileExists(entry.FullName))
{
MainViewModel.Log($"WARNING: Overwriting {entry.FullName}");
await StorageAbstraction.WriteFile(await CopyStreamToMemoryStream(stream, false), entry.FullName);
// TODO use a more generic function once modding is supported on Oculus
var fullPath = StorageAbstraction.GetFullComputerPath(entry.FullName);
entry.ExtractToFile(fullPath, true);
}
else
{
Expand All @@ -215,7 +217,9 @@ private async Task<bool> ExtractModFilesToSynthDir(string synthmodPath)
else
{
MainViewModel.Log($"Extracting file {entry.FullName}");
await StorageAbstraction.WriteFile(await CopyStreamToMemoryStream(stream, false), entry.FullName);
// TODO use a more generic function once modding is supported on Oculus
var fullPath = StorageAbstraction.GetFullComputerPath(entry.FullName);
entry.ExtractToFile(fullPath);
}
}
}
Expand Down

0 comments on commit 28d99b5

Please sign in to comment.