Compare commits

..

No commits in common. "42b5c2413c717128a64f5f7a3f7815b0830189e6" and "954b40403106e85ed134830d38f9141d9523f8ac" have entirely different histories.

4 changed files with 7 additions and 9 deletions

View File

@ -93,7 +93,6 @@ class Config(object):
REPLACE_FILES_DEFAULT_SOURCE = "/home/kae/music/Singles/tmp"
RETURN_KEY_DEBOUNCE_MS = 1000
ROOT = os.environ.get("ROOT") or "/home/kae/music"
ROW_PADDING = 4
ROWS_FROM_ZERO = True
SCROLL_TOP_MARGIN = 3
SECTION_ENDINGS = ("-", "+-", "-+")

View File

@ -196,7 +196,7 @@ def get_relative_date(
days_str = "day"
else:
days_str = "days"
return f"{weeks} {weeks_str}, {days} {days_str}"
return f"{weeks} {weeks_str}, {days} {days_str} ago"
def get_tags(path: str) -> Dict[str, Any]:

View File

@ -376,9 +376,7 @@ class PlaylistModel(QAbstractTableModel):
if not header_text:
return QVariant(Config.TEXT_NO_TRACK_NO_NOTE)
else:
formatted_header = self.header_text(rat)
trimmed_header = self.remove_section_timer_markers(formatted_header)
return QVariant(trimmed_header)
return QVariant(self.header_text(rat))
else:
return QVariant("")
@ -1212,8 +1210,6 @@ class PlaylistModel(QAbstractTableModel):
Return header text witout markers
"""
if header_text == '=':
return ""
while header_text.endswith(Config.SECTION_STARTS):
header_text = header_text[0:-1]
while header_text.endswith(Config.SECTION_ENDINGS):
@ -1265,7 +1261,10 @@ class PlaylistModel(QAbstractTableModel):
for row_number in range(rat.row_number - 1, -1, -1):
row_rat = self.playlist_rows[row_number]
if self.is_header_row(row_number):
if row_rat.note.endswith(Config.SECTION_STARTS):
if row_rat.note.endswith("-"):
# There was no start of section
return rat.note
if row_rat.note.endswith(("+", "=")):
# If we are playing this section, also
# calculate end time if all tracks are played.
end_time_str = ""

View File

@ -212,7 +212,7 @@ class PlaylistDelegate(QStyledItemDelegate):
doc = QTextDocument()
doc.setTextWidth(option.rect.width())
doc.setDefaultFont(option.font)
doc.setDocumentMargin(Config.ROW_PADDING)
doc.setDocumentMargin(0)
doc.setHtml(option.text)
# For debugging +++