mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-12-16 05:31:58 +01:00
Add entry deletion, footer
This commit is contained in:
10
database.py
10
database.py
@@ -28,7 +28,7 @@ def create_entry_table():
|
||||
def create_list_view():
|
||||
conn = open_db()
|
||||
conn.execute("""CREATE VIEW IF NOT EXISTS [Liste] AS
|
||||
SELECT Name, Title, Artist
|
||||
SELECT Name, Title, Artist, entries.Id
|
||||
FROM entries, songs
|
||||
WHERE entries.Song_Id=songs.Id""")
|
||||
conn.close()
|
||||
@@ -59,3 +59,11 @@ def add_entry(name,song_id):
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return
|
||||
|
||||
def delete_entry(id):
|
||||
conn = open_db()
|
||||
cur = conn.cursor()
|
||||
cur.execute("DELETE FROM entries WHERE id=?",(id,))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user