Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Add custom vocabulary (hotwords) and initial prompt for transcription accuracy, fix duplicate detection hashing before conversion, redesign tag/folder modals with tabs, and fix markdown list formatting across docs
Murtaza Nasir41230799af28
diff --git a/docs/admin-guide/email-setup.md b/docs/admin-guide/email-setup.mdindex 975b4a37..84871b21 100644--- a/docs/admin-guide/email-setup.md+++ b/docs/admin-guide/email-setup.md@@ -216,6 +216,7 @@ When enabling email verification on an existing instance:### "SMTP not configured" errorsEnsure all required SMTP variables are set:+- `SMTP_HOST`- `SMTP_USERNAME`- `SMTP_PASSWORD`diff --git a/docs/admin-guide/group-management.md b/docs/admin-guide/group-management.mdindex 635f975a..65afe227 100644--- a/docs/admin-guide/group-management.md+++ b/docs/admin-guide/group-management.md@@ -238,6 +238,7 @@ DELETION_MODE=audio_only|full_recordingGroups use several database tables that work together:**Group Table**:+- `id`: Primary key- `name`: Group name (max 100 chars)- `description`: Optional group description@@ -245,6 +246,7 @@ Groups use several database tables that work together:- `created_at`: Creation timestamp**TeamMembership Table**:+- `id`: Primary key- `team_id`: References Group- `user_id`: References User@@ -252,6 +254,7 @@ Groups use several database tables that work together:- `joined_at`: Membership timestamp**Tag Table** (Extended):+- `team_id`: References Group (null for personal tags)- `retention_days`: Custom retention override (null uses global)- `protect_from_deletion`: Boolean protection flag@@ -267,6 +270,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: Internal sharing not enabled or not configured correctly.**Solution**:+1. Check `.env` contains `ENABLE_INTERNAL_SHARING=true`2. Restart Speakr after `.env` changes3. Clear browser cache and reload@@ -277,6 +281,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: User not added to group, or internal sharing disabled.**Solution**:+1. Verify user is listed in group membership2. Confirm `ENABLE_INTERNAL_SHARING=true` in `.env`3. Check user is logged in (group tags hidden for anonymous users)@@ -287,6 +292,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: Group tag misconfigured or internal sharing disabled.**Solution**:+1. Edit the group tag and verify "Share with all group members" or "Share with group leads" is enabled2. Confirm `ENABLE_INTERNAL_SHARING=true` in `.env`3. Check application logs when applying tags for sharing errors@@ -297,6 +303,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: User doesn't have admin role in any group, or routing issue.**Solution**:+1. Verify user role is "admin" not "member" in group membership2. Have user log out and back in to refresh session3. Check "Group Management" link appears in user menu (not "Admin")@@ -307,6 +314,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: Protected tags, misconfigured retention, or auto-deletion disabled.**Solution**:+1. Check if recording has protected group tags2. Verify `ENABLE_AUTO_DELETION=true` in `.env`3. Confirm `GLOBAL_RETENTION_DAYS` is set if no tag retention applies@@ -318,6 +326,7 @@ Cascade deletion is configured so deleting a group deletes its tags and membersh**Cause**: All applicable shares already exist, or no recordings have group tags.**Solution**:+1. Verify recordings actually have tags from this group2. Check if group members already have access via other shares3. Review whether recordings are owned by current group members (no self-sharing)diff --git a/docs/admin-guide/migration-guide.md b/docs/admin-guide/migration-guide.mdindex 087590ec..6e9ec130 100644--- a/docs/admin-guide/migration-guide.md+++ b/docs/admin-guide/migration-guide.md@@ -176,6 +176,7 @@ Ensure you have the correct environment variables set. Check the auto-detection### Features Missing After MigrationIf UI features like speaker identification are missing:+- Verify the transcription actually contains diarization data- Check that your connector supports the feature (e.g., voice profiles require ASR endpoint)diff --git a/docs/admin-guide/model-configuration.md b/docs/admin-guide/model-configuration.mdindex c4326874..1193bf13 100644--- a/docs/admin-guide/model-configuration.md+++ b/docs/admin-guide/model-configuration.md@@ -54,6 +54,7 @@ Speakr fully supports OpenAI's GPT-5 model family, automatically detecting and aGPT-5 models use different parameters than previous models:**Unsupported Parameters** (will cause errors if used):+- `temperature` - Replaced by `reasoning_effort` and `verbosity`- `top_p` - Not supported- `logprobs` - Not supported@@ -140,11 +141,13 @@ If you use GPT-5 models through OpenRouter or other proxy services, the automati### Use Cases**Summarization**:+- Fast summaries: `gpt-5-nano` with `minimal` effort and `low` verbosity- Standard summaries: `gpt-5-mini` with `medium` effort and `medium` verbosity- Detailed summaries: `gpt-5` with `medium` effort and `high` verbosity**Chat**:+- Quick Q&A: `gpt-5-mini` with `minimal` effort and `low` verbosity- Standard conversation: `gpt-5-mini` with `low` effort and `medium` verbosity- Complex analysis: `gpt-5` with `high` effort and `medium` verbosity@@ -203,6 +206,7 @@ Valid values are: `low`, `medium`, `high`- **Token usage**: Higher verbosity = more output tokensFor most use cases, we recommend:+- **Model**: `gpt-5-mini`- **Reasoning**: `medium`- **Verbosity**: `medium`@@ -295,11 +299,13 @@ CHAT_MODEL_NAME=gpt-4o### When to Use Separate Chat Models**Recommended for**:+- High-volume deployments where chat responsiveness is critical- Users who need different service tiers for different operations- Cost optimization when chat usage is significantly higher than summarization**Not needed for**:+- Small deployments with low usage- When using the same model for all operations is acceptable- Simple setups where configuration simplicity is preferred@@ -384,6 +390,7 @@ docker compose logs -f app | grep "LLM"```Common issues:+- Invalid API key- Model name not available on your plan- Rate limits exceeded@@ -392,6 +399,7 @@ Common issues:### Poor Summary QualityTry these adjustments:+- Upgrade to a more capable model- Increase `SUMMARY_MAX_TOKENS`- Review and refine [custom prompts](prompts.md)@@ -400,6 +408,7 @@ Try these adjustments:### High CostsReduce costs with:+- Switch to smaller models (`gpt-5-nano`, `gpt-4o-mini`)- Lower token limits- For GPT-5: reduce reasoning effort to `minimal` or `low`diff --git a/docs/admin-guide/retention.md b/docs/admin-guide/retention.mdindex 115764a5..62c3c05a 100644--- a/docs/admin-guide/retention.md+++ b/docs/admin-guide/retention.md@@ -12,6 +12,7 @@ This document describes the automated retention and deletion system for Speakr r## OverviewThe auto-deletion system provides automated lifecycle management for your recordings, helping you:+- **Comply with data retention policies** - Automatically remove recordings after a specified retention period- **Manage storage** - Prevent unlimited growth of audio files- **Maintain critical data** - Keep transcriptions and metadata even after audio deletion@@ -75,6 +76,7 @@ When a recording has multiple tags with different retention periods, the **shortIndividual tags can protect recordings from auto-deletion entirely.**Example Hierarchy:**+- Global retention: 90 days- Tag "Sprint Reviews": 180 days (longer than global)- Tag "Daily Standups": 14 days (shorter than global)@@ -88,6 +90,7 @@ Individual tags can protect recordings from auto-deletion entirely.4. Apply this tag to recordings you want to protect**When protected:**+- ✅ Recordings with protected tags are exempt from auto-deletion- ✅ Works regardless of age or retention period- ✅ Applies to all recordings with that tag@@ -326,12 +329,14 @@ This approach lets you keep years of searchable conversation history without acc### For GroupsWhen groups are enabled:+1. **Set conservative global retention** (shorter period as a baseline)2. **Configure group tags with custom retention** to match each group's needs3. **Use protected group tags** for group content requiring permanent retention4. **Document retention policies** so group members understand lifecycle expectationsExample group tag retention configuration:+- Engineering group "Architecture Decisions": Protected (never deleted)- Sales group "Customer Calls": 365 days- HR group "Interviews": 90 days@@ -411,6 +416,7 @@ Get statistics about eligible recordings and current configuration.### Auto-Deletion Not Running**Check:**+1. `ENABLE_AUTO_DELETION=true` in `.env`2. `GLOBAL_RETENTION_DAYS > 0`3. Admin status for manual triggers@@ -419,6 +425,7 @@ Get statistics about eligible recordings and current configuration.### Too Many Recordings Being Deleted**Solutions:**+1. Increase `GLOBAL_RETENTION_DAYS`2. Add protected tags to important categories3. Check tag assignments on recordings@@ -427,6 +434,7 @@ Get statistics about eligible recordings and current configuration.### Archived Recordings Not Showing**Check:**+1. Toggle "Archived Recordings" filter in sidebar2. Verify `DELETION_MODE=audio_only` (full_recording doesn't archive)3. Check `audio_deleted_at` field in database@@ -441,6 +449,7 @@ Get statistics about eligible recordings and current configuration.## SupportFor issues or questions about auto-deletion:+1. Check server logs for detailed error messages2. Verify environment variable configuration3. Test with `/admin/auto-deletion/stats` endpointdiff --git a/docs/admin-guide/sso-setup.md b/docs/admin-guide/sso-setup.mdindex 665e0cb6..5d006638 100644--- a/docs/admin-guide/sso-setup.md+++ b/docs/admin-guide/sso-setup.md@@ -50,6 +50,7 @@ Restart Speakr after updating environment variables.2. Copy the **Client ID** and **Client Secret**.3. Note the **OpenID Endpoint Configuration** (discovery) URL, typically:`https://<host>/realms/<realm>/.well-known/openid-configuration`+4. Set the environment variables accordingly and restart Speakr.## Azure AD / Entra ID quick start@@ -60,6 +61,7 @@ Restart Speakr after updating environment variables.4. Create a client secret.5. Discovery URL format:`https://login.microsoftonline.com/<tenant-id>/v2.0/.well-known/openid-configuration`+6. Set variables and restart.## Google quick start@@ -68,6 +70,7 @@ Restart Speakr after updating environment variables.2. Add authorized redirect URI: `https://your-host/auth/sso/callback`.3. Use discovery URL:`https://accounts.google.com/.well-known/openid-configuration`+4. Set variables and restart.## Auth0 quick start@@ -76,6 +79,7 @@ Restart Speakr after updating environment variables.2. Allowed Callback URLs: `https://your-host/auth/sso/callback`.3. Discovery URL:`https://<your-tenant>.auth0.com/.well-known/openid-configuration`+4. Set variables and restart.## Auto-registration behaviordiff --git a/docs/admin-guide/statistics.md b/docs/admin-guide/statistics.mdindex c368b1a2..20f8cf08 100644--- a/docs/admin-guide/statistics.md+++ b/docs/admin-guide/statistics.md@@ -55,6 +55,7 @@ Use token statistics to identify heavy users, validate budget allocations, and fThe Transcription Usage section provides visibility into speech-to-text API consumption across your instance. This is separate from token usage and tracks audio transcription specifically.**Summary Cards**: Four cards at the top show:+- **Today's Minutes**: Transcription minutes used today across all users- **This Month**: Total minutes transcribed in the current calendar month- **Monthly Cost**: Estimated costs based on connector pricing (OpenAI Whisper/Transcribe charges, $0 for self-hosted ASR)@@ -67,6 +68,7 @@ The Transcription Usage section provides visibility into speech-to-text API cons- Red: At or over 100% (blocked from new transcriptions)**Cost Estimation**: The system calculates estimated costs based on the transcription connector used:+- OpenAI Whisper API: $0.006 per minute- OpenAI Transcribe (gpt-4o-transcribe): $0.006 per minute- OpenAI Transcribe (gpt-4o-mini-transcribe): $0.003 per minutediff --git a/docs/admin-guide/user-management.md b/docs/admin-guide/user-management.mdindex 1d8f9460..59e1e431 100644--- a/docs/admin-guide/user-management.md+++ b/docs/admin-guide/user-management.md@@ -55,6 +55,7 @@ Control transcription costs by setting monthly transcription budgets for individTranscription budgets are set in minutes with a minimum of 10 minutes. The budget covers all transcription operations regardless of which connector is used (OpenAI Whisper, OpenAI Transcribe, or self-hosted ASR). View detailed transcription usage statistics in the [System Statistics](statistics.md#transcription-usage-statistics) section.**Cost Tracking**: The system tracks estimated costs based on the transcription connector used:+- **OpenAI Whisper**: $0.006 per minute- **OpenAI Transcribe**: $0.003-$0.006 per minute depending on model- **Self-hosted ASR**: $0 (no external API costs)diff --git a/docs/admin-guide/whisperx-setup.md b/docs/admin-guide/whisperx-setup.mdindex 3678ff25..4d7e0b09 100644--- a/docs/admin-guide/whisperx-setup.md+++ b/docs/admin-guide/whisperx-setup.md@@ -237,6 +237,18 @@ Models are selected per-recording in Speakr. Available options:**Recommendation:** Use `large-v3` for best quality, `small` for speed.+## Custom Vocabulary & Transcription Hints++WhisperX supports both **hotwords** and **initial_prompt** parameters to improve transcription accuracy for domain-specific content.++- **Hotwords** - Comma-separated terms the model should prioritize (brand names, acronyms, jargon). Passed as the `hotwords` query parameter to the ASR endpoint.+- **Initial Prompt** - Context text that guides the model's word choices. Passed as the `initial_prompt` query parameter.++Set these at any level in Speakr: per-user defaults, per-tag, per-folder, or per-upload in the Advanced ASR Options. See the [Custom Vocabulary feature docs](../features.md#custom-vocabulary--transcription-hints) for details on the precedence hierarchy.++!!! note "ASR Service Compatibility"+ The WhisperX ASR service (`learnedmachine/whisperx-asr-service`) fully supports both `hotwords` and `initial_prompt` parameters. The community `whisper-asr-webservice` by ahmetoner supports `initial_prompt` but does not currently expose a `hotwords` parameter through its API.+## Speaker DiarizationWhisperX provides superior speaker diarization compared to standard implementations.@@ -250,6 +262,7 @@ When uploading or processing recordings:- Leave blank for automatic detection**Tips:**+- Set `min_speakers=2` and `max_speakers=6` for typical meetings- For interviews: `min_speakers=2`, `max_speakers=2`- For panels: `min_speakers=3`, `max_speakers=8`diff --git a/docs/advanced/custom-connectors.md b/docs/advanced/custom-connectors.mdindex 9cd6a6a8..fa5153fd 100644--- a/docs/advanced/custom-connectors.md+++ b/docs/advanced/custom-connectors.md@@ -81,7 +81,8 @@ class TranscriptionRequest:max_speakers: Optional[int] = None# Advanced options- prompt: Optional[str] = None+ prompt: Optional[str] = None # Initial prompt for context/guidance+ hotwords: Optional[str] = None # Comma-separated words to bias recognitiontemperature: Optional[float] = Noneextra_options: Dict[str, Any] = field(default_factory=dict)@@ -538,6 +539,7 @@ If you create a connector for a popular provider, consider contributing it back4. Submit a pull requestPopular providers we'd love to see connectors for:+- Deepgram- AssemblyAI- Google Cloud Speech-to-Textdiff --git a/docs/advanced/job-queue-system.md b/docs/advanced/job-queue-system.mdindex 8c8a6a94..440f9ac9 100644--- a/docs/advanced/job-queue-system.md+++ b/docs/advanced/job-queue-system.md@@ -66,6 +66,7 @@ class ProcessingJob(db.Model):```**Key Fields:**+- `is_new_upload`: When `True` and job fails permanently, the associated recording and audio file are deleted. When `False` (reprocessing), only the recording status is set to FAILED.- `status`: Job lifecycle state- `retry_count`: Jobs retry up to 3 times before permanent failure@@ -187,6 +188,7 @@ Returns all jobs for the current user (active + completed/failed from last hour)```**Queue Types:**+- `transcription`: transcribe, reprocess_transcription- `summary`: summarize, reprocess_summarydiff --git a/docs/faq.md b/docs/faq.mdindex 406fb42c..36cb89ec 100644--- a/docs/faq.md+++ b/docs/faq.md@@ -41,6 +41,7 @@ The optional ASR webservice (`onerahmet/openai-whisper-asr-webservice`) that pro**GPU limitation**: GPU passthrough doesn't work on macOS because Docker runs containers within a Linux VM. This is a fundamental Docker limitation on Mac.**Solution**: Use the standard CPU image instead of the GPU version:+- Use `onerahmet/openai-whisper-asr-webservice:latest` (NOT `:latest-gpu`)- The `:latest` tag provides both amd64 (Intel) and arm64 (Apple Silicon) architectures- Processing will be slower without GPU acceleration but fully functional@@ -196,9 +197,27 @@ Legal requirements vary by jurisdiction. Many regions require explicit consent fRecord in quiet environments when possible. Use a good microphone positioned close to speakers. For meetings, place the recording device centrally where all participants are clearly audible. Avoid background music or TV noise. Higher quality audio not only improves transcription accuracy but also reduces processing time and API costs.+### Certain specialized words don't get transcribed properly. How do I fix this?++This is common with brand names, acronyms, technical jargon, or proper nouns that the transcription model hasn't seen frequently during training. Speakr provides two features to address this:++**Hotwords** let you provide a comma-separated list of terms the transcription engine should prioritize. For example, if "PyAnnote" keeps being transcribed as "piano" or "pie annotate", adding it to your hotwords list biases the model toward the correct spelling.++**Initial Prompt** gives the transcription engine broader context about your recording's content, helping it make better word choices when audio is ambiguous.++You can set these at multiple levels, from most to least priority:++1. **Per-upload** - In the Advanced ASR Options when uploading+2. **Per-tag** - In tag settings (applied automatically when that tag is selected)+3. **Per-folder** - In folder settings (applied to all recordings in that folder)+4. **Per-user** - In [Account Settings → Prompt Options](user-guide/settings.md#transcription-hints) (your personal defaults)++!!! note "ASR Service Compatibility"+ Hotwords and initial prompt are fully supported by [WhisperX ASR](admin-guide/whisperx-setup.md). For OpenAI connectors (Whisper, Transcribe), hotwords are combined into the prompt field since the OpenAI API doesn't have a dedicated hotwords parameter. The community `whisper-asr-webservice` by ahmetoner supports `initial_prompt` but does not currently expose a `hotwords` parameter through its API.+### How can I maximize transcription accuracy?-Speak clearly and avoid talking over others. Minimize background noise and echo. For technical content, consider adding a custom vocabulary or glossary to your [prompts](admin-guide/prompts.md). Users can set [personal prompts](user-guide/settings.md#custom-prompts-tab) for their recordings. Use the appropriate [language setting](user-guide/settings.md#language-preferences) rather than relying on auto-detection. Review [language support](features.md#language-support) for best results. For multi-speaker recordings, use the [ASR endpoint](getting-started.md#option-b-custom-asr-endpoint-configuration) with appropriate speaker count settings. [Identify speakers](user-guide/transcripts.md#speaker-identification) after transcription for best results.+Speak clearly and avoid talking over others. Minimize background noise and echo. For technical content, use [hotwords and initial prompts](#certain-specialized-words-dont-get-transcribed-properly-how-do-i-fix-this) to help the transcription engine with domain-specific vocabulary. You can set these through [tags](user-guide/settings.md#transcription-hints-hotwords--initial-prompt), [folders](user-guide/folders.md), or your [personal defaults](user-guide/settings.md#transcription-hints). Users can also set [custom summary prompts](user-guide/settings.md#custom-prompts-tab) for their recordings. Use the appropriate [language setting](user-guide/settings.md#language-preferences) rather than relying on auto-detection. Review [language support](features.md#language-support) for best results. For multi-speaker recordings, use the [ASR endpoint](getting-started.md#option-b-custom-asr-endpoint-configuration) with appropriate speaker count settings. [Identify speakers](user-guide/transcripts.md#speaker-identification) after transcription for best results.For Chinese transcription specifically, use the large-v3 model as smaller models may not output Chinese characters correctly. For other languages, test different models to find the best accuracy for your specific language and accent.@@ -211,9 +230,11 @@ Chunking by file size (e.g., CHUNK_LIMIT=20MB) works well for consistent bitrateYes, by default. Speakr automatically compresses lossless uploads (WAV, AIFF) to save storage space. A typical 500MB WAV file becomes roughly 50MB after compression - a 90% reduction. This happens transparently when you upload.**What gets compressed:**+- WAV and AIFF files (uncompressed/lossless formats)**What stays unchanged:**+- Already-compressed formats: MP3, AAC, OGG, M4A, FLAC, etc.- These are never re-encoded to avoid quality lossdiff --git a/docs/features.md b/docs/features.mdindex a44469f3..73ea16e9 100644--- a/docs/features.md+++ b/docs/features.md@@ -195,6 +195,15 @@ Set up a watched directory where dropped audio files are automatically processedAutomatically export completed transcriptions and summaries to markdown files after processing. Configure the export directory to point to your Obsidian vault, Logseq directory, or any other note-taking system for seamless integration. Choose what to export (transcription, summary, or both) and let Speakr maintain synchronized copies of your recordings in your preferred format. Custom export templates allow you to format the output to match your note-taking workflow. Exports are organized in per-user subdirectories for multi-user instances.+### Custom Vocabulary & Transcription Hints++Improve transcription accuracy for domain-specific content with two complementary features:++- **Hotwords** - Provide comma-separated terms (brand names, acronyms, technical jargon) that the transcription engine should prioritize. This biases the model toward correctly recognizing words it might otherwise misspell.+- **Initial Prompt** - Give the transcription engine context about the recording content, helping it make better overall word choices when audio is ambiguous.++Set these at any level - [per-user defaults](user-guide/settings.md#transcription-hints), [per-tag](user-guide/settings.md#transcription-hints-hotwords--initial-prompt), [per-folder](user-guide/folders.md), or per-upload in the Advanced ASR Options. Values cascade with upload form taking highest priority, then tags, folders, and finally user defaults. See the [FAQ](faq.md#certain-specialized-words-dont-get-transcribed-properly-how-do-i-fix-this) for practical usage tips.+### Custom ASR ConfigurationFine-tune transcription for specific scenarios with custom ASR settings. See [ASR configuration](troubleshooting.md#asr-endpoint-returns-405-or-404-errors) for common setup issues. Set expected speaker counts for different meeting types. Configure specialized models for technical vocabulary or specific accents. Apply these settings automatically through the tagging system.diff --git a/docs/getting-started.md b/docs/getting-started.mdindex 2a63b9b1..a8a277b0 100644--- a/docs/getting-started.md+++ b/docs/getting-started.md@@ -165,12 +165,14 @@ When any group member applies this tag to a recording, all group members automatThere are two ways to share recordings with groups:**Method 1: Using Group Tags** (Automatic)+1. When uploading or after creating a recording, click the tag icon2. Select any group tag you have access to3. All group members automatically receive access to this recording4. Future group members will NOT see historical recordings, only new ones tagged after they join**Method 2: Individual Sharing** (Manual)+1. Open any recording and click the share icon (users icon) in the toolbar2. Search for and select users to share with3. Choose permission level: view-only, edit, or resharediff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.mdindex 1c37ac8c..8821ce84 100644--- a/docs/getting-started/installation.md+++ b/docs/getting-started/installation.md@@ -93,6 +93,7 @@ TRANSCRIPTION_MODEL=gpt-4o-transcribe-diarize```The connector automatically detects that you want the OpenAI Transcribe connector based on the model name. Other available models:+- `gpt-4o-transcribe` - High quality without diarization- `gpt-4o-mini-transcribe` - Cost-effective option- `whisper-1` - Legacy model (uses Whisper connector)@@ -179,6 +180,7 @@ ASR_BASE_URL=http://whisper-asr:9000> **Note:** The `USE_ASR_ENDPOINT=true` setting is deprecated. Just setting `ASR_BASE_URL` automatically enables ASR mode.The ASR_BASE_URL depends on your deployment architecture:+- **Same Docker Compose stack:** Use the service name (e.g., `http://whisperx-asr:9000` or `http://whisper-asr:9000`) - Docker's internal networking- **Separate machine:** Use the full URL with IP address or domain name (e.g., `http://192.168.1.100:9000`)@@ -399,12 +401,14 @@ If you need speaker diarization to identify different speakers in your recording#### Option 1: WhisperX ASR Service (Recommended - Supports Voice Profiles)**Use this if you want:**+- AI-powered speaker voice profiles with automatic recognition- 256-dimensional speaker embeddings- Better speaker-to-word timestamp alignment- Exclusive diarization for cleaner speaker transitions**Prerequisites:**+1. **Hugging Face Account & Model Access** - Visit and accept terms for ALL models:- [pyannote/speaker-diarization-community-1](https://huggingface.co/pyannote/speaker-diarization-community-1)- [pyannote/speaker-diarization-3.1](https://huggingface.co/pyannote/speaker-diarization-3.1)@@ -442,11 +446,13 @@ See the [WhisperX ASR Service README](https://github.com/murtaza-nasir/whisperx-#### Option 2: OpenAI Whisper ASR Webservice (Basic Diarization Only)**Use this if you:**+- Only need basic speaker identification (Speaker 1, Speaker 2, etc.)- Don't need voice profiles or speaker embeddings- Want simpler setup with lower resource requirements**Prerequisites:**+1. **Hugging Face Account & Model Access** - Visit and accept terms:- [pyannote/speaker-diarization-3.1](https://huggingface.co/pyannote/speaker-diarization-3.1)- [pyannote/segmentation-3.0](https://huggingface.co/pyannote/segmentation-3.0)diff --git a/docs/testing/connector-testing-checklist.md b/docs/testing/connector-testing-checklist.mdindex 6a956868..406959ad 100644--- a/docs/testing/connector-testing-checklist.md+++ b/docs/testing/connector-testing-checklist.md@@ -25,6 +25,7 @@ TRANSCRIPTION_MODEL=gpt-4o-transcribe-diarize```**Expected:**+- [ ] Logs show "Auto-detected OpenAI Transcribe"- [ ] `/api/system/info` shows `connector: "openai_transcribe"`- [ ] Transcription works with speaker labels (A, B, C...)@@ -36,6 +37,7 @@ ASR_BASE_URL=http://whisperx-asr:9000```**Expected:**+- [ ] Logs show "Auto-detected ASR endpoint"- [ ] `/api/system/info` shows `connector: "asr_endpoint"`- [ ] No deprecation warning (USE_ASR_ENDPOINT not set)@@ -48,6 +50,7 @@ ASR_BASE_URL=http://whisperx-asr:9000```**Expected:**+- [ ] Logs show deprecation warning for USE_ASR_ENDPOINT- [ ] Connector still works correctly- [ ] `/api/system/info` shows `connector: "asr_endpoint"`@@ -61,6 +64,7 @@ ASR_BASE_URL=http://whisperx-asr:9000 # Should be ignored```**Expected:**+- [ ] Uses openai_whisper despite ASR_BASE_URL being set- [ ] `/api/system/info` shows `connector: "openai_whisper"`@@ -72,10 +76,12 @@ ASR_BASE_URL=http://whisperx-asr:9000 # Should be ignored**Config:** Use `TRANSCRIPTION_MODEL=gpt-4o-transcribe-diarize`**Steps:**+1. Upload audio with 2+ speakers2. Wait for transcription to complete**Expected:**+- [ ] Transcription shows speaker labels (A, B, C...)- [ ] Speaker identification button appears in UI- [ ] Bubble view toggle available@@ -85,10 +91,12 @@ ASR_BASE_URL=http://whisperx-asr:9000 # Should be ignored**Config:** Use ASR endpoint with `ASR_DIARIZE=true`**Steps:**+1. Upload audio with 2+ speakers2. Wait for transcription to complete**Expected:**+- [ ] Transcription shows speaker labels (SPEAKER_00, SPEAKER_01...)- [ ] Speaker identification button appears in UI- [ ] Min/max speakers options visible in upload form@@ -98,10 +106,12 @@ ASR_BASE_URL=http://whisperx-asr:9000 # Should be ignored**Config:** Use `TRANSCRIPTION_MODEL=whisper-1`**Steps:**+1. Upload audio with 2+ speakers2. Wait for transcription to complete**Expected:**+- [ ] Transcription is plain text (no speaker labels)- [ ] Speaker identification button NOT visible- [ ] Bubble view toggle NOT available@@ -112,11 +122,13 @@ ASR_BASE_URL=http://whisperx-asr:9000 # Should be ignored### Test 3.1: Speaker Count Controls (ASR Only)**ASR Config:**+- [ ] Min speakers field visible in upload form- [ ] Max speakers field visible in upload form- [ ] Min/max speakers visible in reprocess modal**OpenAI Config:**+- [ ] Min speakers field NOT visible- [ ] Max speakers field NOT visible@@ -140,9 +152,11 @@ CHUNK_LIMIT=10MB```**Steps:**+1. Upload file >10MB**Expected:**+- [ ] File uploads without app-level chunking- [ ] Logs show "Connector handles chunking internally"- [ ] No chunk progress in UI@@ -156,9 +170,11 @@ CHUNK_LIMIT=10MB```**Steps:**+1. Upload file >10MB**Expected:**+- [ ] File is chunked by the app- [ ] Logs show chunk processing- [ ] Transcription merges correctly@@ -171,9 +187,11 @@ ENABLE_CHUNKING=false```**Steps:**+1. Upload file >25MB**Expected:**+- [ ] Upload fails with file size error (OpenAI 25MB limit)- [ ] Error message is clear@@ -185,10 +203,12 @@ ENABLE_CHUNKING=false**Config:** Any OpenAI connector**Steps:**+1. Upload an opus format audio file2. Check logs**Expected:**+- [ ] File is converted before transcription- [ ] Logs show codec conversion- [ ] Transcription succeeds@@ -200,18 +220,22 @@ AUDIO_UNSUPPORTED_CODECS=aac```**Steps:**+1. Upload an AAC format audio file2. Check logs**Expected:**+- [ ] File is converted before transcription- [ ] Logs show "Excluding codecs from supported list"### Test 5.3: Supported Format (No Conversion)**Steps:**+1. Upload an MP3 file**Expected:**+- [ ] No conversion occurs- [ ] Transcription proceeds directly@@ -226,6 +250,7 @@ TRANSCRIPTION_API_KEY=invalid-key```**Expected:**+- [ ] Clear error message about authentication- [ ] Job fails gracefully- [ ] UI shows error state@@ -237,6 +262,7 @@ ASR_BASE_URL=http://nonexistent:9000```**Expected:**+- [ ] Connection error logged- [ ] Job fails with timeout/connection error- [ ] UI shows error state@@ -248,6 +274,7 @@ TRANSCRIPTION_CONNECTOR=nonexistent```**Expected:**+- [ ] App fails to start (or logs critical error)- [ ] Error message lists available connectors@@ -263,11 +290,13 @@ ASR_RETURN_SPEAKER_EMBEDDINGS=true```**Steps:**+1. Upload audio with known speaker2. Create voice profile from transcription3. Upload another audio with same speaker**Expected:**+- [ ] Speaker embeddings returned in response- [ ] Voice profile creation works- [ ] Automatic speaker matching works@@ -279,6 +308,7 @@ ASR_RETURN_SPEAKER_EMBEDDINGS=false```**Expected:**+- [ ] Voice profile features not available- [ ] No embeddings in response@@ -312,45 +342,107 @@ ASR_RETURN_SPEAKER_EMBEDDINGS=false### Test 9.1: Reprocess with Different Language**Steps:**+1. Transcribe file (auto-detect language)2. Reprocess with specific language**Expected:**+- [ ] Reprocess uses selected language- [ ] Transcription updates correctly### Test 9.2: Reprocess with Speaker Count (ASR)**Steps:**+1. Transcribe file with auto speaker detection2. Reprocess with min_speakers=2, max_speakers=3**Expected:**+- [ ] Min/max speakers respected- [ ] Diarization quality may improve----## 10. Performance & Edge Cases+## 10. Hotwords & Initial Prompt-### Test 10.1: Very Long Audio+### Test 10.1: ASR Endpoint with Hotwords+**Config:** ASR endpoint connector++**Steps:**++1. Upload audio containing domain-specific terms+2. Set hotwords in Advanced ASR Options (e.g., "Speakr, CTranslate2, PyAnnote")++**Expected:**++- [ ] Hotwords passed as `hotwords` query parameter to ASR+- [ ] Transcription accuracy improves for specified terms+- [ ] Server logs show hotwords in request++### Test 10.2: ASR Endpoint with Initial Prompt+**Config:** ASR endpoint connector++**Steps:**++1. Upload audio file+2. Set initial prompt in Advanced ASR Options++**Expected:**++- [ ] Initial prompt passed as `initial_prompt` query parameter to ASR+- [ ] Server logs show initial_prompt in request++### Test 10.3: OpenAI Connector with Hotwords + Prompt+**Config:** OpenAI Whisper or OpenAI Transcribe connector++**Steps:**++1. Upload audio with both hotwords and initial prompt set++**Expected:**++- [ ] Hotwords and initial prompt combined into single `prompt` parameter+- [ ] Combined with `. ` separator++### Test 10.4: Precedence Hierarchy+**Steps:**++1. Set user-level hotwords in Account Settings+2. Create a tag with different hotwords+3. Upload with tag applied but no form-level hotwords++**Expected:**++- [ ] Tag hotwords used (overrides user defaults)+- [ ] Upload form values override tag when explicitly set++---++## 11. Performance & Edge Cases++### Test 11.1: Very Long AudioUpload audio >1 hour**Expected:**+- [ ] Processing completes (may take time)- [ ] No timeout errors- [ ] Transcription is complete-### Test 10.2: Empty/Silent Audio+### Test 11.2: Empty/Silent AudioUpload silent audio file**Expected:**+- [ ] Transcription returns empty or minimal text- [ ] No errors-### Test 10.3: Corrupt Audio File+### Test 11.3: Corrupt Audio FileUpload corrupt/invalid audio file**Expected:**+- [ ] Clear error message- [ ] Job fails gracefullydiff --git a/docs/troubleshooting.md b/docs/troubleshooting.mdindex 8747a960..20404620 100644--- a/docs/troubleshooting.md+++ b/docs/troubleshooting.md@@ -54,6 +54,8 @@ Transcription accuracy depends heavily on audio quality. Background noise, multiLanguage mismatches cause poor results too. If you've set a specific transcription language in settings but upload audio in a different language, accuracy suffers. Either set the correct language or leave it blank for auto-detection.+For domain-specific terminology, brand names, or acronyms that keep getting misspelled, use the [custom vocabulary (hotwords) and initial prompt](features.md#custom-vocabulary--transcription-hints) features. Set these per-upload in Advanced ASR Options, or configure them on your tags, folders, or user defaults for automatic application. See the [FAQ entry](faq.md#certain-specialized-words-dont-get-transcribed-properly-how-do-i-fix-this) for practical guidance.+For recordings with multiple speakers, using the [ASR endpoint with speaker diarization](features.md#speaker-diarization) dramatically improves usability. Learn how to [identify speakers](user-guide/transcripts.md#speaker-identification) after transcription, even if the raw transcription accuracy is similar.### "Format Not Recognised" Errors@@ -61,6 +63,7 @@ For recordings with multiple speakers, using the [ASR endpoint with speaker diarIf your transcription service returns "format not recognised" or similar codec errors, your service may not support certain audio formats that Speakr considers supported by default.This commonly occurs with:+- **vLLM-hosted Whisper instances** that don't support Opus codec- **Self-hosted ASR services** with limited codec support- **WebM recordings** (which typically use Opus audio)@@ -107,6 +110,7 @@ If Speakr crashed or restarted while recordings were processing, they automaticaPrior to v0.6.2, deleted recordings could remain visible in the processing queue as "ghost entries." Clicking on these would open an empty recording window. This has been resolved - deleted recordings are now immediately removed from both the frontend queue and backend job tracking.If you're on v0.6.1 or earlier and see this behavior, upgrade to v0.6.2. The fix ensures that when you delete a recording:+- It's removed from your library- It's removed from the processing queue display- Any associated backend jobs are cleaned updiff --git a/docs/user-guide/folders.md b/docs/user-guide/folders.mdindex f4734087..40cdf556 100644--- a/docs/user-guide/folders.md+++ b/docs/user-guide/folders.md@@ -37,6 +37,8 @@ Each folder can have custom settings that apply to recordings placed in it:| **Custom Prompt** | AI summarization instructions specific to this folder || **Default Language** | Transcription language for new recordings || **Min/Max Speakers** | Speaker count hints for ASR diarization |+| **Hotwords** | Comma-separated vocabulary hints for transcription accuracy |+| **Initial Prompt** | Context description to guide transcription || **Retention Days** | Override global retention for recordings in this folder || **Protection** | Exempt folder contents from auto-deletion |diff --git a/docs/user-guide/pwa.md b/docs/user-guide/pwa.mdindex b5dfe91d..11313063 100644--- a/docs/user-guide/pwa.md+++ b/docs/user-guide/pwa.md@@ -113,6 +113,7 @@ Monitors when the app goes to background:**Why this happens:**Mobile browsers intentionally suspend web pages in the background to save battery. This affects:+- JavaScript execution (timers, code)- MediaRecorder API (audio capture)- Audio context (audio processing)@@ -120,6 +121,7 @@ Mobile browsers intentionally suspend web pages in the background to save batterNative apps don't have this limitation because they use platform-specific APIs that run outside the browser.**Desktop browsers work differently:**+- Recording continues when window is minimized- Can switch to other apps- Only stops when browser is completely closed@@ -333,6 +335,7 @@ To force an update:3. Select **"Uninstall Speakr"**Alternatively, remove from:+- **Chrome**: `chrome://apps` → Right-click app → Remove- **Edge**: `edge://apps` → Click ⋮ on app → Uninstall---diff --git a/docs/user-guide/recording.md b/docs/user-guide/recording.mdindex 2da36e31..3e4b7691 100644--- a/docs/user-guide/recording.md+++ b/docs/user-guide/recording.md@@ -64,6 +64,7 @@ Choose the screen option if the audio you want to record is coming from desktopThis is the recommended option when recording:+- Desktop applications like Zoom client, Microsoft Groups, Skype, or Discord- Audio from multiple browser tabs simultaneously- System sounds or notifications you want to capture@@ -121,6 +122,16 @@ If your administrator has configured ASR endpoints with speaker diarization, youThese settings are particularly useful for meetings with known participants, as setting accurate speaker counts improves the AI's ability to separate different voices in the transcription.+#### Custom Vocabulary (Hotwords)++The **Hotwords** field lets you provide a comma-separated list of words or phrases that the transcription engine should prioritize. This is especially useful for domain-specific terminology, brand names, acronyms, or proper nouns that the model might otherwise misspell or miss entirely. For example, entering `Speakr, CTranslate2, PyAnnote` helps the engine correctly recognize these terms in your audio.++#### Initial Prompt++The **Initial Prompt** field provides context to the transcription engine about what the recording contains. Think of it as a brief description that steers the model's expectations. For example: "This is a meeting about AI-powered audio transcription tools." This helps the model make better word choices when the audio is ambiguous.++Both fields follow a precedence hierarchy: values you set in the upload form override tag defaults, which override folder defaults, which override your personal defaults in [account settings](settings.md#custom-prompts-tab). If you regularly transcribe similar content, set your defaults at the tag or user level so you don't have to enter them every time.+### Final ActionsAt the bottom of the modal, you have three options for proceeding. The "Upload" or "Start Processing" button begins transcription immediately with your selected settings. The recording will appear in your library with a processing indicator while transcription runs in the background. The "Discard" option deletes the recording without saving, useful if you made a test recording or captured the wrong content. Some configurations may also offer a "Save Draft" option to store the recording without processing it immediately.@@ -133,6 +144,7 @@ At the bottom of the modal, you have three options for proceeding. The "Upload"When you return to Speakr after a crash, you'll see a recovery modal offering to restore your interrupted recording:**What Gets Recovered:**+- All recorded audio up to the point of interruption- Recording mode (microphone, system audio, or combined)- Any notes you had entered@@ -140,12 +152,14 @@ When you return to Speakr after a crash, you'll see a recovery modal offering to- Exact timestamp when recording started**How Recovery Works:**+1. When you return to Speakr after a crash, a modal automatically appears2. Review the recording details (duration, size, timestamp)3. Click "Restore Recording" to continue where you left off, or "Discard" to start fresh4. Recovered recordings appear in the finalization screen ready for processing**Limitations:**+- Recovery data is stored in your browser's IndexedDB storage (per-browser, per-device)- Clearing browser data will delete recovery information- Recording chunks are saved every 5 seconds, so up to 5 seconds of audio may be lostdiff --git a/docs/user-guide/settings.md b/docs/user-guide/settings.mdindex cc210ccc..5dd199d5 100644--- a/docs/user-guide/settings.md+++ b/docs/user-guide/settings.md@@ -73,6 +73,18 @@ Understanding prompt precedence helps you use this feature effectively. Tag promMultiple tag prompts combine intelligently when applied together. A recording tagged with both "Client" and "Technical" receives both sets of instructions, creating comprehensive summaries without needing complex single prompts trying to cover every scenario.+### Transcription Hints++Below the summary prompt, you'll find the **Transcription Hints** section with two fields that help improve transcription accuracy:++- **Default Hotwords** - A comma-separated list of words or phrases the transcription engine should prioritize, such as brand names, acronyms, or specialized terminology (e.g., `Speakr, CTranslate2, PyAnnote`).+- **Default Initial Prompt** - A brief description of the typical content of your recordings that provides context to the transcription engine (e.g., "This is a meeting about software development and AI tools.").++These defaults apply to all your recordings unless overridden by tag defaults, folder defaults, or values you set in the upload form's Advanced ASR Options. This is the lowest priority level in the precedence hierarchy, making it a good place to set general-purpose hints that apply across most of your content.++!!! tip "When to use hotwords vs initial prompt"+ Use **hotwords** for specific terms the model tends to misspell - proper nouns, brand names, technical acronyms. Use **initial prompt** for broader context that helps the model understand the domain and make better overall word choices.+### Writing Effective PromptsCraft prompts based on how you actually use summaries. Do you extract action items for project management? Look for decisions that affect strategy? Track technical details for documentation? Your prompt should request exactly what you need for these next steps.@@ -183,6 +195,14 @@ Tag prompts stack intelligently when multiple tags are applied. If you tag a recThe ASR defaults feature is particularly valuable for consistent meeting types. Setting "Max 10" for a "Court Action" tag ensures the transcription service looks for up to 10 distinct speakers, improving accuracy for multi-party proceedings. A "One-on-One" tag might default to exactly 2 speakers, while a "Webinar" tag could specify 1-3 speakers.+### Transcription Hints (Hotwords & Initial Prompt)++Tags can also carry default **hotwords** and an **initial prompt** to improve transcription accuracy for specialized content. Hotwords are comma-separated terms the transcription engine should prioritize (e.g., brand names, acronyms, technical jargon). The initial prompt provides broader context about the recording content, helping the engine make better word choices.++For example, a "Medical Rounds" tag might include hotwords like `epinephrine, tachycardia, intubation` and an initial prompt like "This is a medical team discussion about patient care in an ICU setting." When you upload a recording with this tag, these hints are automatically applied during transcription.++These values follow a precedence hierarchy: upload form values take highest priority, then tag defaults, then folder defaults, then your personal defaults in [account settings](#custom-prompts-tab).+### Managing TagsEdit and delete buttons on each card provide full control. Edit to refine prompts based on results, adjust colors for better organization, or update ASR defaults as meeting patterns change. Delete removes tags no longer needed, though this doesn't affect recordings already tagged - they retain their labels for historical accuracy.diff --git a/docs/user-guide/sharing.md b/docs/user-guide/sharing.mdindex 5330f12c..452d3a61 100644--- a/docs/user-guide/sharing.md+++ b/docs/user-guide/sharing.md@@ -52,6 +52,7 @@ Revoking access is immediate and thorough. When you revoke someone's access, theOne of internal sharing's most powerful features is support for personal notes. When someone shares a recording with you, you can add your own private notes that only you can see. These personal notes never appear to the original owner or other recipients - they're your private space for observations, follow-ups, or context.**Important: Notes vs. Summaries**+- **Notes**: Always personal and private. Each user (owner and shared recipients) can create their own notes that only they can see. No edit permission is required to add personal notes to a shared recording.- **Summary**: Shared globally. The recording owner's AI-generated summary is visible to all users who have access to the recording. Only users with edit permission can modify the summary.diff --git a/docs/user-guide/transcript-templates.md b/docs/user-guide/transcript-templates.mdindex 2dfd9b2f..3f551e8a 100644--- a/docs/user-guide/transcript-templates.md+++ b/docs/user-guide/transcript-templates.md@@ -39,12 +39,15 @@ In the Transcript Templates section, click the **Create Template** button.### Step 2: Fill in Template Details**Template Name**: Give your template a descriptive name+- Examples: "Interview Format", "Subtitles SRT", "Meeting Minutes"**Description** (Optional): Add a brief description of when to use this template+- Example: "Use for client interview transcriptions"**Template**: Enter your format pattern using variables+- Example: `[{{start_time}}] {{speaker}}: {{text}}`### Step 3: Set Default (Optional)@@ -174,6 +177,7 @@ I'm doing great, thanks for asking!### Creating Default TemplatesIf you have no templates, click **Create Default Templates** to generate a comprehensive set of starter templates:+- Simple Conversation - Clean format with just speaker names- Timestamped - Basic format with time ranges- Interview Q&A - Professional interview format@@ -313,6 +317,7 @@ Here's a complete setup for automatic export to Obsidian:```Now when any recording finishes processing, Speakr automatically writes a markdown file to your Obsidian vault with:+- Metadata (date, participants, tags, processing times)- Notes (if you added any)- AI-generated summary@@ -350,6 +355,7 @@ This same approach works with Logseq, Notion (if you set the export directory to## Need Help?If you encounter issues or have questions about transcript templates:+1. Check this guide for examples and troubleshooting2. Try the default templates as a starting point3. Report issues at [GitHub Issues](https://github.com/anthropics/claude-code/issues)diff --git a/docs/user-guide/transcripts.md b/docs/user-guide/transcripts.mdindex e43dfa64..6eedf765 100644--- a/docs/user-guide/transcripts.md+++ b/docs/user-guide/transcripts.md@@ -224,6 +224,7 @@ These export features are particularly useful when you've used the chat to extraThe Notes tab is your personal workspace for adding context and thoughts about the recording. These notes are **always private** - only you can see them, whether you own the recording or it's been shared with you. This is different from summaries, which are shared with all users who have access to the recording.**Important: Notes are Personal, Summaries are Shared**+- **Notes**: Always private to each user. You can add and edit your own notes on any recording (owned or shared) without needing any special permissions. Other users cannot see your notes, and you cannot see theirs.- **Summary**: Shared content created by the recording owner. Only users with edit permission can modify the summary, and all users with access to the recording see the same summary.diff --git a/src/api/auth.py b/src/api/auth.pyindex d6bfd90b..7414eca4 100644--- a/src/api/auth.py+++ b/src/api/auth.py@@ -587,6 +587,11 @@ def account():current_user.summary_prompt = summary_prompt_text if summary_prompt_text else None# Handle event extraction settingcurrent_user.extract_events = 'extract_events' in request.form+ # Handle transcription hints+ hotwords = request.form.get('transcription_hotwords')+ current_user.transcription_hotwords = hotwords if hotwords else None+ initial_prompt = request.form.get('transcription_initial_prompt')+ current_user.transcription_initial_prompt = initial_prompt if initial_prompt else None# Only update diarize if it's not locked by env varif 'ASR_DIARIZE' not in os.environ:diff --git a/src/api/folders.py b/src/api/folders.pyindex 30390a9b..95d9a463 100644--- a/src/api/folders.py+++ b/src/api/folders.py@@ -150,6 +150,8 @@ def create_folder():default_language=data.get('default_language'),default_min_speakers=data.get('default_min_speakers'),default_max_speakers=data.get('default_max_speakers'),+ default_hotwords=data.get('default_hotwords'),+ default_initial_prompt=data.get('default_initial_prompt'),protect_from_deletion=protect_from_deletion,retention_days=retention_days,auto_share_on_apply=data.get('auto_share_on_apply', True) if group_id else True,@@ -237,6 +239,10 @@ def update_folder(folder_id):folder.default_min_speakers = data['default_min_speakers']if 'default_max_speakers' in data:folder.default_max_speakers = data['default_max_speakers']+ if 'default_hotwords' in data:+ folder.default_hotwords = data['default_hotwords'] or None+ if 'default_initial_prompt' in data:+ folder.default_initial_prompt = data['default_initial_prompt'] or None# Handle retention_days: -1 means protected from deletionif 'retention_days' in data:@@ -385,6 +391,8 @@ def create_group_folder(group_id):default_language=data.get('default_language'),default_min_speakers=data.get('default_min_speakers'),default_max_speakers=data.get('default_max_speakers'),+ default_hotwords=data.get('default_hotwords'),+ default_initial_prompt=data.get('default_initial_prompt'),protect_from_deletion=data.get('protect_from_deletion', False),retention_days=data.get('retention_days'),auto_share_on_apply=data.get('auto_share_on_apply', True), # Default to True for group foldersdiff --git a/src/api/recordings.py b/src/api/recordings.pyindex 464f5c14..1bf05996 100644--- a/src/api/recordings.py+++ b/src/api/recordings.py@@ -1929,6 +1929,29 @@ def upload_file():file.save(filepath)current_app.logger.info(f"File saved to {filepath}")+ # Compute file hash on the ORIGINAL upload before any conversion/compression.+ # Lossy re-encoding (e.g. FLAC→MP3) produces different bytes each run,+ # so hashing after conversion would miss duplicates.+ file_hash = None+ duplicate_warning = None+ try:+ file_hash = compute_file_sha256(filepath)+ existing = Recording.query.filter_by(+ user_id=current_user.id, file_hash=file_hash+ ).first()+ if existing:+ duplicate_warning = {+ 'existing_recording_id': existing.id,+ 'existing_title': existing.title,+ 'existing_created_at': existing.created_at.isoformat() if existing.created_at else None+ }+ current_app.logger.info(+ f"Duplicate file detected for user {current_user.id}: "+ f"hash={file_hash[:12]}... matches recording {existing.id}"+ )+ except Exception as e:+ current_app.logger.warning(f"Could not compute file hash: {e}")+# --- Convert files only when chunking is needed ---filename_lower = original_filename.lower()@@ -2000,26 +2023,7 @@ def upload_file():# Get final file size (of original or converted file)final_file_size = os.path.getsize(filepath)- # Compute file hash for duplicate detection (hash the final/converted file)- file_hash = None- duplicate_warning = None- try:- file_hash = compute_file_sha256(filepath)- existing = Recording.query.filter_by(- user_id=current_user.id, file_hash=file_hash- ).first()- if existing:- duplicate_warning = {- 'existing_recording_id': existing.id,- 'existing_title': existing.title,- 'existing_created_at': existing.created_at.isoformat() if existing.created_at else None- }- current_app.logger.info(- f"Duplicate file detected for user {current_user.id}: "- f"hash={file_hash[:12]}... matches recording {existing.id}"- )- except Exception as e:- current_app.logger.warning(f"Could not compute file hash: {e}")+ # (file_hash and duplicate_warning already computed above, before conversion)# Determine MIME type of the final filemime_type, _ = mimetypes.guess_type(filepath)@@ -2071,6 +2075,8 @@ def upload_file():language = request.form.get('language', '')min_speakers = request.form.get('min_speakers') or Nonemax_speakers = request.form.get('max_speakers') or None+ hotwords = request.form.get('hotwords', '').strip() or None+ initial_prompt = request.form.get('initial_prompt', '').strip() or None# Convert to int if providedif min_speakers:@@ -2084,7 +2090,7 @@ def upload_file():except (ValueError, TypeError):max_speakers = None- # Apply precedence hierarchy: user input > tag defaults > folder defaults > environment variables > auto-detect+ # Apply precedence hierarchy: user input > tag defaults > folder defaults > environment variables > user defaults > auto-detect# Apply folder defaults first (lower priority than tags)if selected_folder and not selected_tags:@@ -2095,6 +2101,10 @@ def upload_file():min_speakers = selected_folder.default_min_speakersif max_speakers is None and selected_folder.default_max_speakers:max_speakers = selected_folder.default_max_speakers+ if not hotwords and selected_folder.default_hotwords:+ hotwords = selected_folder.default_hotwords+ if not initial_prompt and selected_folder.default_initial_prompt:+ initial_prompt = selected_folder.default_initial_prompt# Apply tag defaults if tags are selected and values are not explicitly provided by user# Use first tag's defaults (highest priority - overrides folder)@@ -2106,6 +2116,10 @@ def upload_file():min_speakers = first_tag.default_min_speakersif max_speakers is None and first_tag.default_max_speakers:max_speakers = first_tag.default_max_speakers+ if not hotwords and first_tag.default_hotwords:+ hotwords = first_tag.default_hotwords+ if not initial_prompt and first_tag.default_initial_prompt:+ initial_prompt = first_tag.default_initial_prompt# Apply environment variable defaults if still no values are setif min_speakers is None and ASR_MIN_SPEAKERS:@@ -2119,10 +2133,14 @@ def upload_file():except (ValueError, TypeError):max_speakers = None- # Fall back to user's default transcription language if still not set+ # Fall back to user defaults if still not setif not language and current_user.transcription_language:language = current_user.transcription_languagecurrent_app.logger.info(f"Using user's default transcription language: {language}")+ if not hotwords and current_user.transcription_hotwords:+ hotwords = current_user.transcription_hotwords+ if not initial_prompt and current_user.transcription_initial_prompt:+ initial_prompt = current_user.transcription_initial_prompt# Create initial database entrynow = datetime.utcnow()@@ -2191,7 +2209,9 @@ def upload_file():'language': language,'min_speakers': min_speakers,'max_speakers': max_speakers,- 'tag_id': first_tag.id if first_tag else None+ 'tag_id': first_tag.id if first_tag else None,+ 'hotwords': hotwords,+ 'initial_prompt': initial_prompt,}current_app.logger.info(f"Queueing transcription for recording {recording.id} with params: {job_params}")diff --git a/src/api/tags.py b/src/api/tags.pyindex 288a5a7b..084fb619 100644--- a/src/api/tags.py+++ b/src/api/tags.py@@ -148,6 +148,8 @@ def create_tag():default_language=data.get('default_language'),default_min_speakers=data.get('default_min_speakers'),default_max_speakers=data.get('default_max_speakers'),+ default_hotwords=data.get('default_hotwords'),+ default_initial_prompt=data.get('default_initial_prompt'),protect_from_deletion=protect_from_deletion,retention_days=retention_days,auto_share_on_apply=data.get('auto_share_on_apply', True) if group_id else True,@@ -231,6 +233,10 @@ def update_tag(tag_id):tag.default_min_speakers = data['default_min_speakers']if 'default_max_speakers' in data:tag.default_max_speakers = data['default_max_speakers']+ if 'default_hotwords' in data:+ tag.default_hotwords = data['default_hotwords'] or None+ if 'default_initial_prompt' in data:+ tag.default_initial_prompt = data['default_initial_prompt'] or None# Handle retention_days: -1 means protected from deletionif 'retention_days' in data:@@ -374,6 +380,8 @@ def create_group_tag(group_id):default_language=data.get('default_language'),default_min_speakers=data.get('default_min_speakers'),default_max_speakers=data.get('default_max_speakers'),+ default_hotwords=data.get('default_hotwords'),+ default_initial_prompt=data.get('default_initial_prompt'),protect_from_deletion=data.get('protect_from_deletion', False),retention_days=data.get('retention_days'),auto_share_on_apply=data.get('auto_share_on_apply', True), # Default to True for group tagsdiff --git a/src/file_monitor.py b/src/file_monitor.pyindex 5df25dc1..f5d2591e 100644--- a/src/file_monitor.py+++ b/src/file_monitor.py@@ -319,6 +319,16 @@ class FileMonitor:# This should not happen if the lock is held, but good to logself.logger.warning(f"Locked file {processing_path} was already deleted.")+ # Compute file hash on the ORIGINAL file before any conversion/compression.+ # Lossy re-encoding produces different bytes each run, so hashing after+ # conversion would miss duplicates.+ file_hash = None+ try:+ from src.utils.file_hash import compute_file_sha256+ file_hash = compute_file_sha256(str(destination_path))+ except Exception as e:+ self.logger.warning(f"Could not compute file hash: {e}")+# Probe once to get codec info, then pass through pipeline to avoid redundant callscodec_info = Nonetry:@@ -372,13 +382,7 @@ class FileMonitor:self.logger.error(f"FFmpeg conversion failed: {e}")raise- # Compute file hash for duplicate detection- file_hash = None- try:- from src.utils.file_hash import compute_file_sha256- file_hash = compute_file_sha256(str(final_path))- except Exception as e:- self.logger.warning(f"Could not compute file hash: {e}")+ # (file_hash already computed above, before conversion)# Get file size and MIME typefile_size = final_path.stat().st_sizediff --git a/src/init_db.py b/src/init_db.pyindex 01a6867a..ab81ee83 100644--- a/src/init_db.py+++ b/src/init_db.py@@ -279,6 +279,20 @@ def initialize_database(app):if add_column_if_not_exists(engine, 'user', 'auto_summarization', 'BOOLEAN DEFAULT 1'):app.logger.info("Added auto_summarization column to user table")+ # Transcription hints (hotwords and initial prompt for improving ASR accuracy)+ if add_column_if_not_exists(engine, 'user', 'transcription_hotwords', 'TEXT'):+ app.logger.info("Added transcription_hotwords column to user table")+ if add_column_if_not_exists(engine, 'user', 'transcription_initial_prompt', 'TEXT'):+ app.logger.info("Added transcription_initial_prompt column to user table")+ if add_column_if_not_exists(engine, 'tag', 'default_hotwords', 'TEXT'):+ app.logger.info("Added default_hotwords column to tag table")+ if add_column_if_not_exists(engine, 'tag', 'default_initial_prompt', 'TEXT'):+ app.logger.info("Added default_initial_prompt column to tag table")+ if add_column_if_not_exists(engine, 'folder', 'default_hotwords', 'TEXT'):+ app.logger.info("Added default_hotwords column to folder table")+ if add_column_if_not_exists(engine, 'folder', 'default_initial_prompt', 'TEXT'):+ app.logger.info("Added default_initial_prompt column to folder table")+# Create indexes for token lookups (for faster token verification)try:if create_index_if_not_exists(engine, 'ix_user_email_verification_token', 'user', 'email_verification_token'):diff --git a/src/models/organization.py b/src/models/organization.pyindex a934801b..1e536eda 100644--- a/src/models/organization.py+++ b/src/models/organization.py@@ -95,6 +95,10 @@ class Folder(db.Model):default_min_speakers = db.Column(db.Integer, nullable=True) # Default min speakers for ASRdefault_max_speakers = db.Column(db.Integer, nullable=True) # Default max speakers for ASR+ # Transcription hints+ default_hotwords = db.Column(db.Text, nullable=True) # Comma-separated words to bias recognition+ default_initial_prompt = db.Column(db.Text, nullable=True) # Initial prompt to steer transcription+# Retention and deletion settingsprotect_from_deletion = db.Column(db.Boolean, default=False) # Exempt recordings in folder from auto-deletionretention_days = db.Column(db.Integer, nullable=True) # Folder-specific retention override@@ -141,6 +145,8 @@ class Folder(db.Model):'default_language': self.default_language,'default_min_speakers': self.default_min_speakers,'default_max_speakers': self.default_max_speakers,+ 'default_hotwords': self.default_hotwords,+ 'default_initial_prompt': self.default_initial_prompt,'protect_from_deletion': self.protect_from_deletion,'retention_days': self.retention_days,'auto_share_on_apply': self.auto_share_on_apply,@@ -169,6 +175,10 @@ class Tag(db.Model):default_min_speakers = db.Column(db.Integer, nullable=True) # Default min speakers for ASRdefault_max_speakers = db.Column(db.Integer, nullable=True) # Default max speakers for ASR+ # Transcription hints+ default_hotwords = db.Column(db.Text, nullable=True) # Comma-separated words to bias recognition+ default_initial_prompt = db.Column(db.Text, nullable=True) # Initial prompt to steer transcription+# Retention and deletion settingsprotect_from_deletion = db.Column(db.Boolean, default=False) # Exempt tagged recordings from auto-deletionretention_days = db.Column(db.Integer, nullable=True) # Group-specific retention override (overrides global)@@ -215,6 +225,8 @@ class Tag(db.Model):'default_language': self.default_language,'default_min_speakers': self.default_min_speakers,'default_max_speakers': self.default_max_speakers,+ 'default_hotwords': self.default_hotwords,+ 'default_initial_prompt': self.default_initial_prompt,'protect_from_deletion': self.protect_from_deletion,'retention_days': self.retention_days,'auto_share_on_apply': self.auto_share_on_apply,diff --git a/src/models/user.py b/src/models/user.pyindex 9b1f95e8..364334aa 100644--- a/src/models/user.py+++ b/src/models/user.py@@ -58,6 +58,10 @@ class User(db.Model, UserMixin):# Auto summarization setting (user can disable if admin hasn't globally disabled)auto_summarization = db.Column(db.Boolean, default=True)+ # Transcription hints (hotwords and initial prompt for improving ASR accuracy)+ transcription_hotwords = db.Column(db.Text, nullable=True)+ transcription_initial_prompt = db.Column(db.Text, nullable=True)+def __repr__(self):return f"User('{self.username}', '{self.email}')"diff --git a/src/services/job_queue.py b/src/services/job_queue.pyindex 0a4264ec..d3a0d283 100644--- a/src/services/job_queue.py+++ b/src/services/job_queue.py@@ -397,7 +397,9 @@ class FairJobQueue:language=params.get('language'),min_speakers=params.get('min_speakers'),max_speakers=params.get('max_speakers'),- tag_id=params.get('tag_id')+ tag_id=params.get('tag_id'),+ hotwords=params.get('hotwords'),+ initial_prompt=params.get('initial_prompt'),)def _run_summarization(self, job, recording, params):@@ -429,7 +431,9 @@ class FairJobQueue:language=params.get('language'),min_speakers=params.get('min_speakers'),max_speakers=params.get('max_speakers'),- tag_id=params.get('tag_id')+ tag_id=params.get('tag_id'),+ hotwords=params.get('hotwords'),+ initial_prompt=params.get('initial_prompt'),)def _run_reprocess_summary(self, job, recording, params):diff --git a/src/services/transcription/base.py b/src/services/transcription/base.pyindex 02426cb7..6ce0aa0f 100644--- a/src/services/transcription/base.py+++ b/src/services/transcription/base.py@@ -72,6 +72,7 @@ class TranscriptionRequest:# Advanced optionsprompt: Optional[str] = None+ hotwords: Optional[str] = None # Comma-separated words to bias recognitiontemperature: Optional[float] = None# Provider-specific options (passthrough)diff --git a/src/services/transcription/connectors/asr_endpoint.py b/src/services/transcription/connectors/asr_endpoint.pyindex 0d231503..d3f9266f 100644--- a/src/services/transcription/connectors/asr_endpoint.py+++ b/src/services/transcription/connectors/asr_endpoint.py@@ -157,6 +157,11 @@ class ASREndpointConnector(BaseTranscriptionConnector):if request.max_speakers:params['max_speakers'] = request.max_speakers+ if request.prompt:+ params['initial_prompt'] = request.prompt+ if request.hotwords:+ params['hotwords'] = request.hotwords+content_type = request.mime_type or 'application/octet-stream'files = {'audio_file': (request.filename, request.audio_file, content_type)diff --git a/src/services/transcription/connectors/azure_openai_transcribe.py b/src/services/transcription/connectors/azure_openai_transcribe.pyindex 6a56ea9c..c4e92418 100644--- a/src/services/transcription/connectors/azure_openai_transcribe.py+++ b/src/services/transcription/connectors/azure_openai_transcribe.py@@ -204,8 +204,14 @@ class AzureOpenAITranscribeConnector(BaseTranscriptionConnector):else:# Non-diarization models - request verbose_json for timestampsdata["response_format"] = "verbose_json"+ # Combine initial prompt and hotwords into a single prompt+ prompt_parts = []if request.prompt:- data["prompt"] = request.prompt+ prompt_parts.append(request.prompt)+ if request.hotwords:+ prompt_parts.append(request.hotwords)+ if prompt_parts:+ data["prompt"] = ". ".join(prompt_parts)# Prepare file for uploadcontent_type = request.mime_type or 'application/octet-stream'diff --git a/src/services/transcription/connectors/openai_transcribe.py b/src/services/transcription/connectors/openai_transcribe.pyindex 37d6d059..f6828031 100644--- a/src/services/transcription/connectors/openai_transcribe.py+++ b/src/services/transcription/connectors/openai_transcribe.py@@ -201,9 +201,14 @@ class OpenAITranscribeConnector(BaseTranscriptionConnector):}logger.info(f"Using known speaker references for {len(speaker_names)} speakers: {speaker_names}")else:- # Non-diarization models+ # Non-diarization models - combine initial prompt and hotwords+ prompt_parts = []if request.prompt:- params["prompt"] = request.prompt+ prompt_parts.append(request.prompt)+ if request.hotwords:+ prompt_parts.append(request.hotwords)+ if prompt_parts:+ params["prompt"] = ". ".join(prompt_parts)logger.info(f"Sending request to GPT-4o Transcribe API with model: {self.model}")response = self.client.audio.transcriptions.create(**params)diff --git a/src/services/transcription/connectors/openai_whisper.py b/src/services/transcription/connectors/openai_whisper.pyindex 60807cf3..b52ad0a4 100644--- a/src/services/transcription/connectors/openai_whisper.py+++ b/src/services/transcription/connectors/openai_whisper.py@@ -98,8 +98,15 @@ class OpenAIWhisperConnector(BaseTranscriptionConnector):params["language"] = request.languagelogger.info(f"Using transcription language: {request.language}")+ # Combine initial prompt and hotwords into a single prompt+ # OpenAI Whisper uses prompt for both steering and vocabulary hints+ prompt_parts = []if request.prompt:- params["prompt"] = request.prompt+ prompt_parts.append(request.prompt)+ if request.hotwords:+ prompt_parts.append(request.hotwords)+ if prompt_parts:+ params["prompt"] = ". ".join(prompt_parts)if request.temperature is not None:params["temperature"] = request.temperaturediff --git a/src/tasks/processing.py b/src/tasks/processing.pyindex a4c37496..aeebb4b5 100644--- a/src/tasks/processing.py+++ b/src/tasks/processing.py@@ -1212,7 +1212,7 @@ def merge_diarized_chunks(chunk_results):return merged_text, merged_segments, sorted(list(all_speakers))-def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, language, diarize=False):+def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, language, diarize=False, hotwords=None, initial_prompt=None):"""Transcribe a large audio file using chunking with the connector architecture.@@ -1232,6 +1232,8 @@ def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, lmime_type: MIME type of the audio filelanguage: Optional language codediarize: Whether diarization was requested (for connectors that support it)+ hotwords: Optional comma-separated hotwords to bias recognition+ initial_prompt: Optional initial prompt to steer transcriptionReturns:Merged transcription text (with speaker labels if diarization enabled)@@ -1290,7 +1292,9 @@ def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, llanguage=language,diarize=True,known_speaker_names=known_speaker_names,- known_speaker_references=known_speaker_refs+ known_speaker_references=known_speaker_refs,+ prompt=initial_prompt,+ hotwords=hotwords,)else:request = TranscriptionRequest(@@ -1298,7 +1302,9 @@ def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, lfilename=chunk['filename'],mime_type='audio/mpeg',language=language,- diarize=False+ diarize=False,+ prompt=initial_prompt,+ hotwords=hotwords,)response = connector.transcribe(request)@@ -1410,7 +1416,7 @@ def transcribe_chunks_with_connector(connector, filepath, filename, mime_type, lraise ChunkProcessingError(f"Chunked transcription failed: {str(e)}")-def transcribe_with_connector(app_context, recording_id, filepath, original_filename, start_time, mime_type=None, language=None, diarize=None, min_speakers=None, max_speakers=None, tag_id=None):+def transcribe_with_connector(app_context, recording_id, filepath, original_filename, start_time, mime_type=None, language=None, diarize=None, min_speakers=None, max_speakers=None, tag_id=None, hotwords=None, initial_prompt=None):"""Transcribe audio using the new connector-based architecture.@@ -1432,6 +1438,8 @@ def transcribe_with_connector(app_context, recording_id, filepath, original_filemin_speakers: Optional minimum speakersmax_speakers: Optional maximum speakerstag_id: Optional tag ID to apply custom prompt from+ hotwords: Optional comma-separated hotwords to bias recognition+ initial_prompt: Optional initial prompt to steer transcription"""from src.services.transcription import (get_connector, TranscriptionRequest, TranscriptionCapability@@ -1611,7 +1619,9 @@ def transcribe_with_connector(app_context, recording_id, filepath, original_filecurrent_app.logger.info(f"File {actual_filepath} is large ({file_size_mb:.1f}MB), using chunking for transcription")chunk_result = transcribe_chunks_with_connector(connector, actual_filepath, actual_filename, actual_content_type, language,- diarize=should_diarize # Pass diarization setting for speaker reference tracking+ diarize=should_diarize, # Pass diarization setting for speaker reference tracking+ hotwords=hotwords,+ initial_prompt=initial_prompt,)# Handle result based on type (TranscriptionResponse for diarized, string for plain)@@ -1634,7 +1644,9 @@ def transcribe_with_connector(app_context, recording_id, filepath, original_filelanguage=language,diarize=should_diarize,min_speakers=min_speakers,- max_speakers=max_speakers+ max_speakers=max_speakers,+ prompt=initial_prompt,+ hotwords=hotwords,)current_app.logger.info(f"Transcribing with connector: diarize={should_diarize}, language={language}")@@ -1841,7 +1853,7 @@ def transcribe_with_connector(app_context, recording_id, filepath, original_fileraise-def transcribe_audio_task(app_context, recording_id, filepath, filename_for_asr, start_time, language=None, min_speakers=None, max_speakers=None, tag_id=None):+def transcribe_audio_task(app_context, recording_id, filepath, filename_for_asr, start_time, language=None, min_speakers=None, max_speakers=None, tag_id=None, hotwords=None, initial_prompt=None):"""Runs the transcription and summarization in a background thread.Uses the connector-based architecture which supports:@@ -1860,6 +1872,8 @@ def transcribe_audio_task(app_context, recording_id, filepath, filename_for_asr,min_speakers: Optional minimum speakers override (from upload form)max_speakers: Optional maximum speakers override (from upload form)tag_id: Optional tag ID to apply custom prompt from+ hotwords: Optional comma-separated hotwords to bias recognition+ initial_prompt: Optional initial prompt to steer transcription"""with app_context:recording = db.session.get(Recording, recording_id)@@ -1885,7 +1899,9 @@ def transcribe_audio_task(app_context, recording_id, filepath, filename_for_asr,diarize=diarize_setting,min_speakers=min_speakers,max_speakers=max_speakers,- tag_id=tag_id+ tag_id=tag_id,+ hotwords=hotwords,+ initial_prompt=initial_prompt,)# After transcription completes, calculate processing timediff --git a/static/js/app.modular.js b/static/js/app.modular.jsindex 57e04eb2..4db834b2 100644--- a/static/js/app.modular.js+++ b/static/js/app.modular.js@@ -385,6 +385,8 @@ document.addEventListener('DOMContentLoaded', async () => {const uploadLanguage = ref('');const uploadMinSpeakers = ref('');const uploadMaxSpeakers = ref('');+ const uploadHotwords = ref('');+ const uploadInitialPrompt = ref('');// Tag Selectionconst availableTags = ref([]);@@ -647,7 +649,7 @@ document.addEventListener('DOMContentLoaded', async () => {isProcessingActive, pollInterval, progressPopupMinimized, progressPopupClosed,maxFileSizeMB, chunkingEnabled, chunkingMode, chunkingLimit, chunkingLimitDisplay,maxConcurrentUploads, recordingDisclaimer, showRecordingDisclaimerModal, pendingRecordingMode,- showAdvancedOptions, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers,+ showAdvancedOptions, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers, uploadHotwords, uploadInitialPrompt,availableTags, selectedTagIds, uploadTagSearchFilter,availableFolders, selectedFolderId, foldersEnabled, filterFolder,diff --git a/static/js/modules/composables/recordings.js b/static/js/modules/composables/recordings.jsindex 2929c686..7e6e910d 100644--- a/static/js/modules/composables/recordings.js+++ b/static/js/modules/composables/recordings.js@@ -12,7 +12,7 @@ export function useRecordings(state, utils, reprocessComposable) {showSharedWithMe, showArchivedRecordings, searchQuery, searchDebounceTimer,filterTags, filterSpeakers, filterDatePreset, filterDateRange, filterTextQuery,filterStarred, filterInbox, filterFolder, sortBy,- availableTags, availableSpeakers, availableFolders, selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers,+ availableTags, availableSpeakers, availableFolders, selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers, uploadHotwords, uploadInitialPrompt,useAsrEndpoint, connectorSupportsDiarization, globalError, uploadQueue, isProcessingActive, currentView,isMobileScreen, isSidebarCollapsed, isRecording, audioBlobURL,speakerColorMap,@@ -433,6 +433,14 @@ export function useRecordings(state, utils, reprocessComposable) {uploadMaxSpeakers.value = firstTag.default_max_speakers;}}+ if (firstTag) {+ if (firstTag.default_hotwords) {+ uploadHotwords.value = firstTag.default_hotwords;+ }+ if (firstTag.default_initial_prompt) {+ uploadInitialPrompt.value = firstTag.default_initial_prompt;+ }+ }};const pollInboxRecordings = async () => {diff --git a/static/js/modules/composables/upload.js b/static/js/modules/composables/upload.jsindex bda4e705..45b5d7df 100644--- a/static/js/modules/composables/upload.js+++ b/static/js/modules/composables/upload.js@@ -34,7 +34,7 @@ export function useUpload(state, utils) {isProcessingActive, pollInterval, progressPopupMinimized, progressPopupClosed,maxFileSizeMB, chunkingEnabled, chunkingMode, chunkingLimit, maxConcurrentUploads,recordings, selectedRecording, totalRecordings, globalError,- selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers,+ selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers, uploadHotwords, uploadInitialPrompt,useAsrEndpoint, connectorSupportsDiarization, asrLanguage, asrMinSpeakers, asrMaxSpeakers,dragover, availableTags, uploadTagSearchFilter,// Folder state@@ -253,7 +253,9 @@ export function useUpload(state, utils) {item.asrOptions = {language: asrLanguage.value,min_speakers: asrMinSpeakers.value,- max_speakers: asrMaxSpeakers.value+ max_speakers: asrMaxSpeakers.value,+ hotwords: uploadHotwords.value,+ initial_prompt: uploadInitialPrompt.value,};item.folder_id = selectedFolderId.value;}@@ -363,6 +365,16 @@ export function useUpload(state, utils) {}}+ // Add hotwords and initial prompt+ const hotwords = asrOpts.hotwords || uploadHotwords.value;+ const initialPrompt = asrOpts.initial_prompt || uploadInitialPrompt.value;+ if (hotwords && hotwords.trim()) {+ formData.append('hotwords', hotwords.trim());+ }+ if (initialPrompt && initialPrompt.trim()) {+ formData.append('initial_prompt', initialPrompt.trim());+ }+// Use XMLHttpRequest for per-file upload progressconst data = await new Promise((resolve, reject) => {const xhr = new XMLHttpRequest();@@ -544,6 +556,15 @@ export function useUpload(state, utils) {uploadMaxSpeakers.value = firstTag.default_max_speakers;}}+ // Apply hotwords/initial_prompt from first tag (works for all connectors)+ if (firstTag) {+ if (firstTag.default_hotwords) {+ uploadHotwords.value = firstTag.default_hotwords;+ }+ if (firstTag.default_initial_prompt) {+ uploadInitialPrompt.value = firstTag.default_initial_prompt;+ }+ }};// Computed property for filtered available tags in upload view@@ -606,6 +627,15 @@ export function useUpload(state, utils) {formData.append('max_speakers', maxSpeakers.toString());}+ const hotwords = asrOpts.hotwords || uploadHotwords.value;+ const initialPrompt = asrOpts.initial_prompt || uploadInitialPrompt.value;+ if (hotwords && hotwords.trim()) {+ formData.append('hotwords', hotwords.trim());+ }+ if (initialPrompt && initialPrompt.trim()) {+ formData.append('initial_prompt', initialPrompt.trim());+ }+// Request auto-summarizationformData.append('auto_summarize', 'true');diff --git a/static/js/modules/state/upload.js b/static/js/modules/state/upload.jsindex c7932218..f7fa2762 100644--- a/static/js/modules/state/upload.js+++ b/static/js/modules/state/upload.js@@ -27,6 +27,8 @@ export function createUploadState(ref, computed) {const uploadLanguage = ref('');const uploadMinSpeakers = ref('');const uploadMaxSpeakers = ref('');+ const uploadHotwords = ref('');+ const uploadInitialPrompt = ref('');// --- Computed Properties ---const totalInQueue = computed(() => uploadQueue.value.length);@@ -61,6 +63,8 @@ export function createUploadState(ref, computed) {uploadLanguage,uploadMinSpeakers,uploadMaxSpeakers,+ uploadHotwords,+ uploadInitialPrompt,// ComputedtotalInQueue,diff --git a/templates/account.html b/templates/account.htmlindex 3584822e..1bd9bf18 100644--- a/templates/account.html+++ b/templates/account.html@@ -777,8 +777,46 @@</div></details></div>++ <!-- Transcription Hints Section -->+ <div class="mt-8 pt-6 border-t border-[var(--border-secondary)]">+ <h3 class="text-base font-semibold text-[var(--text-primary)] mb-1">+ <i class="fas fa-spell-check mr-2 text-[var(--text-accent)]"></i>+ Transcription Hints+ </h3>+ <p class="text-xs text-[var(--text-muted)] mb-4">+ These defaults are used when no tag or folder overrides are set. They help improve recognition of domain-specific terms.+ </p>++ <div class="space-y-4">+ <div>+ <label for="transcription_hotwords" class="block text-sm font-medium text-[var(--text-muted)] mb-1">+ Default Hotwords+ </label>+ <input type="text" name="transcription_hotwords" id="transcription_hotwords"+ value="{{ current_user.transcription_hotwords or '' }}"+ placeholder="e.g., Speakr, CTranslate2, PyAnnote, SDRs"+ class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-[var(--border-focus)] focus:border-[var(--border-focus)] sm:text-sm bg-[var(--bg-input)] text-[var(--text-primary)]">+ <p class="text-xs text-[var(--text-light)] mt-1">+ Comma-separated words or phrases that the transcription model should prioritize recognizing (brand names, acronyms, technical terms).+ </p>+ </div>++ <div>+ <label for="transcription_initial_prompt" class="block text-sm font-medium text-[var(--text-muted)] mb-1">+ Default Initial Prompt+ </label>+ <textarea name="transcription_initial_prompt" id="transcription_initial_prompt" rows="2"+ placeholder="e.g., This is a meeting about AI transcription tools and speech recognition."+ class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-[var(--border-focus)] focus:border-[var(--border-focus)] sm:text-sm bg-[var(--bg-input)] text-[var(--text-primary)]">{{ current_user.transcription_initial_prompt or '' }}</textarea>+ <p class="text-xs text-[var(--text-light)] mt-1">+ Context to steer the transcription model's style and vocabulary. Describe the topic or expected content of your recordings.+ </p>+ </div>+ </div>+ </div></div>-+<div class="flex justify-end"><button type="submit" class="inline-flex items-center px-4 py-2 bg-[var(--bg-button)] text-[var(--text-button)] rounded-md hover:bg-[var(--bg-button-hover)] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[var(--border-focus)] transition-colors duration-200"><i class="fas fa-save mr-2"></i> <span data-i18n="buttons.saveSettings">Save Settings</span>@@ -1989,16 +2027,17 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co<h3 id="tagModalTitle" class="text-xl font-semibold text-[var(--text-primary)]" data-i18n="editTagModal.createTitle">Create Tag</h3><button id="closeTagModalBtn" class="text-[var(--text-light)] hover:text-[var(--text-muted)] text-2xl leading-none">×</button></div>-+<form id="tagForm" class="space-y-4"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/><input type="hidden" id="tagId" name="tag_id">-++ <!-- Name and Color (always visible, outside tabs) --><div><label for="tagName" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.tagName">Tag Name *</label><input type="text" id="tagName" name="name" required maxlength="50" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., Meetings, Interviews"></div>-+<div><label for="tagColor" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.color">Color</label><div class="flex items-center space-x-3">@@ -2006,145 +2045,145 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co<span class="text-sm text-[var(--text-muted)]" data-i18n="editTagModal.colorDescription">Choose a color for easy identification</span></div></div>-- <div>- <label for="tagCustomPrompt" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.customPrompt">Custom Summary Prompt</label>- <textarea id="tagCustomPrompt" name="custom_prompt" rows="4" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Optional: Custom prompt for generating summaries for recordings with this tag" data-i18n-placeholder="editTagModal.customPromptPlaceholder"></textarea>- <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.leaveBlankPrompt">Leave blank to use your default summary prompt</p>- </div>-- <!-- Naming Template Selection -->- <div>- <label for="tagNamingTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.namingTemplate">Naming Template</label>- <select id="tagNamingTemplate" name="naming_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="" data-i18n="editTagModal.noNamingTemplate">No template (use user default or AI title)</option>- <!-- Naming template options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.namingTemplateHint">Select a naming template to automatically format titles for recordings with this tag</p>- </div>- <!-- Export Template Selection -->- {% if enable_auto_export %}- <div>- <label for="tagExportTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.exportTemplate">Export Template</label>- <select id="tagExportTemplate" name="export_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="" data-i18n="editTagModal.noExportTemplate">No template (use user default)</option>- <!-- Export template options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.exportTemplateHint">Select an export template to use when exporting recordings with this tag</p>- </div>- {% endif %}-- <!-- Group Selection (only shown if internal sharing is enabled and user is admin of some groups) -->- <div id="tagGroupSelectionSection" class="hidden">- <label for="tagGroupId" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Group Assignment (Optional)</label>- <select id="tagGroupId" name="group_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="">Personal Tag (Not Associated with a Group)</option>- <!-- Group options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1">- Assign this tag to a group to enable auto-sharing when applied to recordings- </p>+ <!-- Tab Navigation -->+ <div class="border-b border-[var(--border-primary)]">+ <nav class="flex -mb-px space-x-1" id="tagModalTabs">+ <button type="button" class="tag-modal-tab active px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-[var(--border-focus)] text-[var(--text-accent)]" data-tab="tagTabTranscription">+ <i class="fas fa-microphone mr-1"></i>Transcription+ </button>+ <button type="button" class="tag-modal-tab px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]" data-tab="tagTabSummary">+ <i class="fas fa-file-alt mr-1"></i>Summary & Templates+ </button>+ <button type="button" id="tagTabSharingBtn" class="tag-modal-tab px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)] hidden" data-tab="tagTabSharing">+ <i class="fas fa-users mr-1"></i>Sharing+ </button>+ </nav></div>- <!-- Group-Specific Settings (only shown when a group is selected) -->- <div id="tagGroupSettingsSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">- <i class="fas fa-users mr-2"></i>Group Sharing Settings- </h4>-- <div class="space-y-3">- <div class="flex items-start space-x-3">- <input type="checkbox" id="tagAutoShareOnApply" name="auto_share_on_apply" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="tagAutoShareOnApply" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-share-alt mr-1"></i>- Auto-share recordings with all group members when this tag is applied- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- All group members will automatically get access to recordings with this tag- </p>+ <!-- Tab: Transcription & Retention -->+ <div id="tagTabTranscription" class="tag-modal-tab-content space-y-4">+ {% if connector_supports_diarization %}+ <div>+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3" data-i18n="editTagModal.asrDefaultSettings">Transcription Default Settings</h4>+ <div class="space-y-3">+ <div>+ <label for="tagLanguage" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.defaultLanguage">Default Language</label>+ <input type="text" id="tagLanguage" name="default_language" maxlength="10" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., en, es, zh"></div>- </div>-- <div class="flex items-start space-x-3">- <input type="checkbox" id="tagShareWithGroupLead" name="share_with_group_lead" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="tagShareWithGroupLead" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-user-shield mr-1"></i>- Share recordings with group admins only when this tag is applied- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- Only group admins will get access (not all members)- </p>+ <div class="grid grid-cols-2 gap-3">+ <div>+ <label for="tagMinSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.minSpeakers">Min Speakers</label>+ <input type="number" id="tagMinSpeakers" name="default_min_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ </div>+ <div>+ <label for="tagMaxSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.maxSpeakers">Max Speakers</label>+ <input type="number" id="tagMaxSpeakers" name="default_max_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ </div></div></div></div>- <p class="text-xs text-[var(--text-light)] italic mt-3">- Note: If both are enabled, all group members will have access. If only "group admins" is enabled, only group leads will have access.- </p>- </div>+ {% endif %}- <!-- Retention Period Override (only shown when auto-deletion is enabled) -->- <div id="tagRetentionSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">- <i class="fas fa-clock mr-2"></i>Retention & Auto-Deletion Settings- </h4>-- <div class="space-y-3">- <!-- Retention Period Override -->- <div id="tagRetentionDaysContainer">- <label for="tagRetentionDays" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">- Retention Period (days)- </label>- <input type="number" id="tagRetentionDays" name="retention_days" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Leave empty to use global retention">- <p class="text-xs text-[var(--text-light)] mt-1">- Leave empty to use global retention period. Set a custom value to override for recordings with this tag.- </p>- </div>+ <!-- Hotwords & Initial Prompt -->+ <div>+ <label for="tagHotwords" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Hotwords</label>+ <input type="text" id="tagHotwords" name="default_hotwords" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., Speakr, CTranslate2, PyAnnote">+ <p class="text-xs text-[var(--text-light)] mt-1">Comma-separated words to improve recognition of domain-specific terms</p>+ </div>+ <div>+ <label for="tagInitialPrompt" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Initial Prompt</label>+ <textarea id="tagInitialPrompt" name="default_initial_prompt" rows="2" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., This is a meeting about AI transcription tools."></textarea>+ <p class="text-xs text-[var(--text-light)] mt-1">Context to steer the transcription model's style and vocabulary</p>+ </div>- <!-- Deletion Protection Checkbox -->- <div class="flex items-start space-x-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-md">- <input type="checkbox" id="tagProtectFromDeletion" class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="tagProtectFromDeletion" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-shield-alt mr-1 text-yellow-600 dark:text-yellow-400"></i>- Protect from Auto-Deletion (Infinite Retention)- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- Recordings with this tag will never be automatically deleted. When enabled, retention period is set to infinite.- </p>+ <!-- Retention Period Override (only shown when auto-deletion is enabled) -->+ <div id="tagRetentionSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-2">+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">+ <i class="fas fa-clock mr-2"></i>Retention & Auto-Deletion+ </h4>+ <div class="space-y-3">+ <div id="tagRetentionDaysContainer">+ <label for="tagRetentionDays" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Retention Period (days)</label>+ <input type="number" id="tagRetentionDays" name="retention_days" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Leave empty to use global retention">+ <p class="text-xs text-[var(--text-light)] mt-1">Leave empty to use global retention period.</p>+ </div>+ <div class="flex items-start space-x-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-md">+ <input type="checkbox" id="tagProtectFromDeletion" class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="tagProtectFromDeletion" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-shield-alt mr-1 text-yellow-600 dark:text-yellow-400"></i>+ Protect from Auto-Deletion (Infinite Retention)+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">Recordings with this tag will never be automatically deleted.</p>+ </div></div></div></div></div>- {% if connector_supports_diarization %}- <div class="border-t border-[var(--border-primary)] pt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3" data-i18n="editTagModal.asrDefaultSettings">Diarization Default Settings</h4>- <p class="text-xs text-[var(--text-light)] mb-3" data-i18n="editTagModal.asrSettingsDescription">These settings will be applied by default when using this tag with diarization-enabled transcription</p>-- <div class="space-y-3">- <div>- <label for="tagLanguage" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.defaultLanguage">Default Language</label>- <input type="text" id="tagLanguage" name="default_language" maxlength="10" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., en, es, zh">- </div>-- <div class="grid grid-cols-2 gap-3">- <div>- <label for="tagMinSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.minSpeakers">Min Speakers</label>- <input type="number" id="tagMinSpeakers" name="default_min_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <!-- Tab: Summary & Templates -->+ <div id="tagTabSummary" class="tag-modal-tab-content space-y-4 hidden">+ <div>+ <label for="tagCustomPrompt" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.customPrompt">Custom Summary Prompt</label>+ <textarea id="tagCustomPrompt" name="custom_prompt" rows="4" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Optional: Custom prompt for generating summaries for recordings with this tag" data-i18n-placeholder="editTagModal.customPromptPlaceholder"></textarea>+ <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.leaveBlankPrompt">Leave blank to use your default summary prompt</p>+ </div>+ <div>+ <label for="tagNamingTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.namingTemplate">Naming Template</label>+ <select id="tagNamingTemplate" name="naming_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="" data-i18n="editTagModal.noNamingTemplate">No template (use user default or AI title)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.namingTemplateHint">Select a naming template to automatically format titles for recordings with this tag</p>+ </div>+ {% if enable_auto_export %}+ <div>+ <label for="tagExportTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1" data-i18n="editTagModal.exportTemplate">Export Template</label>+ <select id="tagExportTemplate" name="export_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="" data-i18n="editTagModal.noExportTemplate">No template (use user default)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1" data-i18n="editTagModal.exportTemplateHint">Select an export template to use when exporting recordings with this tag</p>+ </div>+ {% endif %}+ </div>++ <!-- Tab: Sharing -->+ <div id="tagTabSharing" class="tag-modal-tab-content space-y-4 hidden">+ <div id="tagGroupSelectionSection" class="hidden">+ <label for="tagGroupId" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Group Assignment (Optional)</label>+ <select id="tagGroupId" name="group_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="">Personal Tag (Not Associated with a Group)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1">Assign this tag to a group to enable auto-sharing when applied to recordings</p>+ </div>+ <div id="tagGroupSettingsSection" class="hidden">+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">+ <i class="fas fa-users mr-2"></i>Group Sharing Settings+ </h4>+ <div class="space-y-3">+ <div class="flex items-start space-x-3">+ <input type="checkbox" id="tagAutoShareOnApply" name="auto_share_on_apply" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="tagAutoShareOnApply" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-share-alt mr-1"></i>Auto-share with all group members+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">All group members will automatically get access to recordings with this tag</p>+ </div></div>-- <div>- <label for="tagMaxSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1" data-i18n="editTagModal.maxSpeakers">Max Speakers</label>- <input type="number" id="tagMaxSpeakers" name="default_max_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <div class="flex items-start space-x-3">+ <input type="checkbox" id="tagShareWithGroupLead" name="share_with_group_lead" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="tagShareWithGroupLead" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-user-shield mr-1"></i>Share with group admins only+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">Only group admins will get access (not all members)</p>+ </div></div></div>+ <p class="text-xs text-[var(--text-light)] italic mt-3">Note: If both are enabled, all group members will have access.</p></div></div>- {% endif %}-+<div class="flex justify-end space-x-3 pt-4 border-t border-[var(--border-primary)]"><button type="button" id="cancelTagBtn" class="px-4 py-2 bg-[var(--bg-tertiary)] text-[var(--text-secondary)] rounded-md hover:bg-[var(--border-secondary)]" data-i18n="buttons.cancel">Cancel</button><button type="submit" id="saveTagBtn" class="px-4 py-2 bg-[var(--bg-button)] text-[var(--text-button)] rounded-md hover:bg-[var(--bg-button-hover)]">@@ -2167,6 +2206,7 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/><input type="hidden" id="folderId" name="folder_id">+ <!-- Name and Color (always visible, outside tabs) --><div><label for="folderName" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Folder Name *</label><input type="text" id="folderName" name="name" required maxlength="50" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., Office Calls, Interviews">@@ -2180,143 +2220,144 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co</div></div>- <div>- <label for="folderCustomPrompt" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Custom Summary Prompt</label>- <textarea id="folderCustomPrompt" name="custom_prompt" rows="4" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Optional: Custom prompt for generating summaries for recordings in this folder"></textarea>- <p class="text-xs text-[var(--text-light)] mt-1">Leave blank to use your default summary prompt. Note: Tag prompts take priority over folder prompts.</p>- </div>-- <!-- Naming Template Selection -->- <div>- <label for="folderNamingTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Naming Template</label>- <select id="folderNamingTemplate" name="naming_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="">No template (use user default or AI title)</option>- <!-- Naming template options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1">Select a naming template to automatically format titles for recordings in this folder</p>- </div>-- <!-- Export Template Selection -->- {% if enable_auto_export %}- <div>- <label for="folderExportTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Export Template</label>- <select id="folderExportTemplate" name="export_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="">No template (use user default)</option>- <!-- Export template options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1">Select an export template to use when exporting recordings in this folder</p>- </div>- {% endif %}-- <!-- Group Selection (only shown if internal sharing is enabled and user is admin of some groups) -->- <div id="folderGroupSelectionSection" class="hidden">- <label for="folderGroupId" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Group Assignment (Optional)</label>- <select id="folderGroupId" name="group_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">- <option value="">Personal Folder (Not Associated with a Group)</option>- <!-- Group options will be populated dynamically -->- </select>- <p class="text-xs text-[var(--text-light)] mt-1">- Assign this folder to a group to enable auto-sharing when recordings are moved to it- </p>+ <!-- Tab Navigation -->+ <div class="border-b border-[var(--border-primary)]">+ <nav class="flex -mb-px space-x-1" id="folderModalTabs">+ <button type="button" class="folder-modal-tab active px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-[var(--border-focus)] text-[var(--text-accent)]" data-tab="folderTabTranscription">+ <i class="fas fa-microphone mr-1"></i>Transcription+ </button>+ <button type="button" class="folder-modal-tab px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]" data-tab="folderTabSummary">+ <i class="fas fa-file-alt mr-1"></i>Summary & Templates+ </button>+ <button type="button" id="folderTabSharingBtn" class="folder-modal-tab px-3 py-2 text-xs font-medium rounded-t-md border-b-2 border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)] hidden" data-tab="folderTabSharing">+ <i class="fas fa-users mr-1"></i>Sharing+ </button>+ </nav></div>- <!-- Group-Specific Settings (only shown when a group is selected) -->- <div id="folderGroupSettingsSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">- <i class="fas fa-users mr-2"></i>Group Sharing Settings- </h4>-- <div class="space-y-3">- <div class="flex items-start space-x-3">- <input type="checkbox" id="folderAutoShareOnApply" name="auto_share_on_apply" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="folderAutoShareOnApply" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-share-alt mr-1"></i>- Auto-share recordings with all group members when moved to this folder- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- All group members will automatically get access to recordings in this folder- </p>+ <!-- Tab: Transcription & Retention -->+ <div id="folderTabTranscription" class="folder-modal-tab-content space-y-4">+ {% if connector_supports_diarization %}+ <div>+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">Transcription Default Settings</h4>+ <p class="text-xs text-[var(--text-light)] mb-3">Tag settings take priority over folder settings</p>+ <div class="space-y-3">+ <div>+ <label for="folderLanguage" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Default Language</label>+ <input type="text" id="folderLanguage" name="default_language" maxlength="10" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., en, es, zh"></div>- </div>-- <div class="flex items-start space-x-3">- <input type="checkbox" id="folderShareWithGroupLead" name="share_with_group_lead" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="folderShareWithGroupLead" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-user-shield mr-1"></i>- Share recordings with group admins only when moved to this folder- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- Only group admins will get access (not all members)- </p>+ <div class="grid grid-cols-2 gap-3">+ <div>+ <label for="folderMinSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Min Speakers</label>+ <input type="number" id="folderMinSpeakers" name="default_min_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ </div>+ <div>+ <label for="folderMaxSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Max Speakers</label>+ <input type="number" id="folderMaxSpeakers" name="default_max_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ </div></div></div></div>- <p class="text-xs text-[var(--text-light)] italic mt-3">- Note: If both are enabled, all group members will have access. If only "group admins" is enabled, only group leads will have access.- </p>- </div>+ {% endif %}- <!-- Retention Period Override (only shown when auto-deletion is enabled) -->- <div id="folderRetentionSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">- <i class="fas fa-clock mr-2"></i>Retention & Auto-Deletion Settings- </h4>-- <div class="space-y-3">- <!-- Retention Period Override -->- <div id="folderRetentionDaysContainer">- <label for="folderRetentionDays" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">- Retention Period (days)- </label>- <input type="number" id="folderRetentionDays" name="retention_days" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Leave empty to use global retention">- <p class="text-xs text-[var(--text-light)] mt-1">- Leave empty to use global retention period. Set a custom value to override for recordings in this folder.- </p>- </div>+ <!-- Hotwords & Initial Prompt -->+ <div>+ <label for="folderHotwords" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Hotwords</label>+ <input type="text" id="folderHotwords" name="default_hotwords" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., Speakr, CTranslate2, PyAnnote">+ <p class="text-xs text-[var(--text-light)] mt-1">Comma-separated words to improve recognition of domain-specific terms</p>+ </div>+ <div>+ <label for="folderInitialPrompt" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Initial Prompt</label>+ <textarea id="folderInitialPrompt" name="default_initial_prompt" rows="2" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., This is a meeting about AI transcription tools."></textarea>+ <p class="text-xs text-[var(--text-light)] mt-1">Context to steer the transcription model's style and vocabulary</p>+ </div>- <!-- Deletion Protection Checkbox -->- <div class="flex items-start space-x-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-md">- <input type="checkbox" id="folderProtectFromDeletion" class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">- <div class="flex-1">- <label for="folderProtectFromDeletion" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">- <i class="fas fa-shield-alt mr-1 text-yellow-600 dark:text-yellow-400"></i>- Protect from Auto-Deletion (Infinite Retention)- </label>- <p class="text-xs text-[var(--text-light)] mt-1">- Recordings in this folder will never be automatically deleted. When enabled, retention period is set to infinite.- </p>+ <!-- Retention Period Override (only shown when auto-deletion is enabled) -->+ <div id="folderRetentionSection" class="hidden border-t border-[var(--border-primary)] pt-4 mt-2">+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">+ <i class="fas fa-clock mr-2"></i>Retention & Auto-Deletion+ </h4>+ <div class="space-y-3">+ <div id="folderRetentionDaysContainer">+ <label for="folderRetentionDays" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Retention Period (days)</label>+ <input type="number" id="folderRetentionDays" name="retention_days" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Leave empty to use global retention">+ <p class="text-xs text-[var(--text-light)] mt-1">Leave empty to use global retention period.</p>+ </div>+ <div class="flex items-start space-x-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-md">+ <input type="checkbox" id="folderProtectFromDeletion" class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="folderProtectFromDeletion" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-shield-alt mr-1 text-yellow-600 dark:text-yellow-400"></i>+ Protect from Auto-Deletion (Infinite Retention)+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">Recordings in this folder will never be automatically deleted.</p>+ </div></div></div></div></div>- {% if connector_supports_diarization %}- <div class="border-t border-[var(--border-primary)] pt-4">- <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">Diarization Default Settings</h4>- <p class="text-xs text-[var(--text-light)] mb-3">These settings will be applied by default when uploading to this folder (tag settings take priority)</p>-- <div class="space-y-3">- <div>- <label for="folderLanguage" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Default Language</label>- <input type="text" id="folderLanguage" name="default_language" maxlength="10" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="e.g., en, es, zh">- </div>+ <!-- Tab: Summary & Templates -->+ <div id="folderTabSummary" class="folder-modal-tab-content space-y-4 hidden">+ <div>+ <label for="folderCustomPrompt" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Custom Summary Prompt</label>+ <textarea id="folderCustomPrompt" name="custom_prompt" rows="4" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]" placeholder="Optional: Custom prompt for generating summaries for recordings in this folder"></textarea>+ <p class="text-xs text-[var(--text-light)] mt-1">Leave blank to use your default summary prompt. Tag prompts take priority over folder prompts.</p>+ </div>+ <div>+ <label for="folderNamingTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Naming Template</label>+ <select id="folderNamingTemplate" name="naming_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="">No template (use user default or AI title)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1">Select a naming template to automatically format titles for recordings in this folder</p>+ </div>+ {% if enable_auto_export %}+ <div>+ <label for="folderExportTemplate" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Export Template</label>+ <select id="folderExportTemplate" name="export_template_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="">No template (use user default)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1">Select an export template to use when exporting recordings in this folder</p>+ </div>+ {% endif %}+ </div>- <div class="grid grid-cols-2 gap-3">- <div>- <label for="folderMinSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Min Speakers</label>- <input type="number" id="folderMinSpeakers" name="default_min_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <!-- Tab: Sharing -->+ <div id="folderTabSharing" class="folder-modal-tab-content space-y-4 hidden">+ <div id="folderGroupSelectionSection" class="hidden">+ <label for="folderGroupId" class="block text-sm font-medium text-[var(--text-secondary)] mb-1">Group Assignment (Optional)</label>+ <select id="folderGroupId" name="group_id" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <option value="">Personal Folder (Not Associated with a Group)</option>+ </select>+ <p class="text-xs text-[var(--text-light)] mt-1">Assign this folder to a group to enable auto-sharing when recordings are moved to it</p>+ </div>+ <div id="folderGroupSettingsSection" class="hidden">+ <h4 class="text-sm font-medium text-[var(--text-secondary)] mb-3">+ <i class="fas fa-users mr-2"></i>Group Sharing Settings+ </h4>+ <div class="space-y-3">+ <div class="flex items-start space-x-3">+ <input type="checkbox" id="folderAutoShareOnApply" name="auto_share_on_apply" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="folderAutoShareOnApply" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-share-alt mr-1"></i>Auto-share with all group members+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">All group members will automatically get access to recordings in this folder</p>+ </div></div>-- <div>- <label for="folderMaxSpeakers" class="block text-sm font-medium text-[var(--text-muted)] mb-1">Max Speakers</label>- <input type="number" id="folderMaxSpeakers" name="default_max_speakers" min="1" class="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] bg-[var(--bg-input)] text-[var(--text-primary)]">+ <div class="flex items-start space-x-3">+ <input type="checkbox" id="folderShareWithGroupLead" name="share_with_group_lead" checked class="mt-1 h-4 w-4 text-[var(--bg-accent)] border-gray-300 rounded focus:ring-[var(--border-focus)]">+ <div class="flex-1">+ <label for="folderShareWithGroupLead" class="block text-sm font-medium text-[var(--text-secondary)] cursor-pointer">+ <i class="fas fa-user-shield mr-1"></i>Share with group admins only+ </label>+ <p class="text-xs text-[var(--text-light)] mt-1">Only group admins will get access (not all members)</p>+ </div></div></div>+ <p class="text-xs text-[var(--text-light)] italic mt-3">Note: If both are enabled, all group members will have access.</p></div></div>- {% endif %}<div class="flex justify-end space-x-3 pt-4 border-t border-[var(--border-primary)]"><button type="button" id="cancelFolderBtn" class="px-4 py-2 bg-[var(--bg-tertiary)] text-[var(--text-secondary)] rounded-md hover:bg-[var(--border-secondary)]">Cancel</button>@@ -4182,8 +4223,51 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</coconst timeoutId = setTimeout(dismissToast, 3000);}+ // ===== MODAL TAB SWITCHING =====+ function switchModalTab(navId, tabClass, contentClass, targetTabId) {+ const nav = document.getElementById(navId);+ if (!nav) return;+ // Update tab buttons+ nav.querySelectorAll('.' + tabClass).forEach(btn => {+ if (btn.dataset.tab === targetTabId) {+ btn.classList.add('active', 'border-[var(--border-focus)]', 'text-[var(--text-accent)]');+ btn.classList.remove('border-transparent', 'text-[var(--text-muted)]');+ } else {+ btn.classList.remove('active', 'border-[var(--border-focus)]', 'text-[var(--text-accent)]');+ btn.classList.add('border-transparent', 'text-[var(--text-muted)]');+ }+ });+ // Show/hide tab content+ document.querySelectorAll('.' + contentClass).forEach(panel => {+ panel.classList.toggle('hidden', panel.id !== targetTabId);+ });+ }++ // Attach tab click handlers for tag modal+ document.getElementById('tagModalTabs')?.addEventListener('click', function(e) {+ const btn = e.target.closest('.tag-modal-tab');+ if (btn && btn.dataset.tab) {+ switchModalTab('tagModalTabs', 'tag-modal-tab', 'tag-modal-tab-content', btn.dataset.tab);+ }+ });++ // Attach tab click handlers for folder modal+ document.getElementById('folderModalTabs')?.addEventListener('click', function(e) {+ const btn = e.target.closest('.folder-modal-tab');+ if (btn && btn.dataset.tab) {+ switchModalTab('folderModalTabs', 'folder-modal-tab', 'folder-modal-tab-content', btn.dataset.tab);+ }+ });++ // Show sharing tabs when internal sharing is enabled+ const isInternalSharingForTabs = {{ 'true' if enable_internal_sharing else 'false' }};+ if (isInternalSharingForTabs) {+ document.getElementById('tagTabSharingBtn')?.classList.remove('hidden');+ document.getElementById('folderTabSharingBtn')?.classList.remove('hidden');+ }+// ===== TAG MANAGEMENT FUNCTIONALITY =====-+// Tag management elementsconst createTagBtn = document.getElementById('createTagBtn');const tagModal = document.getElementById('tagModal');@@ -4599,6 +4683,12 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</coif (document.getElementById('tagMaxSpeakers')) {document.getElementById('tagMaxSpeakers').value = tag.default_max_speakers || '';}+ if (document.getElementById('tagHotwords')) {+ document.getElementById('tagHotwords').value = tag.default_hotwords || '';+ }+ if (document.getElementById('tagInitialPrompt')) {+ document.getElementById('tagInitialPrompt').value = tag.default_initial_prompt || '';+ }// Populate naming templateif (document.getElementById('tagNamingTemplate')) {@@ -4662,6 +4752,9 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co// Load export templates for dropdownloadExportTemplatesForTagModal();+ // Reset to first tab+ switchModalTab('tagModalTabs', 'tag-modal-tab', 'tag-modal-tab-content', 'tagTabTranscription');+tagModal.classList.remove('hidden');}@@ -4807,6 +4900,8 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</codefault_language: formData.get('default_language') || null,default_min_speakers: formData.get('default_min_speakers') ? parseInt(formData.get('default_min_speakers')) : null,default_max_speakers: formData.get('default_max_speakers') ? parseInt(formData.get('default_max_speakers')) : null,+ default_hotwords: formData.get('default_hotwords') || null,+ default_initial_prompt: formData.get('default_initial_prompt') || null,retention_days: retentionDays};@@ -5192,6 +5287,10 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</coif (minField) minField.value = folder.default_min_speakers || '';var maxField = document.getElementById('folderMaxSpeakers');if (maxField) maxField.value = folder.default_max_speakers || '';+ var hwField = document.getElementById('folderHotwords');+ if (hwField) hwField.value = folder.default_hotwords || '';+ var ipField = document.getElementById('folderInitialPrompt');+ if (ipField) ipField.value = folder.default_initial_prompt || '';// Group selectionconst folderGroupId = document.getElementById('folderGroupId');@@ -5242,6 +5341,9 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</co// Load export templates for dropdown (pass folder to set initial value)loadExportTemplatesForFolderModal(folder);+ // Reset to first tab+ switchModalTab('folderModalTabs', 'folder-modal-tab', 'folder-modal-tab-content', 'folderTabTranscription');+if (folderModal) folderModal.classList.remove('hidden');}@@ -5402,6 +5504,10 @@ curl "https://your-speakr-instance.com/api/recordings?token=YOUR_TOKEN_HERE"</cofolderData.default_min_speakers = minEl && minEl.value ? parseInt(minEl.value) : null;var maxEl = document.getElementById('folderMaxSpeakers');folderData.default_max_speakers = maxEl && maxEl.value ? parseInt(maxEl.value) : null;+ var hwEl = document.getElementById('folderHotwords');+ folderData.default_hotwords = hwEl ? hwEl.value.trim() || null : null;+ var ipEl = document.getElementById('folderInitialPrompt');+ folderData.default_initial_prompt = ipEl ? ipEl.value.trim() || null : null;var templateEl = document.getElementById('folderNamingTemplate');folderData.naming_template_id = templateEl && templateEl.value ? parseInt(templateEl.value) : null;var exportTemplateEl = document.getElementById('folderExportTemplate');diff --git a/templates/components/upload-view.html b/templates/components/upload-view.htmlindex fafda06b..ee08b977 100644--- a/templates/components/upload-view.html+++ b/templates/components/upload-view.html@@ -317,7 +317,7 @@<i class="fas fa-info-circle mr-1 text-[var(--text-accent)]"></i>Selected tags include custom summary prompts</p>- <p v-if="selectedTags.length > 0 && connectorSupportsDiarization && selectedTags.some(tag => tag.default_language || tag.default_min_speakers || tag.default_max_speakers)"+ <p v-if="selectedTags.length > 0 && connectorSupportsDiarization && selectedTags.some(tag => tag.default_language || tag.default_min_speakers || tag.default_max_speakers || tag.default_hotwords || tag.default_initial_prompt)"class="text-xs text-[var(--text-muted)] mt-1"><i class="fas fa-cog mr-1 text-[var(--text-accent)]"></i>First tag's ASR settings will be applied: ${selectedTags[0].name}@@ -369,6 +369,30 @@</div></div>+ <!-- Hotwords -->+ <div>+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ Hotwords+ </label>+ <input v-model="uploadHotwords"+ type="text"+ placeholder="e.g., Speakr, CTranslate2, PyAnnote"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">Comma-separated words to improve recognition of domain-specific terms</p>+ </div>++ <!-- Initial Prompt -->+ <div>+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ Initial Prompt+ </label>+ <textarea v-model="uploadInitialPrompt"+ rows="2"+ placeholder="e.g., This is a meeting about AI transcription tools."+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">Context to steer the transcription model's style and vocabulary</p>+ </div>+<p class="text-xs text-[var(--text-muted)] pt-1"><i class="fas fa-info-circle mr-1 text-[var(--text-accent)]"></i>Settings apply to all files in this sessiondiff --git a/tests/test_hotwords.sh b/tests/test_hotwords.shnew file mode 100755index 00000000..88cb69b6--- /dev/null+++ b/tests/test_hotwords.sh@@ -0,0 +1,241 @@+#!/bin/bash+# test_hotwords.sh - Test hotwords and initial_prompt features+#+# Usage:+# ./tests/test_hotwords.sh <asr_url> <audio_file>+# ./tests/test_hotwords.sh http://localhost:9000 temp/Recording\ 4.flac+#+# The audio should contain domain-specific words that Whisper tends to+# misspell (brand names, acronyms, unusual proper nouns). The script runs+# three transcriptions and compares the results.++set -euo pipefail++ASR_URL="${1:-http://localhost:9000}"+AUDIO_FILE="${2:-temp/Recording 4.flac}"+OUTPUT_DIR="temp/hotwords_test_results"++# Colors+GREEN='\033[0;32m'+YELLOW='\033[1;33m'+CYAN='\033[0;36m'+RED='\033[0;31m'+NC='\033[0m' # No Color++# Configurable test values - adjust these for your audio+HOTWORDS="Speakr,CTranslate2,PyAnnote,WhisperX"+INITIAL_PROMPT="This is a meeting about AI-powered audio transcription tools including Speakr, CTranslate2, and PyAnnote."++echo -e "${CYAN}============================================${NC}"+echo -e "${CYAN} Hotwords & Initial Prompt Test Suite${NC}"+echo -e "${CYAN}============================================${NC}"+echo ""+echo -e "ASR URL: ${YELLOW}${ASR_URL}${NC}"+echo -e "Audio file: ${YELLOW}${AUDIO_FILE}${NC}"+echo -e "Hotwords: ${YELLOW}${HOTWORDS}${NC}"+echo -e "Initial prompt: ${YELLOW}${INITIAL_PROMPT}${NC}"+echo ""++# Verify audio file exists+if [ ! -f "$AUDIO_FILE" ]; then+ echo -e "${RED}ERROR: Audio file not found: ${AUDIO_FILE}${NC}"+ exit 1+fi++# Verify ASR endpoint is reachable+echo -n "Checking ASR endpoint... "+if curl -sf "${ASR_URL}/" > /dev/null 2>&1 || curl -sf "${ASR_URL}/health" > /dev/null 2>&1; then+ echo -e "${GREEN}OK${NC}"+else+ echo -e "${RED}FAILED${NC}"+ echo "Cannot reach ASR endpoint at ${ASR_URL}"+ exit 1+fi++# Create output directory+mkdir -p "$OUTPUT_DIR"++# ==============================================================+# Test 1: Baseline (no hints)+# ==============================================================+echo ""+echo -e "${CYAN}--- Test 1: Baseline (no hotwords, no initial_prompt) ---${NC}"+echo -n "Transcribing... "++BASELINE_FILE="$OUTPUT_DIR/1_baseline.json"+curl -sS -X POST "${ASR_URL}/asr?output=json&task=transcribe" \+ -F "audio_file=@${AUDIO_FILE}" \+ -o "$BASELINE_FILE"++BASELINE_TEXT=$(python3 -c "+import json+d=json.load(open('$BASELINE_FILE'))+t=d.get('text','')+if isinstance(t, list):+ t=' '.join(seg.get('text','') for seg in t)+print(t[:500])+" 2>/dev/null || echo "PARSE_ERROR")+echo -e "${GREEN}Done${NC}"+echo -e "Preview: ${BASELINE_TEXT:0:200}..."+echo ""++# ==============================================================+# Test 2: With hotwords only+# ==============================================================+echo -e "${CYAN}--- Test 2: With hotwords ---${NC}"+echo -n "Transcribing... "++HOTWORDS_FILE="$OUTPUT_DIR/2_with_hotwords.json"+curl -sS -X POST "${ASR_URL}/asr?output=json&task=transcribe&hotwords=${HOTWORDS}" \+ -F "audio_file=@${AUDIO_FILE}" \+ -o "$HOTWORDS_FILE"++HOTWORDS_TEXT=$(python3 -c "+import json+d=json.load(open('$HOTWORDS_FILE'))+t=d.get('text','')+if isinstance(t, list):+ t=' '.join(seg.get('text','') for seg in t)+print(t[:500])+" 2>/dev/null || echo "PARSE_ERROR")+echo -e "${GREEN}Done${NC}"+echo -e "Preview: ${HOTWORDS_TEXT:0:200}..."+echo ""++# ==============================================================+# Test 3: With hotwords + initial_prompt+# ==============================================================+echo -e "${CYAN}--- Test 3: With hotwords + initial_prompt ---${NC}"+echo -n "Transcribing... "++BOTH_FILE="$OUTPUT_DIR/3_with_both.json"+ENCODED_PROMPT=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$INITIAL_PROMPT'))")+curl -sS -X POST "${ASR_URL}/asr?output=json&task=transcribe&hotwords=${HOTWORDS}&initial_prompt=${ENCODED_PROMPT}" \+ -F "audio_file=@${AUDIO_FILE}" \+ -o "$BOTH_FILE"++BOTH_TEXT=$(python3 -c "+import json+d=json.load(open('$BOTH_FILE'))+t=d.get('text','')+if isinstance(t, list):+ t=' '.join(seg.get('text','') for seg in t)+print(t[:500])+" 2>/dev/null || echo "PARSE_ERROR")+echo -e "${GREEN}Done${NC}"+echo -e "Preview: ${BOTH_TEXT:0:200}..."+echo ""++# ==============================================================+# Test 4: With initial_prompt only+# ==============================================================+echo -e "${CYAN}--- Test 4: With initial_prompt only ---${NC}"+echo -n "Transcribing... "++PROMPT_FILE="$OUTPUT_DIR/4_with_initial_prompt.json"+curl -sS -X POST "${ASR_URL}/asr?output=json&task=transcribe&initial_prompt=${ENCODED_PROMPT}" \+ -F "audio_file=@${AUDIO_FILE}" \+ -o "$PROMPT_FILE"++PROMPT_TEXT=$(python3 -c "+import json+d=json.load(open('$PROMPT_FILE'))+t=d.get('text','')+if isinstance(t, list):+ t=' '.join(seg.get('text','') for seg in t)+print(t[:500])+" 2>/dev/null || echo "PARSE_ERROR")+echo -e "${GREEN}Done${NC}"+echo -e "Preview: ${PROMPT_TEXT:0:200}..."+echo ""++# ==============================================================+# Comparison+# ==============================================================+echo -e "${CYAN}============================================${NC}"+echo -e "${CYAN} Comparison Results${NC}"+echo -e "${CYAN}============================================${NC}"+echo ""++# Check if hotwords appear in outputs+python3 << 'PYEOF'+import json+import os++def extract_text(data):+ """Extract full text from ASR response, handling both string and segment list formats."""+ text = data.get("text", "")+ if isinstance(text, list):+ return " ".join(seg.get("text", "") for seg in text)+ return text++hotwords = ["Speakr", "CTranslate2", "PyAnnote", "WhisperX"]+output_dir = os.environ.get("OUTPUT_DIR", "temp/hotwords_test_results")+test_files = {+ "1. Baseline": f"{output_dir}/1_baseline.json",+ "2. Hotwords only": f"{output_dir}/2_with_hotwords.json",+ "3. Hotwords + prompt": f"{output_dir}/3_with_both.json",+ "4. Initial prompt only": f"{output_dir}/4_with_initial_prompt.json",+}++print(f"{'Test':<25} | {'Hotword Matches':<20} | {'Words Found'}")+print("-" * 75)++for label, filepath in test_files.items():+ try:+ with open(filepath) as f:+ data = json.load(f)+ text = extract_text(data)+ found = []+ for hw in hotwords:+ if hw.lower() in text.lower():+ found.append(hw)+ match_str = f"{len(found)}/{len(hotwords)}"+ found_str = ", ".join(found) if found else "(none)"+ print(f"{label:<25} | {match_str:<20} | {found_str}")+ except Exception as e:+ print(f"{label:<25} | ERROR: {e}")++print()+print("Full outputs saved to: " + output_dir)+PYEOF++echo ""+echo -e "${CYAN}============================================${NC}"+echo -e "${CYAN} Precedence Test via Speakr API${NC}"+echo -e "${CYAN}============================================${NC}"+echo ""+echo -e "${YELLOW}To test the full precedence chain (user → folder → tag → upload form),${NC}"+echo -e "${YELLOW}use the Speakr web API with authentication:${NC}"+echo ""+echo -e "1. Set user-level defaults in Account Settings → Prompt Options"+echo -e "2. Create a tag with different hotwords/initial_prompt"+echo -e "3. Create a folder with different hotwords/initial_prompt"+echo -e "4. Upload via API and check server logs for resolved values:"+echo ""+cat << 'EXAMPLE'+# Upload with user defaults only (no tag, no folder)+curl -X POST "https://your-speakr/upload" \+ -H "Authorization: Bearer YOUR_TOKEN" \+ -F "[email protected]"+# → Should use user defaults++# Upload with a tag that has hotwords set+curl -X POST "https://your-speakr/upload" \+ -H "Authorization: Bearer YOUR_TOKEN" \+ -F "[email protected]" \+ -F "tags=TAG_ID_WITH_HOTWORDS"+# → Should use tag defaults (overrides user)++# Upload with explicit form values (highest priority)+curl -X POST "https://your-speakr/upload" \+ -H "Authorization: Bearer YOUR_TOKEN" \+ -F "[email protected]" \+ -F "tags=TAG_ID_WITH_HOTWORDS" \+ -F "hotwords=FormOverride1,FormOverride2" \+ -F "initial_prompt=Form level prompt"+# → Should use form values (overrides tag and user)+EXAMPLE++echo ""+echo -e "${GREEN}Test complete!${NC}"