mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-20 20:33:19 +03:00
fixed bug where going back to the page after entering a stream didn't allow downloading of new files
in download only mode, files are now auto deleted when saved
This commit is contained in:
@@ -127,12 +127,18 @@ export class AppComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
setTimeout(() => this.downloadHelperMp3(name), 500);
|
setTimeout(() => this.downloadHelperMp3(name), 500);
|
||||||
} else {
|
} else {
|
||||||
|
this.downloadingfile = false;
|
||||||
|
|
||||||
// if download only mode, just download the file. no redirect
|
// if download only mode, just download the file. no redirect
|
||||||
if (forceView === false && this.downloadOnlyMode && !this.iOS) {
|
if (forceView === false && this.downloadOnlyMode && !this.iOS) {
|
||||||
this.postsService.downloadFileFromServer(name, 'audio').subscribe(res => {
|
this.postsService.downloadFileFromServer(name, 'audio').subscribe(res => {
|
||||||
const blob: Blob = res;
|
const blob: Blob = res;
|
||||||
saveAs(blob, name + '.mp3');
|
saveAs(blob, name + '.mp3');
|
||||||
this.downloadingfile = false;
|
|
||||||
|
// tell server to delete the file once downloaded
|
||||||
|
this.postsService.deleteFile(name, true).subscribe(delRes => {
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.location.href = this.exists;
|
window.location.href = this.exists;
|
||||||
@@ -159,12 +165,17 @@ export class AppComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
setTimeout(() => this.downloadHelperMp4(name), 500);
|
setTimeout(() => this.downloadHelperMp4(name), 500);
|
||||||
} else {
|
} else {
|
||||||
|
this.downloadingfile = false;
|
||||||
|
|
||||||
// if download only mode, just download the file. no redirect
|
// if download only mode, just download the file. no redirect
|
||||||
if (forceView === false && this.downloadOnlyMode) {
|
if (forceView === false && this.downloadOnlyMode) {
|
||||||
this.postsService.downloadFileFromServer(name, 'video').subscribe(res => {
|
this.postsService.downloadFileFromServer(name, 'video').subscribe(res => {
|
||||||
const blob: Blob = res;
|
const blob: Blob = res;
|
||||||
saveAs(blob, name + '.mp4');
|
saveAs(blob, name + '.mp4');
|
||||||
this.downloadingfile = false;
|
|
||||||
|
// tell server to delete the file once downloaded
|
||||||
|
this.postsService.deleteFile(name, false).subscribe(delRes => {
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.location.href = this.exists;
|
window.location.href = this.exists;
|
||||||
|
|||||||
Reference in New Issue
Block a user