public void progressing(int length, int offset) {
setStatus(offset * 100 / length + " % | " + builder.toString());
}
};
for (i = 0; i < lists.length; i++) {
ISong song = listSongs.get(lists[i]);
String extension = configure.format.equals(Format.LOSSLESS) ? ".flac" : ".mp3";
String file = dir + File.separator + Utils.toANSI(song.getFullTitle()) + extension;
info.setToolTipText(String.format("<html><b>Saving file %s</b></html>", file));
if(new File(file).exists() || song.getDirectLinks() == null) continue;
try {
FileUtils.songToFile(song, new File(file), streaming);
} catch (Exception e) {
out.println(String.format("Can not save link %s", song.getDirectLinks()));
}
builder.delete(0, builder.length());
builder.append(String.format("%d / %d", i + 1, lists.length));
}
setStatus(String.format("SAVED: %d / %d", i, lists.length));