Implementacija obveščanja preko ntfy.sh #12

This commit is contained in:
2026-03-21 22:52:32 +01:00
parent e57727ba0b
commit e49142ea6f
6 changed files with 93 additions and 3 deletions

View File

@@ -241,12 +241,20 @@ def update_song():
_projector_app.song_number = str(new_id)
_projector_app.load_song()
# Pošlji ntfy obvestilo
if hasattr(_projector_app, 'send_ntfy_notification'):
_projector_app.send_ntfy_notification(new_id, title, lyrics)
return jsonify({'status': 'ok', 'new_id': new_id})
# Obstoječa pesem
_projector_app.cursor.execute("UPDATE songs SET title=?, lyrics=? WHERE id=?", (title, lyrics, song_id))
_projector_app.conn.commit()
# Pošlji ntfy obvestilo
if hasattr(_projector_app, 'send_ntfy_notification'):
_projector_app.send_ntfy_notification(song_id, title, lyrics)
# Osvežimo trenutno pesem, če je to ta, ki smo jo pravkar uredili
if str(_projector_app.song_number_last) == str(song_id):
_projector_app.song_number = str(song_id)