mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-21 04:00:57 +03:00
youtube-dl refactor (#956)
* Consolidated all youtube-dl calls into one function * Downloads can now be cancelled and better "paused" * Removed node-youtube-dl dependency * Added ability to manually check a subscription, and to cancel a subscription check --------- Co-authored-by: Dedy Martadinata S <dedyms@proton.me>
This commit is contained in:
@@ -169,6 +169,8 @@ export class MainComponent implements OnInit {
|
||||
argsChangedSubject: Subject<boolean> = new Subject<boolean>();
|
||||
simulatedOutput = '';
|
||||
|
||||
interval_id = null;
|
||||
|
||||
constructor(public postsService: PostsService, private youtubeSearch: YoutubeSearchService, public snackBar: MatSnackBar,
|
||||
private router: Router, public dialog: MatDialog, private platform: Platform, private route: ActivatedRoute) {
|
||||
this.audioOnly = false;
|
||||
@@ -232,11 +234,12 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
|
||||
// get downloads routine
|
||||
setInterval(() => {
|
||||
if (this.interval_id) { clearInterval(this.interval_id) }
|
||||
this.interval_id = setInterval(() => {
|
||||
if (this.current_download) {
|
||||
this.getCurrentDownload();
|
||||
}
|
||||
}, 500);
|
||||
}, 1000);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -294,6 +297,10 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.interval_id) { clearInterval(this.interval_id) }
|
||||
}
|
||||
|
||||
// download helpers
|
||||
downloadHelper(container: DatabaseFile | Playlist, type: string, is_playlist = false, force_view = false, navigate_mode = false): void {
|
||||
this.downloadingfile = false;
|
||||
|
||||
Reference in New Issue
Block a user