Compare commits

...

3 Commits

Author SHA1 Message Date
Keith Edmunds
1a4f842f1f Set last played time when playing track
Fixes #83
2021-09-26 08:47:00 +01:00
Keith Edmunds
69dd0235a0 Improve note colouring
- Make case insensitive
 - If not starts with key, it's a match

Fixes #71
2021-09-25 22:33:17 +01:00
Keith Edmunds
ab858a62fd Fix moving tracks with Wikipedia tabs open
Fixes #77
2021-09-25 22:22:34 +01:00
2 changed files with 10 additions and 4 deletions

View File

@ -420,6 +420,9 @@ class Window(QMainWindow, Ui_MainWindow):
# the playlistis opened.
destination_visible_playlist_tab = None
for tab in range(self.tabPlaylist.count()):
# Non-playlist tabs won't have ids
if not hasattr(self.tabPlaylist.widget(tab), 'id'):
continue
if self.tabPlaylist.widget(tab).id == dlg.plid:
destination_visible_playlist_tab = (
self.tabPlaylist.widget(tab))

View File

@ -1032,10 +1032,9 @@ class PlaylistTab(QTableWidget):
# Set colour
note_colour = Config.COLOUR_NOTES_PLAYLIST
note_text = self.item(row, self.COL_TITLE).text()
note_tokens = note_text.split(":", 1)
if len(note_tokens) == 2:
if note_tokens[0] in Config.NOTE_COLOURS:
note_colour = Config.NOTE_COLOURS[note_tokens[0]]
for colour_token in Config.NOTE_COLOURS.keys():
if note_text.lower().startswith(colour_token.lower()):
note_colour = Config.NOTE_COLOURS[colour_token]
self._set_row_colour(
row, QColor(note_colour)
)
@ -1052,6 +1051,10 @@ class PlaylistTab(QTableWidget):
# Set start time
self._set_row_start_time(
row, self.current_track_start_time)
last_played_str = get_relative_date(
self.current_track_start_time)
self.item(row, self.COL_LAST_PLAYED).setText(
last_played_str)
# Calculate next_start_time
next_start_time = self._calculate_next_start_time(
session, row, self.current_track_start_time)