beets-nohirescd
nohirescd prevents high-resolution source audio from being matched to a CD release during a beets album import. It can also audit a library for existing matches that violate the same rule and send those albums through beets' normal reimport workflow.
If any source track exceeds the configured maximum bit depth or sample rate, the plugin removes candidates whose matched medium is CD. It filters both the initial candidate list and candidates returned by manual searches or entered IDs.
Install
python -m pip install "beets-nohirescd @ git+https://github.com/treyturner/beets-plugins.git#subdirectory=plugins/nohirescd"
Configure beets
Enable the plugin:
plugins:
- nohirescd
The defaults treat audio above 16-bit or 44.1 kHz as high resolution:
nohirescd:
max_bitdepth: 16
max_samplerate: 44100
cd_media_pattern: '(?:^|[^A-Za-z0-9])(?:HDCD|HQCD|CD(?:-R)?)(?:$|[^A-Za-z0-9])'
The default media pattern matches values such as CD, Enhanced CD, 8cm CD, SHM-CD, HDCD, HQCD, and CD-R. It deliberately does not match SACD.
Import behavior
On album import tasks, every source item is checked. A single item above either configured limit activates filtering for the whole album.
Both album-level media and each mapped track's media are checked. This catches mixed-media releases, which beets may represent with the generic album-level value Media while retaining CD on individual mapped tracks.
After removing candidates, the plugin recalculates beets' recommendation. This prevents quiet mode from retaining a recommendation based on a removed CD candidate and produces no recommendation when no valid candidates remain.
Audit existing albums
Run the command without a query to audit every album in the library:
beet nohirescd
The concise console report contains one line per violating album followed by album and track totals. An existing album is a violation when any of its tracks exceeds either configured resolution limit and any of its tracks has stored media matching cd_media_pattern. These may be different tracks on a mixed-media release. Singleton items are not included.
Standard beets album queries restrict the audit:
beet nohirescd albumartist:"Beyoncé"
The audit reads metadata already stored in the beets library and does not query MusicBrainz.
CSV report
Use -o or --output to write a detailed UTF-8 CSV while retaining the concise console report:
beet nohirescd --output nohirescd-audit.csv
The output contains one row per violating album and overwrites an existing file at the specified path. Its columns are:
album_id,mb_albumid,albumartist, andalbumpathandtrack_countmax_bitdepthandmax_sampleratemedia, containing the album's distinct stored track mediahires_tracksandcd_tracks, containing semicolon-separated track details that show why the album was flagged
No report file is created unless --output is supplied.
Reimport violations
Use --reimport to pass the violating albums directly to beets' library reimport pipeline instead of producing an audit report:
beet nohirescd --reimport
beet nohirescd --reimport year:1990..1999
The command preserves the normal import configuration and prompts, except that it always runs this album-only audit's results through album import mode. Any configured singleton mode is restored when the command finishes. Because the nohirescd candidate filter must run during reimport, import.autotag must be enabled. Depending on the beets import configuration and choices made during the session, reimporting can update library metadata and files. --reimport cannot be combined with --output.
Development
uv sync
uv run pytest
uv run mypy
uv run pyright
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beets_nohirescd-0.1.0.tar.gz.
File metadata
- Download URL: beets_nohirescd-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91e8d5e16985718bccd8b2bc234ebe19030a71e39be97c06b34d5443b9b129cb
|
|
| MD5 |
9bbb3d888c6df99541d9ed720ebd8b85
|
|
| BLAKE2b-256 |
3954bf8191401c793d1ca39989cab467b66b5fe697923c872adbb68171861fe8
|
Provenance
The following attestation bundles were made for beets_nohirescd-0.1.0.tar.gz:
Publisher:
publish.yml on treyturner/beets-plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_nohirescd-0.1.0.tar.gz -
Subject digest:
91e8d5e16985718bccd8b2bc234ebe19030a71e39be97c06b34d5443b9b129cb - Sigstore transparency entry: 2339973013
- Sigstore integration time:
-
Permalink:
treyturner/beets-plugins@5b75bc2264679b7349507b94c9611b0b7abd5db9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/treyturner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b75bc2264679b7349507b94c9611b0b7abd5db9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file beets_nohirescd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: beets_nohirescd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f6adde02cea50ed625a8b3768d6dd6ca0ad53363ac1ce15b9120129af39d866
|
|
| MD5 |
5a8e158cbdc9de2567c7bba975965d4a
|
|
| BLAKE2b-256 |
0c649a8343d0bd76b333dca1b48c96104edd2c4f3b894d4663706e1e7895f70b
|
Provenance
The following attestation bundles were made for beets_nohirescd-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on treyturner/beets-plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_nohirescd-0.1.0-py3-none-any.whl -
Subject digest:
6f6adde02cea50ed625a8b3768d6dd6ca0ad53363ac1ce15b9120129af39d866 - Sigstore transparency entry: 2339973048
- Sigstore integration time:
-
Permalink:
treyturner/beets-plugins@5b75bc2264679b7349507b94c9611b0b7abd5db9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/treyturner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b75bc2264679b7349507b94c9611b0b7abd5db9 -
Trigger Event:
workflow_dispatch
-
Statement type: