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:
yusufipk
2026-06-12 22:56:36 +02:00
parent 6cd555ed16
commit c8f36c9c25
2 changed files with 27 additions and 7 deletions
+1 -6
View File
@@ -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');