fix: Utils lint fixes

This commit is contained in:
JSC
2025-07-31 21:56:03 +02:00
parent 8847131f24
commit 01bb48c206
4 changed files with 85 additions and 81 deletions

View File

@@ -34,7 +34,7 @@ def get_audio_duration(file_path: Path) -> int:
probe = ffmpeg.probe(str(file_path))
duration = float(probe["format"]["duration"])
return int(duration * 1000) # Convert to milliseconds
except Exception as e:
except (ffmpeg.Error, KeyError, ValueError, TypeError, Exception) as e:
logger.warning("Failed to get duration for %s: %s", file_path, e)
return 0