beets-nohirescd 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trey Turner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: beets-nohirescd
3
+ Version: 0.1.0
4
+ Summary: Prevent high-resolution audio from matching CD releases in beets
5
+ Author: Trey Turner
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/treyturner/beets-plugins
8
+ Project-URL: Source, https://github.com/treyturner/beets-plugins/tree/main/plugins/nohirescd
9
+ Keywords: beets,musicbrainz,audio,hi-res,cd
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Multimedia :: Sound/Audio
20
+ Requires-Python: <3.15,>=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: beets<3,>=2.13
24
+ Dynamic: license-file
25
+
26
+ # beets-nohirescd
27
+
28
+ `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.
29
+
30
+ 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.
31
+
32
+ ## Install
33
+
34
+ ```sh
35
+ python -m pip install "beets-nohirescd @ git+https://github.com/treyturner/beets-plugins.git#subdirectory=plugins/nohirescd"
36
+ ```
37
+
38
+ ## Configure beets
39
+
40
+ Enable the plugin:
41
+
42
+ ```yaml
43
+ plugins:
44
+ - nohirescd
45
+ ```
46
+
47
+ The defaults treat audio above 16-bit or 44.1 kHz as high resolution:
48
+
49
+ ```yaml
50
+ nohirescd:
51
+ max_bitdepth: 16
52
+ max_samplerate: 44100
53
+ cd_media_pattern: '(?:^|[^A-Za-z0-9])(?:HDCD|HQCD|CD(?:-R)?)(?:$|[^A-Za-z0-9])'
54
+ ```
55
+
56
+ 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`.
57
+
58
+ ## Import behavior
59
+
60
+ On album import tasks, every source item is checked. A single item above either configured limit activates filtering for the whole album.
61
+
62
+ 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.
63
+
64
+ 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.
65
+
66
+ ## Audit existing albums
67
+
68
+ Run the command without a query to audit every album in the library:
69
+
70
+ ```sh
71
+ beet nohirescd
72
+ ```
73
+
74
+ 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.
75
+
76
+ Standard beets album queries restrict the audit:
77
+
78
+ ```sh
79
+ beet nohirescd albumartist:"Beyoncé"
80
+ ```
81
+
82
+ The audit reads metadata already stored in the beets library and does not query MusicBrainz.
83
+
84
+ ### CSV report
85
+
86
+ Use `-o` or `--output` to write a detailed UTF-8 CSV while retaining the concise console report:
87
+
88
+ ```sh
89
+ beet nohirescd --output nohirescd-audit.csv
90
+ ```
91
+
92
+ The output contains one row per violating album and overwrites an existing file at the specified path. Its columns are:
93
+
94
+ - `album_id`, `mb_albumid`, `albumartist`, and `album`
95
+ - `path` and `track_count`
96
+ - `max_bitdepth` and `max_samplerate`
97
+ - `media`, containing the album's distinct stored track media
98
+ - `hires_tracks` and `cd_tracks`, containing semicolon-separated track details that show why the album was flagged
99
+
100
+ No report file is created unless `--output` is supplied.
101
+
102
+ ### Reimport violations
103
+
104
+ Use `--reimport` to pass the violating albums directly to beets' library reimport pipeline instead of producing an audit report:
105
+
106
+ ```sh
107
+ beet nohirescd --reimport
108
+ beet nohirescd --reimport year:1990..1999
109
+ ```
110
+
111
+ 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`.
112
+
113
+ ## Development
114
+
115
+ ```sh
116
+ uv sync
117
+ uv run pytest
118
+ uv run mypy
119
+ uv run pyright
120
+ ```
@@ -0,0 +1,95 @@
1
+ # beets-nohirescd
2
+
3
+ `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.
4
+
5
+ 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.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ python -m pip install "beets-nohirescd @ git+https://github.com/treyturner/beets-plugins.git#subdirectory=plugins/nohirescd"
11
+ ```
12
+
13
+ ## Configure beets
14
+
15
+ Enable the plugin:
16
+
17
+ ```yaml
18
+ plugins:
19
+ - nohirescd
20
+ ```
21
+
22
+ The defaults treat audio above 16-bit or 44.1 kHz as high resolution:
23
+
24
+ ```yaml
25
+ nohirescd:
26
+ max_bitdepth: 16
27
+ max_samplerate: 44100
28
+ cd_media_pattern: '(?:^|[^A-Za-z0-9])(?:HDCD|HQCD|CD(?:-R)?)(?:$|[^A-Za-z0-9])'
29
+ ```
30
+
31
+ 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`.
32
+
33
+ ## Import behavior
34
+
35
+ On album import tasks, every source item is checked. A single item above either configured limit activates filtering for the whole album.
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ ## Audit existing albums
42
+
43
+ Run the command without a query to audit every album in the library:
44
+
45
+ ```sh
46
+ beet nohirescd
47
+ ```
48
+
49
+ 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.
50
+
51
+ Standard beets album queries restrict the audit:
52
+
53
+ ```sh
54
+ beet nohirescd albumartist:"Beyoncé"
55
+ ```
56
+
57
+ The audit reads metadata already stored in the beets library and does not query MusicBrainz.
58
+
59
+ ### CSV report
60
+
61
+ Use `-o` or `--output` to write a detailed UTF-8 CSV while retaining the concise console report:
62
+
63
+ ```sh
64
+ beet nohirescd --output nohirescd-audit.csv
65
+ ```
66
+
67
+ The output contains one row per violating album and overwrites an existing file at the specified path. Its columns are:
68
+
69
+ - `album_id`, `mb_albumid`, `albumartist`, and `album`
70
+ - `path` and `track_count`
71
+ - `max_bitdepth` and `max_samplerate`
72
+ - `media`, containing the album's distinct stored track media
73
+ - `hires_tracks` and `cd_tracks`, containing semicolon-separated track details that show why the album was flagged
74
+
75
+ No report file is created unless `--output` is supplied.
76
+
77
+ ### Reimport violations
78
+
79
+ Use `--reimport` to pass the violating albums directly to beets' library reimport pipeline instead of producing an audit report:
80
+
81
+ ```sh
82
+ beet nohirescd --reimport
83
+ beet nohirescd --reimport year:1990..1999
84
+ ```
85
+
86
+ 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`.
87
+
88
+ ## Development
89
+
90
+ ```sh
91
+ uv sync
92
+ uv run pytest
93
+ uv run mypy
94
+ uv run pyright
95
+ ```
@@ -0,0 +1,96 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "beets-nohirescd"
7
+ version = "0.1.0"
8
+ description = "Prevent high-resolution audio from matching CD releases in beets"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10,<3.15"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "Trey Turner" },
15
+ ]
16
+ keywords = ["beets", "musicbrainz", "audio", "hi-res", "cd"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Environment :: Console",
20
+ "Intended Audience :: End Users/Desktop",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Programming Language :: Python :: 3.14",
27
+ "Topic :: Multimedia :: Sound/Audio",
28
+ ]
29
+ dependencies = [
30
+ "beets>=2.13,<3",
31
+ ]
32
+
33
+ [dependency-groups]
34
+ dev = [
35
+ "mypy>=1.18",
36
+ "pre-commit>=3.8",
37
+ "pyright>=1.1.410",
38
+ "pytest>=8",
39
+ "pytest-cov>=5",
40
+ "ruff>=0.6.9",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/treyturner/beets-plugins"
45
+ Source = "https://github.com/treyturner/beets-plugins/tree/main/plugins/nohirescd"
46
+
47
+ [tool.setuptools.packages.find]
48
+ where = ["src"]
49
+ include = ["beetsplug*"]
50
+ namespaces = true
51
+
52
+ [tool.pytest.ini_options]
53
+ addopts = "--strict-markers --strict-config --cov=beetsplug.nohirescd --cov-report=term-missing"
54
+ testpaths = ["tests"]
55
+
56
+ [tool.coverage.run]
57
+ branch = true
58
+ source = ["beetsplug.nohirescd"]
59
+
60
+ [tool.coverage.report]
61
+ show_missing = true
62
+ skip_covered = true
63
+
64
+ [tool.mypy]
65
+ strict = true
66
+ files = ["src/beetsplug/nohirescd"]
67
+ warn_unused_ignores = true
68
+
69
+ [[tool.mypy.overrides]]
70
+ module = [
71
+ "beets.*",
72
+ "beetsplug.*",
73
+ ]
74
+ ignore_missing_imports = true
75
+
76
+ [tool.pyright]
77
+ include = ["src"]
78
+ extraPaths = ["src"]
79
+ typeCheckingMode = "strict"
80
+ venvPath = "."
81
+ venv = ".venv"
82
+ reportMissingTypeStubs = "none"
83
+
84
+ [tool.ruff]
85
+ target-version = "py310"
86
+ line-length = 100
87
+ src = ["src"]
88
+
89
+ [tool.ruff.lint]
90
+ select = ["E", "F", "W", "B", "I", "UP"]
91
+ ignore = []
92
+
93
+ [tool.ruff.format]
94
+ quote-style = "double"
95
+ indent-style = "space"
96
+ line-ending = "lf"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: beets-nohirescd
3
+ Version: 0.1.0
4
+ Summary: Prevent high-resolution audio from matching CD releases in beets
5
+ Author: Trey Turner
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/treyturner/beets-plugins
8
+ Project-URL: Source, https://github.com/treyturner/beets-plugins/tree/main/plugins/nohirescd
9
+ Keywords: beets,musicbrainz,audio,hi-res,cd
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Multimedia :: Sound/Audio
20
+ Requires-Python: <3.15,>=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: beets<3,>=2.13
24
+ Dynamic: license-file
25
+
26
+ # beets-nohirescd
27
+
28
+ `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.
29
+
30
+ 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.
31
+
32
+ ## Install
33
+
34
+ ```sh
35
+ python -m pip install "beets-nohirescd @ git+https://github.com/treyturner/beets-plugins.git#subdirectory=plugins/nohirescd"
36
+ ```
37
+
38
+ ## Configure beets
39
+
40
+ Enable the plugin:
41
+
42
+ ```yaml
43
+ plugins:
44
+ - nohirescd
45
+ ```
46
+
47
+ The defaults treat audio above 16-bit or 44.1 kHz as high resolution:
48
+
49
+ ```yaml
50
+ nohirescd:
51
+ max_bitdepth: 16
52
+ max_samplerate: 44100
53
+ cd_media_pattern: '(?:^|[^A-Za-z0-9])(?:HDCD|HQCD|CD(?:-R)?)(?:$|[^A-Za-z0-9])'
54
+ ```
55
+
56
+ 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`.
57
+
58
+ ## Import behavior
59
+
60
+ On album import tasks, every source item is checked. A single item above either configured limit activates filtering for the whole album.
61
+
62
+ 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.
63
+
64
+ 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.
65
+
66
+ ## Audit existing albums
67
+
68
+ Run the command without a query to audit every album in the library:
69
+
70
+ ```sh
71
+ beet nohirescd
72
+ ```
73
+
74
+ 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.
75
+
76
+ Standard beets album queries restrict the audit:
77
+
78
+ ```sh
79
+ beet nohirescd albumartist:"Beyoncé"
80
+ ```
81
+
82
+ The audit reads metadata already stored in the beets library and does not query MusicBrainz.
83
+
84
+ ### CSV report
85
+
86
+ Use `-o` or `--output` to write a detailed UTF-8 CSV while retaining the concise console report:
87
+
88
+ ```sh
89
+ beet nohirescd --output nohirescd-audit.csv
90
+ ```
91
+
92
+ The output contains one row per violating album and overwrites an existing file at the specified path. Its columns are:
93
+
94
+ - `album_id`, `mb_albumid`, `albumartist`, and `album`
95
+ - `path` and `track_count`
96
+ - `max_bitdepth` and `max_samplerate`
97
+ - `media`, containing the album's distinct stored track media
98
+ - `hires_tracks` and `cd_tracks`, containing semicolon-separated track details that show why the album was flagged
99
+
100
+ No report file is created unless `--output` is supplied.
101
+
102
+ ### Reimport violations
103
+
104
+ Use `--reimport` to pass the violating albums directly to beets' library reimport pipeline instead of producing an audit report:
105
+
106
+ ```sh
107
+ beet nohirescd --reimport
108
+ beet nohirescd --reimport year:1990..1999
109
+ ```
110
+
111
+ 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`.
112
+
113
+ ## Development
114
+
115
+ ```sh
116
+ uv sync
117
+ uv run pytest
118
+ uv run mypy
119
+ uv run pyright
120
+ ```
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/beets_nohirescd.egg-info/PKG-INFO
5
+ src/beets_nohirescd.egg-info/SOURCES.txt
6
+ src/beets_nohirescd.egg-info/dependency_links.txt
7
+ src/beets_nohirescd.egg-info/requires.txt
8
+ src/beets_nohirescd.egg-info/top_level.txt
9
+ src/beetsplug/nohirescd/__init__.py
10
+ tests/test_nohirescd.py
@@ -0,0 +1 @@
1
+ beets<3,>=2.13