mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-06 01:22:16 +00:00
refactor(site): one ffmpeg gate instead of a probe plus a log call
ffmpeg_available() and log_once_ffmpeg_missing() only ever appeared together (both encoders, three lines each: check, log, return), and calling one without the other was a bug in waiting — a probe that never logged, or a log that never gated. ffmpeg_missing() is the single gate: false when the binary is there, otherwise log once per process and say yes. Both call sites shrink to one condition.
This commit is contained in:
@@ -153,8 +153,7 @@ async fn fetch_hls(url: &str, cap: u64) -> Result<bytes::Bytes, String> {
|
||||
async fn resolve_bsky_video(
|
||||
playlist_url: &str,
|
||||
) -> Result<Option<(std::path::PathBuf, tempfile::TempDir)>, String> {
|
||||
if !crate::site::ffmpeg_available() {
|
||||
crate::site::log_once_ffmpeg_missing();
|
||||
if crate::site::ffmpeg_missing() {
|
||||
return Ok(None);
|
||||
}
|
||||
let master = fetch_hls(playlist_url, 1_048_576)
|
||||
|
||||
Reference in New Issue
Block a user