mirror of
https://github.com/yusufipk/better-ai-srt-translation.git
synced 2026-09-11 10:56:18 +00:00
Fix provider selection bug and polish PR before merge.
Define provider in startTranslation, restore README screenshot, document optional pre-processing and provider behavior, and remove leftover debug logging.
This commit is contained in:
+1
-6
@@ -638,6 +638,7 @@ async function startTranslation() {
|
||||
if (!apiKey || !srtContent) return;
|
||||
|
||||
// Get settings
|
||||
const provider = elements.apiProvider.value;
|
||||
const defaultModel = provider === 'openrouter' ? DEFAULT_MODEL_OPENROUTER : DEFAULT_MODEL_GEMINI;
|
||||
const model = elements.customModel.value.trim() || defaultModel;
|
||||
const targetLanguage = elements.targetLanguage.value;
|
||||
@@ -680,12 +681,6 @@ async function startTranslation() {
|
||||
const blockCount = chunk.length;
|
||||
const textLength = chunk.reduce((sum, b) => sum + b.text.join(' ').length, 0);
|
||||
|
||||
// Debug for problematic chunks
|
||||
if (index === 107) {
|
||||
log(`⚠️ CHUNK 108 DEBUG: ${blockCount} blocks, ${textLength} chars`, 'error');
|
||||
console.log('Chunk 108 content:', chunk);
|
||||
}
|
||||
|
||||
try {
|
||||
log(`Chunk ${index + 1} starting (${blockCount} blocks, ${textLength} chars)...`, 'info');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user