Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

fix: enable Save Names in Identify Speakers modal when only per-segment speaker/text edits are staged (#373)

Murtaza Nasiredfc862a6355
diff --git a/static/js/app.modular.js b/static/js/app.modular.js
index 7157a696..05ff6402 100644
--- a/static/js/app.modular.js
+++ b/static/js/app.modular.js
@@ -3414,6 +3414,13 @@ document.addEventListener('DOMContentLoaded', async () => {
);
});
+ // Save is also valid with no names when per-segment edits are
+ // staged (speaker reassignments / text edits set
+ // editedTranscriptData and are persisted by the same button).
+ const canSaveSpeakerEdits = computed(() => {
+ return hasSpeakerNames.value || editedTranscriptData.value !== null;
+ });
+
// Tags with custom prompts for reprocess modal
const tagsWithCustomPrompts = computed(() => {
return availableTags.value.filter(tag => tag.custom_prompt && tag.custom_prompt.trim() !== '');
@@ -4236,6 +4243,7 @@ document.addEventListener('DOMContentLoaded', async () => {
removeProgressItem,
retryProgressItem,
hasSpeakerNames,
+ canSaveSpeakerEdits,
showDuplicatesModal,
videoCollapsed,
videoFullscreen,
diff --git a/templates/modals/speaker-modal.html b/templates/modals/speaker-modal.html
index 414c2846..07d33347 100644
--- a/templates/modals/speaker-modal.html
+++ b/templates/modals/speaker-modal.html
@@ -414,7 +414,7 @@
<div class="flex gap-2">
<button @click="closeSpeakerModal" class="btn btn--ghost" v-text="t('common.cancel')"></button>
<button @click="saveSpeakerNames"
- :disabled="!hasSpeakerNames"
+ :disabled="!canSaveSpeakerEdits"
class="btn btn--primary"
v-text="t('buttons.saveNames')"></button>
</div>