Use Download class to download track previews into a Temp/ directory.

AudioSystem.getAudioInputStream(URL) was causing issues, so just download the files using the more robust Download class.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2016-10-13 04:12:47 -04:00
parent 89e8341686
commit dabfb827ee
7 changed files with 93 additions and 36 deletions

View File

@@ -167,12 +167,13 @@ public class Download {
/**
* Starts the download from the "waiting" status.
* @return the started download thread, or {@code null} if none started
*/
public void start() {
public Thread start() {
if (status != Status.WAITING)
return;
return null;
new Thread() {
Thread t = new Thread() {
@Override
public void run() {
// open connection
@@ -274,7 +275,9 @@ public class Download {
listener.error();
}
}
}.start();
};
t.start();
return t;
}
/**