Commit 58ec9e98 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Do not show tracknumber for playlists, too slow too calculate

parent db4454b4
Pipeline #197316 passed with stage
in 4 minutes and 3 seconds
......@@ -211,7 +211,8 @@ class AlbumTracksView(TracksView):
for track in tracks:
# If user does not want to show real tracknumber and we are
# in album view, calculate a fake tracknumber
if not self.__show_tag_tracknumber:
if not self.__show_tag_tracknumber and\
self.view_type & ViewType.ALBUM:
track.set_number(position + 1)
row = TrackRow(track, self.__album.artist_ids, self.view_type)
row.show()
......
......@@ -69,7 +69,6 @@ class TrackRow(Gtk.ListBoxRow):
self._num_label.set_ellipsize(Pango.EllipsizeMode.END)
self._num_label.set_width_chars(4)
self._num_label.get_style_context().add_class("dim-label")
self._num_label.show()
self.update_number_label()
self._grid.add(self._num_label)
self.__title_label = Gtk.Label.new(
......@@ -169,6 +168,8 @@ class TrackRow(Gtk.ListBoxRow):
"""
Update position label for row
"""
if self.__view_type & (ViewType.PLAYBACK | ViewType.PLAYLISTS):
return
if App().player.is_in_queue(self._track.id):
self._num_label.get_style_context().add_class("queued")
pos = App().player.get_track_position(self._track.id)
......@@ -181,6 +182,7 @@ class TrackRow(Gtk.ListBoxRow):
label = str(self._track.number)
self._num_label.set_text(label)
self._num_label.get_style_context().remove_class("queued")
self._num_label.show()
def popup_menu(self, parent, x=None, y=None):
"""
......
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