Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit affe78e

Browse files
committed
Version
1 parent c6b390a commit affe78e

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/main/java/at/becast/youploader/youtube/upload/UploadManager.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,20 +332,20 @@ public void restart(int upload_id) {
332332
for(int i=0;i<_Uploading.size();i++){
333333
if(_Uploading.get(i).id == upload_id){
334334
UploadWorker o = _Uploading.get(i);
335+
_Uploading.remove(i);
336+
try {
337+
o.join();
338+
} catch (InterruptedException e1) {
339+
LOG.error("Upload worker thread timeout was interrupted", e1);
340+
}
335341
if(o.retrys<5){
336-
try {
337-
for(int s = 10; s>0;s--){
338-
o.frame.getProgressBar().setString(String.format(LANG.getString("Upload.Error"), s));
339-
Thread.sleep(1000);
340-
}
341-
} catch (InterruptedException e) {
342-
LOG.error("Upload worker thread timeout was interrupted", e);
342+
for(int s = 10; s>0;s--){
343+
o.frame.getProgressBar().setString(String.format(LANG.getString("Upload.Error"), s));
343344
}
344-
345345
LOG.info("Restarting Upload {}",o.videodata.snippet.title);
346346
UploadWorker worker = new UploadWorker(upload_id, o.file, o.videodata, this.getSpeed_limit(), o.metadata, o.upload.url, o.upload.id, o.startAt);
347347
worker.setRetrys(o.getRetrys());
348-
_Uploading.set(i, worker);
348+
_Uploading.addFirst(worker);
349349
worker.start();
350350
}else{
351351
o.frame.getProgressBar().setString(LANG.getString("Upload.Failed"));

src/main/java/at/becast/youploader/youtube/upload/Uploader.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ public void setPlaylists(String playlist, Upload upload) throws IOException, Upl
103103

104104
public void abort() {
105105
try {
106-
this.http.setAborted(true);
107-
this.stream.abort();
108-
this.http.abort();
106+
this.stream.close();
107+
this.http.close();
109108
} catch (Exception e) {
110109

111110
}

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.1-beta
1+
0.9.2-beta

0 commit comments

Comments
 (0)