beetbox / beetbox/beets

`%aunique{}` fails to disambiguate albums consisting of only special characters

Open
#6,462 2 comments 0 reactions 1 assignee Claimed by @marubio04 View on GitHub
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Problem

I ran into this problem while trying to clean up some tokyopill albums. There are a few albums that only contain one special character, and two that have the same title:

* [TOKYOPILL - .](https://musicbrainz.org/release/fe7e0348-bc45-4c39-a422-66d615f78ad0)
* [TOKYOPILL - ?](https://musicbrainz.org/release/e6ded9ee-839a-4369-8c1d-02ce9c1ee3a0)
* [TOKYOPILL - _](https://musicbrainz.org/release/e06ad064-d72b-44d8-893d-e0f39a74253c)
* [TOKYOPILL - _](https://musicbrainz.org/release/611e98b8-a7b1-4efe-9ee8-2987b11d7c29)

Attempting to import these results in beets getting confused. In the case of the '?' and '.' albums, it simply dumps them into `TOKYOPILL/_` without checking that another album is already there, causing the directory tree to look ugly:

```
/mnt/2TBMEDIA/Movies/Music/TOKYOPILL/_
├── 01 _.1.flac
├── 01 _.2.flac
├── 01 _.flac
├── cover.1.jpg
├── cover.2.jpg
├── cover.4.jpg
└── cover.jpg

1 directory, 7 files
```

Additionally, beets incorrectly identifies the two `_` releases as duplicates, despite having different musicbrainz identifiers and being different lengths.

### Setup

* OS: Debian bookworm
* Python version: 3.11.2
* beets version: master (2.7.1)
* Turning off plugins made problem go away (yes/no): no

My configuration (output of `beet config`) is:

```yaml
# --------------- Plugins ---------------

plugins: fetchart convert musicbrainz duplicates mbsync fromfilename
# --------------- Main ---------------

library: /mnt/2TBMEDIA/Movies/beets.db
directory: /mnt/2TBMEDIA/Movies/Music

import:
languages: en
from_scratch: yes
musicbrainz:
data_source_mismatch_penalty: 0.2
search_limit: 5
search_query_ascii: no
genres: no
genres_tag: genre
external_ids:
discogs: no
bandcamp: no
spotify: no
deezer: no
tidal: no
extra_tags: []
convert:
auto: yes
format: flac
never_convert_lossy_files: yes
dest:
pretend: no
link: no
hardlink: no
threads: 4
id3v23: inherit
write_metadata: yes
formats:
aac:
command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
extension: m4a
alac:
command: ffmpeg -i $source -y -vn -acodec alac $dest
extension: m4a
flac: ffmpeg -i $source -y -vn -acodec flac $dest
mp3: ffmpeg -i $source -y -vn -aq 2 $dest
opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
max_bitrate:
auto_keep: no
tmpdir:
quiet: no
embed: yes
paths: {}
no_convert: ''
copy_album_art: no
album_art_maxwidth: 0
delete_originals: no
playlist:
fetchart:
sources:
- coverart: release
- coverart: releasegroup
- filesystem
- itunes
- '*'
auto: yes
minwidth: 0
maxwidth: 0
quality: 0
max_filesize: 0
enforce_ratio: no
cautious: no
cover_names:
- cover
- front
- art
- album
- folder
fallback:
store_source: no
high_resolution: no
deinterlace: no
cover_format:
google_key: REDACTED
google_engine: REDACTED
lastfm_key: REDACTED
fanarttv_key: REDACTED
disabled_plugins: []
duplicates:
album: no
checksum: ''
copy: ''
count: no
delete: no
format: ''
full: no
keys: []
merge: no
move: ''
path: no
tiebreak: {}
strict: no
tag: ''
remove: no
```

I am using the default path configuration; according to the docs it should include `%aunique{}`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.