Show album length on Playlist and Library panel (close #57)
Show the length of an album in the tooltip on the Playlist and the Library panel.
This commit is contained in:
parent
477f89cc0b
commit
704fa3278a
6 changed files with 35 additions and 18 deletions
|
|
@ -66,6 +66,13 @@ class Utils:
|
|||
return label
|
||||
|
||||
|
||||
def create_length_label(album):
|
||||
minutes = album.get_length() // 60
|
||||
seconds = album.get_length() - minutes * 60
|
||||
|
||||
return locale.gettext("{}:{} minutes").format(minutes, seconds)
|
||||
|
||||
|
||||
def create_track_title(track):
|
||||
title = track.get_title()
|
||||
if track.get_artists():
|
||||
|
|
|
|||
|
|
@ -1454,7 +1454,8 @@ class PlaylistPanel(GObject.GObject):
|
|||
GObject.markup_escape_text("\n".join([
|
||||
album.get_title(),
|
||||
', '.join(album.get_dates()),
|
||||
Utils.create_artists_label(album)
|
||||
Utils.create_artists_label(album),
|
||||
Utils.create_length_label(album)
|
||||
])),
|
||||
album.get_id()
|
||||
])
|
||||
|
|
@ -1942,7 +1943,8 @@ class LibraryPanel(GObject.GObject):
|
|||
GObject.markup_escape_text("\n".join([
|
||||
album.get_title(),
|
||||
', '.join(album.get_dates()),
|
||||
Utils.create_artists_label(album)
|
||||
Utils.create_artists_label(album),
|
||||
Utils.create_length_label(album)
|
||||
])),
|
||||
album_id
|
||||
])
|
||||
|
|
|
|||
Loading…
Reference in a new issue