mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-25 06:00:56 +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);
|
||||
} else {
|
||||
this.downloadingfile = false;
|
||||
|
||||
// if download only mode, just download the file. no redirect
|
||||
if (forceView === false && this.downloadOnlyMode && !this.iOS) {
|
||||
this.postsService.downloadFileFromServer(name, 'audio').subscribe(res => {
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, name + '.mp3');
|
||||
this.downloadingfile = false;
|
||||
|
||||
// tell server to delete the file once downloaded
|
||||
this.postsService.deleteFile(name, true).subscribe(delRes => {
|
||||
|
||||
});
|
||||
});
|
||||
} else {
|
||||
window.location.href = this.exists;
|
||||
@@ -159,12 +165,17 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
setTimeout(() => this.downloadHelperMp4(name), 500);
|
||||
} else {
|
||||
this.downloadingfile = false;
|
||||
|
||||
// if download only mode, just download the file. no redirect
|
||||
if (forceView === false && this.downloadOnlyMode) {
|
||||
this.postsService.downloadFileFromServer(name, 'video').subscribe(res => {
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, name + '.mp4');
|
||||
this.downloadingfile = false;
|
||||
|
||||
// tell server to delete the file once downloaded
|
||||
this.postsService.deleteFile(name, false).subscribe(delRes => {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
window.location.href = this.exists;
|
||||
|
||||
Reference in New Issue
Block a user