Implementacija obveščanja preko ntfy.sh #12
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user