Beets moves links during reimport even with -C flag on
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
I have beets configured to use links, and whenever I get new music I just import it as-is to get it in my library folder fast, and then when I have the time, I reimport it, with the -C flag on since I don't want the files to get moved around and mess up my playlists (I have the music folder hooked to Jellyfin to stream the music)
### Problem
I ran this command, the -C flag means the files should not get moved, acording to the reimport section in the docs.
```sh
$ beet import -L -C
```
However, if the importer suggests an album/artist/track name change, the file gets moved to match that, when I expected only the file metadata to be changed (Most of the time it's a track with multiple artists, or latin/japanese spelling of the same thing).
```
...
Match (96.2%):
Aiobahn feat. ナナヲアカリ - しあわせになんてならないで
≠ artist, album, tracks
MusicBrainz, Digital Media, 2023, XW, avex trax, ANTCD-A0000011997, None
https://musicbrainz.org/release/f677529c-c809-4fec-a05b-bf456c16ad3e
≠ Artist: Aiobahn -> Aiobahn feat. ナナヲアカリ
≠ Album: しあわせになんてならないで (feat. ナナヲアカリ) -> しあわせになんてならないで
≠ (#1) しあわせになんてならないで - feat. ナナヲアカリ (3:33) -> (#1) しあわせになんてならないで (3:33)
➜ Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates? A
Sending event: import_task_choice
Sending event: import_task_apply
Replacing item 1089: /Aiobahn/しあわせになんてならないで (feat. ナナヲアカリ)/01 しあわせになんてならないで - feat. ナナヲアカリ.m4a
Sending event: database_change
Parsed query: AndQuery([SubstringQuery('personal_folder', 'Hana Library', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('personal_folder', 'Ibuks Library', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist__gacharic_spin_radio', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist__s_h_a_z_n_a_radio', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist__midori_radio', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist__this_is_utsu_p', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist_spotify_playlist__this_is_sick2', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Parsed query: AndQuery([SubstringQuery('spotify_playlist__this_is_yuyoyuppe', '1', fast=False)])
Parsed sort: FixedFieldSort('acoustid_fingerprint', ascending=True)
Sending event: database_change
Sending event: album_removed
Sending event: item_removed
1 of 1 items replaced
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: database_change
Reimported album 1277. Preserving attribute ['added']. Path: /Beets Library/Aiobahn/しあわせになんてならないで (feat. ナナヲアカリ)
Reimported album 1277. Preserving flexible attributes []. Path: /Beets Library/Aiobahn/しあわせになんてならないで (feat. ナナヲアカリ)
Reimported item 2373. Preserving attribute ['added']. Path: /Beets Library/Aiobahn/しあわせになんてならないで (feat. ナナヲアカリ)/01 しあわせになんてならないで - feat. ナナヲアカリ.m4a
Reimported item 2373. Preserving flexible attributes ['personal_folder', 'original-playlist', 'personal_library']. Path: /Aiobahn/しあわせになんてならないで (feat. ナナヲアカリ)/01 しあわせになんてならないで - feat. ナナヲアカリ.m4a
Sending event: database_change
Sending event: database_change
Sending event: database_change
lyrics: fetched lyrics: Aiobahn feat. ナナヲアカリ - しあわせになんてならないで - しあわせになんてならないで
Sending event: database_change
replaygain: analyzing Aiobahn feat. ナナヲアカリ - しあわせになんてならないで
Sending event: database_change
Sending event: database_change
Parsed query: AndQuery([NoneQuery('album_id', True)])
Parsed sort: NullSort()
Parsed query: AndQuery([BooleanQuery('comp', 1, fast=True)])
Parsed sort: NullSort()
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: write
Sending event: after_write
Sending event: database_change
Sending event: import_task_files
Sending event: art_set
Sending event: database_change
Sending event: database_change
Sending event: album_imported
Sending event: import
Sending event: cli_exit
```
### Setup
* OS: Endeavour OS (Linux arch)
* Python version: 3.11
* beets version: 2.2.0
* Turning off plugins made problem go away (yes/no): no
My configuration (output of `beet config`) is:
```yaml
lyrics:
bing_lang_from: []
sources: lrclib tekstow genius google
google_API_key: REDACTED
force: no
synced: yes
auto: yes
bing_client_secret: REDACTED
bing_lang_to:
google_engine_ID: REDACTED
genius_api_key: REDACTED
fallback:
local: no
dist_thresh: 0.1
directory:
# --------------- Main ---------------
library: /beets
pluginpath: REDACTED
# --------------- Plugins ---------------
plugins: replaygain lyrics fetchart fetchartist info lastgenre types smartplaylist spotify edit chroma filetote
import:
write: yes
autotag: yes
incremental: yes
link: yes
move: no
copy: no
spotify:
source_weight: 0.0
mode: list
tiebreak: popularity
show_failures: no
artist_field: albumartist
album_field: album
track_field: title
region_filter:
regex: []
client_id: REDACTED
client_secret: REDACTED
tokenfile: spotify_token.json
match:
max_rec:
missing_tracks: strong
artist: low
distance_weights:
missing_tracks: 0.1
strong_rec_thresh: 0.1
musicbrainz:
external_ids:
spotify: yes
replaygain:
backend: ffmpeg
overwrite: no
auto: yes
threads: 16
parallel_on_import: no
per_disc: no
peak: 'true'
targetlevel: 89
r128: [Opus]
r128_targetlevel: 84
fetchart:
cautious: yes
sources: filesystem itunes *
auto: yes
minwidth: 0
maxwidth: 0
quality: 0
max_filesize: 0
enforce_ratio: no
cover_names:
- cover
- front
- art
- album
- folder
store_source: no
high_resolution: no
deinterlace: no
cover_format:
google_key: REDACTED
google_engine: 001442825323518660753:hrh5ch1gjzm
fanarttv_key: REDACTED
lastfm_key: REDACTED
lastgenre:
count: 5
prefer_specific: yes
separator: ', '
whitelist: yes
min_weight: 10
fallback:
canonical: no
source: album
force: yes
auto: yes
title_case: yes
types:
added: date
acoustid:
apikey: REDACTED
filetote:
pairing:
enabled: yes
pairing_only: yes
extensions: .lrc
session:
operation:
beets_lib:
import_path:
extensions: ''
filenames: ''
patterns: {}
exclude: ''
paths: {}
print_ignored: no
smartplaylist:
playlist_dir: /playlists
forward_slash: no
playlists:
REDACTED
relative_to:
auto: yes
uri_format:
fields: []
prefix: REDACTED
urlencode: no
pretend_paths: no
output: m3u
fetchartist:
filename: ''
edit:
albumfields: album albumartist
itemfields: track title artist album
ignore_fields: id path
chroma:
auto: yes
```
Contributor guide
Research direction
Start with the `beet import -L -C ` reimport path and the documented reimport behavior for `-C`; compare it with the reported configuration using `link: yes` and `move: no`. Reproduce the metadata change and inspect when the `before_item_moved` and `item_moved` events occur. Done means reimport updates metadata without moving files when `-C` is supplied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100