Med install
This commit is contained in:
@@ -439,9 +439,11 @@ class MainWindow(QMainWindow):
|
||||
songs = []
|
||||
for row in songs_raw:
|
||||
with get_db() as conn:
|
||||
dances = conn.execute(
|
||||
"SELECT dance_name FROM song_dances "
|
||||
"WHERE song_id=? ORDER BY dance_order",
|
||||
dances_raw = conn.execute(
|
||||
"SELECT sd.dance_name, dl.name as level_name "
|
||||
"FROM song_dances sd "
|
||||
"LEFT JOIN dance_levels dl ON dl.id = sd.level_id "
|
||||
"WHERE sd.song_id=? ORDER BY sd.dance_order",
|
||||
(row["id"],)
|
||||
).fetchall()
|
||||
songs.append({
|
||||
@@ -454,7 +456,8 @@ class MainWindow(QMainWindow):
|
||||
"local_path": row["local_path"],
|
||||
"file_format": row["file_format"],
|
||||
"file_missing": bool(row["file_missing"]),
|
||||
"dances": [d["dance_name"] for d in dances],
|
||||
"dances": [d["dance_name"] for d in dances_raw],
|
||||
"dance_levels": [d["level_name"] or "" for d in dances_raw],
|
||||
})
|
||||
self._library_panel.load_songs(songs)
|
||||
count = len(songs)
|
||||
@@ -836,15 +839,13 @@ class MainWindow(QMainWindow):
|
||||
self._vu.reset()
|
||||
|
||||
# Markér den afspillede sang
|
||||
prev_idx = self._current_idx
|
||||
self._playlist_panel.mark_played(prev_idx)
|
||||
self._playlist_panel.mark_played(self._current_idx)
|
||||
|
||||
# Synkroniser event-status til den gemte navngivne liste
|
||||
self._sync_event_status_to_playlist()
|
||||
|
||||
# Find næste afspilbare sang — fra 0 hvis ingen sang var i gang
|
||||
search_from = max(0, prev_idx + 1)
|
||||
ni = self._playlist_panel.next_playable_idx(search_from)
|
||||
# Find første ikke-afspillede og ikke-skippede sang fra TOPPEN
|
||||
ni = self._playlist_panel.next_playable_idx()
|
||||
next_song = self._playlist_panel.get_song(ni) if ni is not None else None
|
||||
if next_song:
|
||||
self._current_idx = ni
|
||||
|
||||
Reference in New Issue
Block a user