Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Two backwards-compat fixes for the Display tab — (1) Display form's hidden inputs for show_timestamps_simple_view and editor_autosave are now only emitted when those prefs are currently TRUE; the backend uses key presence in request.form to decide checkbox state, so always-emitting the inputs with value='' would silently flip both flags to True on every Display-form save, wiping the user's actual settings; (2) the preferences-form save handler now only updates audio_player_position when the field is actually present in the submission — the original Preferences tab doesn't expose the radio and would have submitted without it, defaulting the column back to 'bottom' on every Preferences save and clobbering any 'top' choice the user made on the Display tab
Murtaza Nasir642a5f5f7b15
diff --git a/src/api/auth.py b/src/api/auth.pyindex 95e9d6b0..fa41425e 100644--- a/src/api/auth.py+++ b/src/api/auth.py@@ -575,10 +575,15 @@ def account():elif 'preferences_form' in request.form:current_user.show_timestamps_simple_view = 'show_timestamps_simple_view' in request.formcurrent_user.editor_autosave = 'editor_autosave' in request.form- # Audio player position — only 'top' or 'bottom' are valid;- # anything else falls back to the default 'bottom'.- pos = request.form.get('audio_player_position', 'bottom')- current_user.audio_player_position = pos if pos in ('bottom', 'top') else 'bottom'+ # Audio player position — only update if the field is+ # actually present in the submission. The Preferences tab+ # (which doesn't expose the radio) submits without this+ # key and must not clobber the value the user set from the+ # Display tab. Only 'top' / 'bottom' are accepted; anything+ # else falls back to the default 'bottom'.+ if 'audio_player_position' in request.form:+ pos = request.form.get('audio_player_position', 'bottom')+ current_user.audio_player_position = pos if pos in ('bottom', 'top') else 'bottom'ui_lang = request.form.get('ui_language')transcription_lang = request.form.get('transcription_language')diff --git a/templates/account.html b/templates/account.htmlindex d9088158..fd3a5a8f 100644--- a/templates/account.html+++ b/templates/account.html@@ -924,10 +924,23 @@<form id="displayForm" method="POST" action="{{ url_for('auth.account') }}" class="space-y-6 max-w-2xl"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/><input type="hidden" name="preferences_form" value="1"/>- <!-- Preserve other preference fields so saving this- form doesn't reset them to blank/default. -->- <input type="hidden" name="show_timestamps_simple_view" value="{% if current_user.show_timestamps_simple_view %}on{% endif %}">- <input type="hidden" name="editor_autosave" value="{% if current_user.editor_autosave %}on{% endif %}">+ <!-- Preserve other preference fields so saving the+ Display form doesn't reset them. IMPORTANT:+ the backend uses key presence (`name in+ request.form`) to decide checkbox state, so+ these hidden inputs must only be emitted+ when the corresponding pref is currently+ TRUE — emitting an always-present input+ with value="" would silently flip the+ checkbox on every save. Language fields+ always carry a value so they're always+ emitted. -->+ {% if current_user.show_timestamps_simple_view %}+ <input type="hidden" name="show_timestamps_simple_view" value="on">+ {% endif %}+ {% if current_user.editor_autosave %}+ <input type="hidden" name="editor_autosave" value="on">+ {% endif %}<input type="hidden" name="ui_language" value="{{ current_user.ui_language or 'en' }}"><input type="hidden" name="transcription_language" value="{{ current_user.transcription_language or '' }}"><input type="hidden" name="output_language" value="{{ current_user.output_language or '' }}">