feat: show the user that subtitles are downloading (#53)

This commit is contained in:
Jelle Glebbeek
2021-05-17 21:48:45 +02:00
parent 059180d2ed
commit 850cd76385
3 changed files with 10 additions and 1 deletions

View File

@@ -59,10 +59,11 @@ class DownloadQuery extends Query {
];
}
if (this.video.downloadSubs) {
this.progressBar.setInitial("Downloading subtitles");
args.push("--all-subs");
args.push("--embed-subs");
args.push("--sub-format")
args.push("srt")
args.push("srt");
args.push("--convert-subs");
args.push("srt");
if(this.environment.settings.autoGenSubs) {

View File

@@ -17,6 +17,10 @@ class ProgressBar {
this.manager.updateProgress(this.video, {reset: true})
}
setInitial(message) {
this.manager.updateProgress(this.video, {initial: true, message: message});
}
done(isAudio) {
let audio = isAudio;
if(!this.isUnifiedPlaylist()) audio = this.video.formats.length === 0 ? null : isAudio;

View File

@@ -602,6 +602,10 @@ function updateProgress(args) {
resetProgress($(card).find('.progress-bar')[0], card);
return;
}
if(args.progress.initial != null && args.progress.initial) {
$(card).find('.progress small').html(args.progress.message);
return;
}
if(args.progress.finished != null && args.progress.finished) {
if(args.progress.isPlaylist) {
$(card).find('.progress small').html("Playlist downloaded - 100%");