Commit 45d9110c authored by Bruce Cowan's avatar Bruce Cowan

albumwidget: Improve running length label

Change "min" to "minute", and allows for correct plural forms.

Fixes #177
parent 734f85e0
......@@ -171,6 +171,12 @@ class AlbumWidget(Gtk.EventBox):
self._composer_label.set_visible(show)
self._composer_info.set_visible(show)
@log
def _set_duration_label(self):
mins = (self._duration // 60) + 1
self._builder.get_object('running_length_label_info').set_text(
ngettext("{} minute", "{} minutes", mins).format(mins))
@log
def _on_selection_changed(self, widget):
items = self._disc_listbox.get_selected_items()
......@@ -273,8 +279,7 @@ class AlbumWidget(Gtk.EventBox):
disc.show_disc_label(False)
if remaining == 0:
self._builder.get_object('running_length_label_info').set_text(
_("%d min") % (int(self._duration / 60) + 1))
self._set_duration_label()
self.show_all()
......@@ -318,8 +323,7 @@ class AlbumWidget(Gtk.EventBox):
_iter = playlist.iter_next(_iter)
self._builder.get_object('running_length_label_info').set_text(
_("%d min") % (int(self._duration / 60) + 1))
self._set_duration_label()
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment