Prevent downloading songs that are already loaded. (base: fluddokt/opsu/76778f8)

- All beatmap set IDs are now stored in a set in OsuGroupList.
- OsuParser now checks the directory name for beatmap set IDs if the OsuFile doesn't contain one (for older beatmap formats).

Tweaks:
- Clear completed downloads when hitting "Import All".
- Call Download.updateReadSoFar() upon starting downloads instead of waiting for user to hover over the button (causing an unnecessary delay).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-02-09 23:22:58 -05:00
parent f56c02864b
commit be3b94f5db
7 changed files with 72 additions and 8 deletions

View File

@@ -165,6 +165,7 @@ public class Download {
rbc = new ReadableByteChannelWrapper(readableByteChannel);
fos = fileOutputStream;
status = Status.DOWNLOADING;
updateReadSoFar();
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
if (status == Status.DOWNLOADING) { // not interrupted
status = Status.COMPLETE;