Added a progress bar for downloads in the application. Fixed a problem with format in Tidal

This commit is contained in:
2019-06-24 12:45:09 -05:00
parent bb97d017b5
commit 7756d71b32
5 changed files with 10 additions and 0 deletions

View File

@@ -88,8 +88,13 @@ class Controller(object):
pub.subscribe(self.change_status, "change_status")
pub.subscribe(self.on_download_finished, "download_finished")
pub.subscribe(self.on_notify, "notify")
pub.subscribe(self.on_update_progress, "update-progress")
# Event functions. These functions will call other functions in a thread and are bound to widget events.
def on_update_progress(self, value):
wx.CallAfter(self.window.progressbar.SetValue, value)
def on_settings(self, *args, **kwargs):
settings = configuration.configuration()
self.reload_extractors()

View File

@@ -149,6 +149,7 @@ class audioPlayer(object):
while True:
state = media.get_state()
pub.sendMessage("change_status", status=_("Downloading {0} ({1}%).").format(item.title, int(transcoder.get_position()*100)))
pub.sendMessage("update-progress", value=int(transcoder.get_position()*100))
if str(state) == 'State.Ended':
break
elif str(state) == 'state.error':