{"record":{"id":"be34a50839bab202","repo":"tonhowtf/omniget","slug":"nenhum-coment-rio-cai-entre-1-s-e-1-s","errorCode":null,"errorMessage":"nenhum comentário cai entre {:.1}s e {:.1}s","messagePattern":"nenhum comentário cai entre (.+?)s e (.+?)s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src-tauri/src/platforms/bilibili/danmaku/burn.rs","lineNumber":115,"sourceCode":"        opts.duration\n    } else {\n        (probe.duration_seconds - start).max(0.0)\n    };\n    if window <= 0.0 {\n        return Err(anyhow!(\n            \"a janela de corte ficou vazia — o vídeo tem {:.1}s\",\n            probe.duration_seconds\n        ));\n    }\n\n    let text = read_text(&sub)?;\n    let (body, dialogues) = if is_ass(&sub) {\n        shift_ass(&text, start, window)\n    } else {\n        shift_other(&text, start, window)?\n    };\n    if dialogues == 0 {\n        return Err(anyhow!(\n            \"nenhum comentário cai entre {:.1}s e {:.1}s\",\n            start,\n            start + window\n        ));\n    }\n    let work_dir = omniget_core::core::tools::temp_dir();\n    std::fs::create_dir_all(&work_dir)?;\n    let work = work_dir.join(format!(\"danmaku-{}.ass\", uuid::Uuid::new_v4()));\n    std::fs::write(&work, &body)?;\n\n    let out_dir = if opts.output_dir.trim().is_empty() {\n        video.parent().map(|p| p.to_path_buf()).unwrap_or_default()\n    } else {\n        PathBuf::from(opts.output_dir.trim())\n    };\n    std::fs::create_dir_all(&out_dir)?;\n    let stem = video\n        .file_stem()","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bilibili/danmaku/burn.rs#L97-L133","documentation":"After shifting subtitle timings into the cut window (shift_ass or shift_other), run() counts how many dialogue lines land inside it. If none do, it throws 'nenhum comentário cai entre <start>s e <start+window>s' because burning an empty subtitle track is pointless.","triggerScenarios":"The requested [start, start+window] interval of the video contains zero danmaku comments — either the video genuinely has no comments in that range, or the subtitle timestamps don't overlap the cut.","commonSituations":"Clipping an early segment of a long video before viewers commented; live-stream VOD where danmaku only starts later; wrong subtitle file (from another video/part) whose timeline doesn't overlap the cut; shift_other failed to parse timings so everything was dropped.","solutions":["Pick a time range that actually contains comments (query the danmaku timeline first)","Confirm the subtitle file corresponds to the same video and part as the cut","Decide whether an empty-danmaku clip is acceptable and skip the burn step if so"],"exampleFix":"// before\nburn::run(&BurnOptions { start: 0.0, duration: 5.0, ..opts }) // no comments before 30s\n// after\nlet (start, duration) = danmaku_busy_range(&subtitle, 0.0, 5.0)\n    .unwrap_or((30.0, 10.0)); // fall back to a range with comments\nburn::run(&BurnOptions { start, duration, ..opts })","handlingStrategy":"fallback","validationCode":"// count dialogues overlapping the window before burning\nfn has_comments_in_window(sub_text: &str, start: f64, window: f64) -> bool { /* parse timestamps, check overlap */ }","typeGuard":null,"tryCatchPattern":"match burn::run(&opts, &progress).await {\n    Err(e) if e.to_string().contains(\"nenhum comentário cai\") => Ok(ClipWithoutDanmaku), // proceed without burn\n    Err(e) => propagate(e)?,\n    Ok(res) => use_result(res),\n}","preventionTips":["Inspect the danmaku timeline to choose a range that contains comments","Verify the subtitle file belongs to the same video/part","Treat an empty danmaku clip as a valid outcome instead of an error path"],"tags":["empty-result","subtitle","validation"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}