Skip to content

Commit

Permalink
Skip default beatmap during beatmap export
Browse files Browse the repository at this point in the history
  • Loading branch information
ringosham committed Jan 24, 2019
1 parent 430cfc9 commit 0f59cd9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/com/ringosham/threads/export/beatmap/BeatmapExport.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public BeatmapExport(MainScreen mainScreen, File exportDir) {

@Override
protected Void call() {
updateProgress(0, Global.INSTANCE.beatmapList.size());
updateProgress(0, Global.INSTANCE.beatmapList.size() - 1);
int progress = 0;
for (Beatmap beatmap : Global.INSTANCE.beatmapList) {
//Skips the default beatmap. There is no use importing it anyway as it has no beatmap data.
if (beatmap.getBeatmapId() == -1)
continue;
updateMessage(Localizer.getLocalizedText("status.beatmap.exportingMap").replace("%BEATMAP%", beatmap.getBeatmapFullname()));
File outputFile = new File(exportDir, Global.INSTANCE.getValidFileName(beatmap.getBeatmapFullname() + ".osz"));
try {
Expand All @@ -49,7 +52,7 @@ protected Void call() {
while ((length = in.read(buffer)) > 0)
stream.write(buffer, 0, length);
fileCount++;
int finalFileCount = fileCount;
final int finalFileCount = fileCount;
Platform.runLater(() -> mainScreen.subProgress.setProgress((double) finalFileCount / beatmap.getFileMap().keySet().size()));
}
stream.close();
Expand Down

0 comments on commit 0f59cd9

Please sign in to comment.