Problem
When using the ReplayGain plugin with the metaflac backend, the current implementation works in two parts:
- Write the ReplayGain tags to the input files (source: beetsplug/replaygain.py#L709-L712).
- Read the ReplayGain tags from the input files (source: beetsplug/replaygain.py#L714-L733).
This leads to altering the input files, which corrupts files that shouldn't be touched, especially when the input files are not in the final destination (e.g., during import).
metaflac can use --scan-replay-gain to read the ReplayGain tags without altering the input files (since FLAC 1.3.2, released on 01-Jan-2017 - discussed in #1203).
Using --scan-replay-gain instead of --add-replay-gain would fix this issue.
Minimal reproduction
-
config.yaml:
directory: /music
import:
copy: yes
replaygain:
auto: yes
backend: metaflac
-
Import a FLAC file with no ReplayGain tags:
beet import /downloads/file.flac
-
Check the ReplayGain tags on the copy beets created in the library: metaflac --list /music/.../file.flac - tags are present, as expected.
-
Check the ReplayGain tags on the original file that was imported from: metaflac --list /downloads/file.flac - tags were also written here, unexpectedly.
Setup
- OS: Debian GNU/Linux 13.6 (trixie) in a Visual Studio Devcontainer
- Python version: 3.13.5
- beets version: 2.13.1 (released on 29-Jul-2026)
- Turning off plugins made problem go away (yes/no): N/A
AI disclaimer
I have used AI to help me write this issue report.
Problem
When using the ReplayGain plugin with the metaflac backend, the current implementation works in two parts:
This leads to altering the input files, which corrupts files that shouldn't be touched, especially when the input files are not in the final destination (e.g., during import).
metaflac can use
--scan-replay-gainto read the ReplayGain tags without altering the input files (since FLAC 1.3.2, released on 01-Jan-2017 - discussed in #1203).Using
--scan-replay-gaininstead of--add-replay-gainwould fix this issue.Minimal reproduction
config.yaml:Import a FLAC file with no ReplayGain tags:
Check the ReplayGain tags on the copy beets created in the library:
metaflac --list /music/.../file.flac- tags are present, as expected.Check the ReplayGain tags on the original file that was imported from:
metaflac --list /downloads/file.flac- tags were also written here, unexpectedly.Setup
AI disclaimer
I have used AI to help me write this issue report.