Better progressbar

This commit is contained in:
jeffser 2024-07-22 22:26:39 -06:00
parent f51d01b618
commit 88ff7c4dda

View File

@ -963,7 +963,7 @@ Generate a title following these rules:
def pull_model_update(self, data, model_name):
if model_name in list(self.pulling_models.keys()):
if 'completed' in data and 'total' in data:
GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, '<tt>{}%</tt>\t{}'.format(round(data['completed'] / data['total'] * 100, 2), data['status'].capitalize()))
GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, '<tt>{}%</tt>'.format(round(data['completed'] / data['total'] * 100, 2)))
GLib.idle_add(self.pulling_models[model_name]['progress_bar'].set_fraction, (data['completed'] / data['total']))
else:
GLib.idle_add(self.pulling_models[model_name]['row'].set_subtitle, '{}'.format(data['status'].capitalize()))