Commit graph

13490 commits

Author SHA1 Message Date
Šarūnas Nejus
cde73cc433
Add changelog note 2026-01-30 01:18:11 +00:00
Šarūnas Nejus
a17857213b
Fix lints 2026-01-30 01:06:31 +00:00
Šarūnas Nejus
fc54f809a1
Merge branch 'master' into indices 2026-01-30 01:03:18 +00:00
Šarūnas Nejus
e768f978b6
Simplify creating indices 2026-01-30 00:55:13 +00:00
Šarūnas Nejus
838a94d931
Retries with 1, 2, 4, 8, 16, 32s backoff (#6322)
At least it allows me to more or less use MusicBrainz, and makes issues
from #6312 almost not noticible
2026-01-30 00:50:57 +00:00
Kirill A. Korinsky
48c954edf6 Nuked tests 2026-01-30 00:46:13 +00:00
Kirill A. Korinsky
47b1644110 Attemt to rework tests 2026-01-30 00:46:13 +00:00
Kirill A. Korinsky
78b6d537b6 Retries with 1, 2, 4, 8, 16, 32s backoff
At least it allows me to more or less use MusicBrainz
2026-01-30 00:46:13 +00:00
Šarūnas Nejus
c1484169dc
Refactored beets/random.py and moved into beetsplug/random.py (#5924)
The `beets/random.py` module was only used by the random plugin, so I
moved its functions into `beetsplug/random.py` to keep core modules
cleaner.


Changes:
- Moved beets/random.py functions into beetsplug/random.py
- Added typehints for better readability and tooling support
- Added additional tests for improved coverage
- General tidy up and refactor, keeping the core functionality unchanged
2026-01-30 00:36:51 +00:00
Šarūnas Nejus
95cef2de2b
Fix grouping for list fields and stabilize equal-chance order
- Handle list-valued fields when grouping for --field/--equal-chance to avoid
  "TypeError: unhashable type: 'list'" (e.g., artists).
- Sort items by the grouping key before building groups so equal-chance
  permutation preserves the same item set as `beet list`, only randomized.
2026-01-30 00:30:46 +00:00
Sebastian Mohr
ee7dc3c4e7
Enhanced documentation of random plugin. 2026-01-30 00:30:45 +00:00
Sebastian Mohr
6c52252672
Readded licence. Removed last legacy occurrences of artist and
replaced them with `field`. Removed unnecessary default parameters where
applicable.
2026-01-30 00:30:21 +00:00
Šarūnas Nejus
5ed0a72310
Add annotation for LibModel.length property 2026-01-30 00:30:21 +00:00
Sebastian Mohr
da9244d54d
Added an option to define the field to use for equal chance sampling 2026-01-30 00:30:21 +00:00
Šarūnas Nejus
2aa7575294
Replace random.Random with random module 2026-01-30 00:30:21 +00:00
Sebastian Mohr
3dd6f5a25b
Cached property for length & forgot sorted. 2026-01-30 00:30:21 +00:00
Sebastian Mohr
bcb22e6c85
Overall refactor of random plugin. Added length property to albums. 2026-01-30 00:30:21 +00:00
Sebastian Mohr
34e0de3e1f
Added typehints and some more tests. 2026-01-30 00:30:20 +00:00
Sebastian Mohr
1165758e1e
Moved functions from random.py into random plugin. Removed random.py 2026-01-30 00:29:27 +00:00
Šarūnas Nejus
912b7ef2e4
Allow to use ANSI 4 bit colors (#6321)
Here some changes which I made when works on #5342 , I think we may say
that it actually fixes #5342 because after that we have full colors in
docs and code which allows user to do colours as he would like to.
2026-01-29 22:51:26 +00:00
Kirill A. Korinsky
5a94209364
Update changelog 2026-01-27 22:56:18 +01:00
Kirill A. Korinsky
1dd2cd019f
Update color docs with bright_* and bg_bright_* entries 2026-01-25 12:05:40 +01:00
Kirill A. Korinsky
9dafaf0502
Add missed ANSI codes for 4 bit colors 2026-01-25 11:18:38 +01:00
Šarūnas Nejus
4572a7dc8a
Gracefully handle 404s when importing from MusicBrainz. (#6292)
A 404 error can be raised when fetching from MusicBrainz in the case of
re-importing an album that has since been deleted from MusicBrainz.
2026-01-23 02:13:42 +00:00
Šarūnas Nejus
146c462e97
Merge branch 'master' into handle-404-in-reimport 2026-01-23 02:08:45 +00:00
David Logie
8769f8f8f0 Gracefully handle 404s when importing from MusicBrainz.
A 404 error can be raised when fetching from MusicBrainz in the case of
re-importing an album that has since been deleted from MusicBrainz.
2026-01-22 12:20:04 +00:00
Šarūnas Nejus
4882b6beea
fish: complete files in more places (#5927)
Normally, the Fish completion plugin won't complete filenames, which is
useful for `beet import` and similar! This removes the `-f` (no filename
completion) flag from various places in the output.
2026-01-22 01:57:15 +00:00
Rebecca Turner
958b36b298 fish: complete files in more places 2026-01-20 13:07:03 -08:00
Serene
0e5c64a766
Embedart plugin: clearart improvements (#6156) 2026-01-20 08:48:23 +10:00
Serene
39f65f6b11
Merge branch 'master' into embedart-clear-improvements 2026-01-20 08:43:30 +10:00
Henry
9b1bd5df7a Adjust type annotation, rebase. 2026-01-19 12:46:22 -08:00
Henry
ff95ce5d20 Remove utils, rework from_plugin method in ArtistState to from_config 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
2cfd1df3c1 Split discogs.py into smaller and more workable modules. 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
5523ca94a2 Document ArtistState 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
7d83a68bdd Ensure all fields in artist dicts in tests 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
b3183a73e0 Simplify building artist 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
59e7c59172 Move building logic to dataclasses 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
0e48c65171 Clarify variable in _process_clean_tracklist 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
2d406a3ca5 Add comments, clean up types. 2026-01-19 12:43:30 -08:00
Henry
459fd39768 Fix behavior when ANV does not exist 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
08a2c248b9 Fix handling of commas and semicolons in artist join 2026-01-19 12:43:30 -08:00
Henry
f0aef6e213 Cleanup for #6177, #6068 2026-01-19 12:43:27 -08:00
Henry
1d6e05709e Fix #6068 - Multivalue fields are now supported & tested. 2026-01-19 12:41:36 -08:00
Henry
9efe87101c Fix #6177, remove derived types, refactor coalesce tracks 2026-01-19 12:40:42 -08:00
Šarūnas Nejus
dbe97c231f
Add mp3rgain support to ReplayGain command backend (#6289)
This PR adds support for
[mp3rgain](https://github.com/M-Igashi/mp3rgain) as an alternative to
mp3gain/aacgain in the ReplayGain plugin's command backend.

## What is mp3rgain?

mp3rgain is a modern Rust rewrite of mp3gain that provides:

- **CLI-compatible drop-in replacement** for mp3gain - same command-line
interface and output format
- **Support for both MP3 and AAC/M4A formats** (like aacgain)
- **Security fixes** for vulnerabilities in the original mp3gain:
- CVE-2021-34085 (Critical, CVSS 9.8) - buffer over-read in
`WriteMP3GainAPETag`
- CVE-2019-18359 (Medium, CVSS 5.5) - buffer over-read in
`ReadMP3APETag`
- **Memory-safe implementation** in Rust
- **Works on modern systems** including Windows 11 and macOS with Apple
Silicon
- **Active maintenance** (original mp3gain has not been updated since
2009)

## Changes

1. **beetsplug/replaygain.py**:
- Add `mp3rgain` to the command search list (prioritized first since
it's more secure)
- Update `format_supported()` to correctly handle mp3rgain's AAC/M4A
support
   - Update error message to mention mp3rgain

2. **docs/plugins/replaygain.rst**:
   - Add mp3rgain to the backend documentation
   - Include installation instructions for various platforms
   - Document the security benefits

## Testing

mp3rgain has been tested to be fully compatible with the existing
command backend:
- Supports all the same command-line flags (`-o`, `-s s`, `-k`, `-c`,
`-d`, etc.)
- Produces identical tab-delimited output format
- Returns the same exit codes

## Why prioritize mp3rgain in the search order?

The original mp3gain has known security vulnerabilities that have not
been fixed (the project has been inactive since 2009). By searching for
mp3rgain first, users who have it installed will automatically benefit
from the security improvements, while maintaining full backward
compatibility for users who only have mp3gain/aacgain installed.
2026-01-19 20:01:09 +00:00
Jesse Pinkman
7002cbdda2
Merge branch 'master' into add-mp3rgain-support 2026-01-18 11:00:38 +01:00
m_igashi
545e7eb0b6 refactor: simplify CommandBackend and improve documentation
- Remove auto-detection of command tools, require explicit command config
- Simplify __init__ method by removing redundant else branch
- Reorganize docs with separate sections for mp3gain, aacgain, mp3rgain
- Fix CVE reference (CVE-2021-34085 is fixed in mp3gain 1.6.2)
- Update command option description per review feedback
2026-01-18 10:52:41 +01:00
Šarūnas Nejus
ef59cfa522
Handle potential OSError when unlinking temporary files in ArtResizer (#5615)
## Description

was getting permission error because after png is converted to jpg beets
want to delete the png but somehow it is still being used causing the
import to fail. this temporarily fixes the import but still needs a
proper way to know what is using the file and how to delete it.

```
  File "C:\Users\DELL\projects\_myForks\beets\beetsplug\fetchart.py", line 1321, in fetch_art
    candidate = self.art_for_album(task.album, task.paths, local)
  File "C:\Users\DELL\projects\_myForks\beets\beetsplug\fetchart.py", line 1413, in art_for_album
    out.resize(self)
    ~~~~~~~~~~^^^^^^
  File "C:\Users\DELL\projects\_myForks\beets\beetsplug\fetchart.py", line 218, in resize
    self._resize(plugin, current_check)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DELL\projects\_myForks\beets\beetsplug\fetchart.py", line 246, in _resize
    self.path = ArtResizer.shared.reformat(
                ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.path,
        ^^^^^^^^^^
        plugin.cover_format,
        ^^^^^^^^^^^^^^^^^^^^
        deinterlaced=plugin.deinterlace,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\DELL\projects\_myForks\beets\beets\util\artresizer.py", line 658, in reformat
    os.unlink(path_in)
    ~~~~~~~~~^^^^^^^^^
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: b'C:\\Users\\DELL\\AppData\\Local\\Temp\\beets\\beetsplug_fetchart\\4kqx2um2.png'
```
when importing
https://musicbrainz.org/release/5744ddb7-e9b6-4b46-a55c-38e75aa95460

beet config

```yaml
fetchart:
    minwidth: 500
    maxwidth: 3000
    max_filesize: 3500000
    sources:
    -   coverart: release
    -   coverart: releasegroup
    - itunes
    - amazon
    - filesystem
    - albumart
    - '*'
    cautious: yes
    cover_names: cover front art artwork folder album
    store_source: yes
    cover_format: JPEG
    auto: yes
    quality: 0
    enforce_ratio: no
    high_resolution: no
    deinterlace: no
```
2026-01-17 14:35:44 +00:00
Dr.Blank
52284ff7ed
fix: changelog entry 2026-01-17 14:30:22 +05:30
m_igashi
29e1c283eb fix: sort imports alphabetically 2026-01-17 02:15:43 +01:00