Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailCosmin committed Nov 10, 2022
1 parent 5042a06 commit cb27a57
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions src/Youtube Downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,20 +282,37 @@ def _download_queue(self, progress_bar=None):
if self.progress_bar is not None:
self.progress_bar.hide()
if self.queue:
self.progress_bar = progress_bar
self.progress_bar.show()
self.progress_bar.setTextVisible(True)
self.progress_bar.setFormat("Download starting...")
self.progress_bar.setValue(0)

self.worker = Worker(
self._download_single_queue,
progress=True,
console=False,
)
self.worker.signals.progress.connect(self._progress_bar_update)
self.worker.signals.finished.connect(self._thread_complete)
self.threadpool.start(self.worker)
if len(self.queue) > 1:
self.progress_bar = progress_bar
self.progress_bar.show()
self.progress_bar.setTextVisible(True)
self.progress_bar.setFormat("Download starting...")
self.progress_bar.setValue(0)

self.worker = Worker(
self._download_single_queue,
progress=True,
console=False,
)
self.worker.signals.progress.connect(self._progress_bar_update)
self.worker.signals.finished.connect(self._thread_complete)
self.threadpool.start(self.worker)
else:
self._pass_config()
self.progress_bar = progress_bar
self.progress_bar.show()
self.progress_bar.setTextVisible(True)
self.progress_bar.setFormat("Download starting...")
self.progress_bar.setValue(0)
self.worker = Worker(
self.ydl.download_video,
self.queue[0],
progress=True,
console=False
)
self.worker.signals.progress.connect(self._progress_bar_update)

self.threadpool.start(self.worker)
else:
self.bubble.setText("Queue is empty")
self.bubble.show()
Expand Down

0 comments on commit cb27a57

Please sign in to comment.