Skip to content

Commit

Permalink
PackageBuilder: Fix double title copy and ensure ZipAssets creates a …
Browse files Browse the repository at this point in the history
…folder on extraction
  • Loading branch information
Lemon-King committed Jun 23, 2024
1 parent 8c72718 commit 7fe4119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/lemon/hxdd/builder/PackageBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,15 +552,13 @@ private void DownloadArtwork(int id, String name, String source, String filter)
InputStream in = dl.openStream();
Files.copy(in, Path.of(steamPNG.getAbsolutePath()), StandardCopyOption.REPLACE_EXISTING);
in.close();

Files.copy(steamPNG.toPath(), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING);
}

File dirFile = new File(titlePNG.getParent());
if (!dirFile.exists()) {
dirFile.mkdirs();
}
Files.copy(steamPNG.toPath(), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING);
Files.copy(Path.of(steamPNG.getAbsolutePath()), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (URISyntaxException | IOException e) {
e.printStackTrace();
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/lemon/hxdd/builder/ZipAssets.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ void ExtractSingleFile(String input, String output) {
ZipEntry entry;
while ((entry = this.zis.getNextEntry()) != null) {
if (input.equals(entry.getName())) {
File dirFile = new File(new File(path + "/" + output).getParent());
if (!dirFile.exists()) {
dirFile.mkdirs();
}
OutputStream os = new FileOutputStream(path + "/" + output);
os.write(this.zis.readAllBytes());
os.close();
Expand Down

0 comments on commit 7fe4119

Please sign in to comment.