Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tuijam/music_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def header_ui(*txts, weights=()):


class Song(MusicObject):
ui_weights = (1, 2, 1, 0.2, 0.2)
ui_weights = (2, 1, 1, 0.2, 0.2)

def __init__(
self,
Expand Down Expand Up @@ -183,6 +183,8 @@ def from_dict(d):


class Album(MusicObject):
ui_weights = (1, 1, 0.1)

def __init__(self, title, artist, artistId, year, id_):

self.title = title
Expand All @@ -195,11 +197,11 @@ def __repr__(self):
return f"<Album title:{self.title}, artist:{self.artist}, year:{self.year}>"

def ui(self):
return self.to_ui(self.title, self.artist, self.year)
return self.to_ui(self.title, self.artist, self.year, weights=self.ui_weights)

@staticmethod
def header():
return MusicObject.header_ui(_("Album"), _("Artist"), _("Year"))
@classmethod
def header(cls):
return MusicObject.header_ui(_("Album"), _("Artist"), _("Year"), weights=cls.ui_weights)

@staticmethod
def from_dict(d):
Expand Down