beetbox / beetbox/beets

Better logging for replaygain plugin

Open
#4,986 0 comments 0 reactions 0 assignees View on GitHub
replaygain
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

After some discussion [here](https://github.com/beetbox/beets/discussions/4935), I think we should do this:

https://github.com/beetbox/beets/blob/e10b955a931e4c205b0cadf0860797c0aeee736c/beetsplug/replaygain.py#L1163C14-L1163C14

1. Add a check for true peaks
2. warn if true peaks is not supported by the backend
3. log one time on init whether it's true peaks or sample peaks

warning - Your config specifies true peaks which only work in the ffmpeg backend.
warning - The command may work as-is, but we recommend changing your backend to "ffmpeg" or your config to "sample".
info Analyzing true peaks (slower, more accurate).
info Analyzing sample peaks (faster, less accurate).

The plugin unfortunately specifies true peaks on init if the config is not defined. I can't think of a clean way to default to sample for the others but truepeaks for ffmpeg. (Specify it once in the overall init then again when ffmpeg init happens? Does that even work?)

I can do the PR once we agree on approach.

Contributor guide

Open the contributing guide

Research direction

Start at beetsplug/replaygain.py around line 1163 and inspect how the backend and true-peaks configuration are initialized. Determine how to check backend support and where initialization logging belongs. Done means unsupported true peaks produces the specified warning and initialization logs whether true or sample peaks are being analyzed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.