Open tandy-1000 opened 3 months ago
I was just looking at the badfiles plugin for my own config and saw this issue. I might be missing or misunderstand something, but as you can configure the exact commands in the plugin config, not sure what needs to be changed here?
badfiles:
check_on_import: yes
commands:
mp3: mp3val -f -si -nb -t
tested it with manual trigger on some mp3s badfiles reported streaming errors on and the errors got fixed silently.
The badfiles plugin can run whatever command you want and isn't tied to flac or mp3val - just uses mp3val by default. If the flac command doesn't replace the file automatically, you could write a small bash wrapper script to do that for you or use a different command that could replace the file with the fixed version automatically.
That does work for mp3val
, thanks for the tip.
However flac
requires a -o outfile
argument so I can't use the custom command workaround for that.
As you suggested I've written a script:
#!/usr/bin/env bash
INPUT_FILE=${1}
OUTPUT_FILE=${INPUT_FILE}
flac -VFf --preserve-modtime -o "${OUTPUT_FILE}" "${INPUT_FILE}"
badfiles:
check_on_import: yes
commands:
mp3: mp3val -f -si -nb -t
flac: /etc/beets/flacfixer.sh
I've used this guide to fix flac files that badfiles has alerted me to.
mp3val
also seems to have the following options:I'd be happy to work on implementing this.
Proposed solution
badfiles
should provide the option to automatically try and resolve errors in FLAC and mp3 files.Objective
It would be useful if
badfiles
would offer to try and fix errors for FLAC and mp3 files.Goals
Fixable FLAC and mp3 files should (optionally) be automatically fixed.
Non-goals
This could potentially be extended to resolve errors for other formats, but is out of scope for this feature request.
Anti-goals
This should be optional and not default behaviour.