rettelser

This commit is contained in:
2026-04-19 17:19:59 +02:00
parent c966d38f11
commit fb7622549c
7 changed files with 81 additions and 33 deletions

View File

@@ -20,6 +20,7 @@ class PlaylistBrowserDialog(QDialog):
"""Kombineret gem/hent dialog til danselister."""
playlist_selected = pyqtSignal(int, str) # playlist_id, name
sync_requested = pyqtSignal() # bed main_window om at køre sync
def __init__(self, mode: str = "load", current_songs: list = None,
current_name: str = "", parent=None):
@@ -344,10 +345,11 @@ class PlaylistBrowserDialog(QDialog):
)
if reply == QMessageBox.StandardButton.Yes:
try:
from local.local_db import get_db
with get_db() as conn:
conn.execute("DELETE FROM playlists WHERE id=?", (pl["id"],))
from local.local_db import delete_playlist
delete_playlist(pl["id"])
self._load_data()
# Signal til main_window om at køre sync
self.sync_requested.emit()
except Exception as e:
QMessageBox.warning(self, "Fejl", f"Kunne ikke slette: {e}")