Fix adding duplicate track and merging comments

Fixes #271
This commit is contained in:
Keith Edmunds 2024-12-26 15:05:07 +00:00
parent 3fde474a5b
commit e5dc3dbf03
2 changed files with 8 additions and 1 deletions

View File

@ -985,6 +985,7 @@ class PlaylistModel(QAbstractTableModel):
playlist_row.note += "\n" + note
else:
playlist_row.note = note
self.refresh_row(session, playlist_row.row_number)
session.commit()
# Carry out the move outside of the session context to ensure

View File

@ -214,7 +214,13 @@ class PlaylistDelegate(QStyledItemDelegate):
doc.setTextWidth(option.rect.width())
doc.setDefaultFont(option.font)
doc.setDocumentMargin(Config.ROW_PADDING)
doc.setHtml(option.text)
if '\n' in option.text:
txt = option.text.replace('\n', '<br>')
elif '\u2028' in option.text:
txt = option.text.replace('\u2028', '<br>')
else:
txt = option.text
doc.setHtml(txt)
# For debugging +++
# Calculate sizes