beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.95k stars 1.82k forks source link

Autotag increments filename when set to no #5035

Open kirkegaard opened 11 months ago

kirkegaard commented 11 months ago

When importing an album that already exists, beets seems to increment and add .1 to the filename. Is it supposed to do that even when incremential is turned off? This only happens if i set autotag to no. If set to yes it works as expected.

I have one big folder with all my music (/mnt/Music/Library/) and then i have Lidarr add music to that folder.

Problem

$ beet -vv import /mnt/Music/Library/YELLOW\ MAGIC\ ORCHESTRA/YMO/
user configuration: /home/christian/.config/beets/config.yaml
data directory: /home/christian/.config/beets
plugin paths:
Sending event: pluginload
library database: /home/christian/.config/beets/library.db
library directory: /mnt/Music/Library
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
/mnt/Music/Library/YELLOW MAGIC ORCHESTRA/YMO
0 of 15 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
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
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
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
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
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
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
Sending event: database_change
Sending event: import_task_files
Sending event: album_imported
Sending event: import
Sending event: cli_exit

$ beet ls --path yellow magic
/mnt/Music/Library/Yellow Magic Orchestra/YMO/01 Firecracker.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/02 Cosmic Surfin’.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/03 La Femme Chinoise.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/04 Tong Poo.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/05 Day Tripper.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/06 Behind the Mask.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/07 Rydeen.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/08 Tighten Up (Japanese Gentlemen Stand Up Please!).m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/09 U T.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/10 1000 Knives.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/11 Mass.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/12 Camouflage.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/13 Light in Darkness.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/14 Epilogue.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/15 Key.m4a

$ ls -al /mnt/Music/Library/YELLOW\ MAGIC\ ORCHESTRA/YMO/
total 171504
drwxr-xr-x 2 christian media        0 Dec  7 15:58  .
drwxr-xr-x 2 christian media        0 Dec  7 12:51  ..
-rwxr-xr-x 1 christian media 12541726 Dec  7 15:06 '01 Firecracker.m4a'
-rwxr-xr-x 1 christian media 11585621 Dec  7 15:06 '02 Cosmic Surfin’.m4a'
-rwxr-xr-x 1 christian media 14970226 Dec  7 15:06 '03 La Femme Chinoise.m4a'
-rwxr-xr-x 1 christian media 16027504 Dec  7 15:06 '04 Tong Poo.m4a'
-rwxr-xr-x 1 christian media  7537006 Dec  7 15:06 '05 Day Tripper.m4a'
-rwxr-xr-x 1 christian media  9415674 Dec  7 15:06 '06 Behind the Mask.m4a'
-rwxr-xr-x 1 christian media 11538057 Dec  7 15:06 '07 Rydeen.m4a'
-rwxr-xr-x 1 christian media  9783722 Dec  7 15:06 '08 Tighten Up (Japanese Gentlemen Stand Up Please!).m4a'
-rwxr-xr-x 1 christian media 11727140 Dec  7 15:06 '09 U T.m4a'
-rwxr-xr-x 1 christian media 13749436 Dec  7 15:06 '10 1000 Knives.m4a'
-rwxr-xr-x 1 christian media 11465758 Dec  7 15:06 '11 Mass.m4a'
-rwxr-xr-x 1 christian media 11689930 Dec  7 15:06 '12 Camouflage.m4a'
-rwxr-xr-x 1 christian media  9543985 Dec  7 15:06 '13 Light in Darkness.m4a'
-rwxr-xr-x 1 christian media 11265766 Dec  7 15:06 '14 Epilogue.m4a'
-rwxr-xr-x 1 christian media 12009765 Dec  7 15:06 '15 Key.m4a'
-rwxr-xr-x 1 christian media     1802 Dec  5 11:32  album.nfo
-rwxr-xr-x 1 christian media   736808 Dec  5 11:32  folder.jpg

$ beet -vv import /mnt/Music/Library/YELLOW\ MAGIC\ ORCHESTRA/YMO/
user configuration: /home/christian/.config/beets/config.yaml
data directory: /home/christian/.config/beets
plugin paths:
Sending event: pluginload
library database: /home/christian/.config/beets/library.db
library directory: /mnt/Music/Library
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
/mnt/Music/Library/YELLOW MAGIC ORCHESTRA/YMO
0 of 15 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
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
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
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
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: before_item_moved
Sending event: item_moved
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
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
Sending event: database_change
Sending event: import_task_files
Sending event: album_imported
Sending event: import
Sending event: cli_exit

$ beet ls --path yellow magic
/mnt/Music/Library/Yellow Magic Orchestra/YMO/01 Firecracker.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/01 Firecracker.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/02 Cosmic Surfin’.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/02 Cosmic Surfin’.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/03 La Femme Chinoise.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/03 La Femme Chinoise.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/04 Tong Poo.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/04 Tong Poo.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/05 Day Tripper.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/05 Day Tripper.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/06 Behind the Mask.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/06 Behind the Mask.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/07 Rydeen.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/07 Rydeen.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/08 Tighten Up (Japanese Gentlemen Stand Up Please!).m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/08 Tighten Up (Japanese Gentlemen Stand Up Please!).1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/09 U T.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/09 U T.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/10 1000 Knives.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/10 1000 Knives.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/11 Mass.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/11 Mass.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/12 Camouflage.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/12 Camouflage.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/13 Light in Darkness.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/13 Light in Darkness.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/14 Epilogue.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/14 Epilogue.1.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/15 Key.m4a
/mnt/Music/Library/Yellow Magic Orchestra/YMO/15 Key.1.m4a

$ ls -al /mnt/Music/Library/YELLOW\ MAGIC\ ORCHESTRA/YMO/
total 171504
drwxr-xr-x 2 christian media        0 Dec  7 15:58  .
drwxr-xr-x 2 christian media        0 Dec  7 12:51  ..
-rwxr-xr-x 1 christian media 12541726 Dec  7 15:06 '01 Firecracker.1.m4a'
-rwxr-xr-x 1 christian media 11585621 Dec  7 15:06 '02 Cosmic Surfin’.1.m4a'
-rwxr-xr-x 1 christian media 14970226 Dec  7 15:06 '03 La Femme Chinoise.1.m4a'
-rwxr-xr-x 1 christian media 16027504 Dec  7 15:06 '04 Tong Poo.1.m4a'
-rwxr-xr-x 1 christian media  7537006 Dec  7 15:06 '05 Day Tripper.1.m4a'
-rwxr-xr-x 1 christian media  9415674 Dec  7 15:06 '06 Behind the Mask.1.m4a'
-rwxr-xr-x 1 christian media 11538057 Dec  7 15:06 '07 Rydeen.1.m4a'
-rwxr-xr-x 1 christian media  9783722 Dec  7 15:06 '08 Tighten Up (Japanese Gentlemen Stand Up Please!).1.m4a'
-rwxr-xr-x 1 christian media 11727140 Dec  7 15:06 '09 U T.1.m4a'
-rwxr-xr-x 1 christian media 13749436 Dec  7 15:06 '10 1000 Knives.1.m4a'
-rwxr-xr-x 1 christian media 11465758 Dec  7 15:06 '11 Mass.1.m4a'
-rwxr-xr-x 1 christian media 11689930 Dec  7 15:06 '12 Camouflage.1.m4a'
-rwxr-xr-x 1 christian media  9543985 Dec  7 15:06 '13 Light in Darkness.1.m4a'
-rwxr-xr-x 1 christian media 11265766 Dec  7 15:06 '14 Epilogue.1.m4a'
-rwxr-xr-x 1 christian media 12009765 Dec  7 15:06 '15 Key.1.m4a'
-rwxr-xr-x 1 christian media     1802 Dec  5 11:32  album.nfo
-rwxr-xr-x 1 christian media   736808 Dec  5 11:32  folder.jpg

Setup

My configuration (output of beet config) is:

library: ~/.config/beets/library.db
directory: /mnt/Music/Library

paths:
  default: $albumartist/$album/$track $title
  singleton: $artist/Non-Album/$title
  albumtype:soundtrack: Soundtracks/$album/$track $title
  comp: Compilations/$album/$track $title

original_date: yes
per_disc_numbering: yes
threaded: yes
asciify_path: yes
clutter: [
  .DS_Store,
  Thumbs.DB
]

plugins: [
  duplicates,
  spotify
]

import:
  copy: yes
  write: yes
  move: yes
  group_albums: no
  default_action: skip
  duplicate_action: skip
  quiet_fallback: skip
  log: ~/.config/beets/import.log
  incremental: no
  incremental_skip_later: no
  detail: no
  timid: no
  autotag: no
DjSlash commented 11 months ago

Is it supposed to do that even when incremential is turned off?

If you mean setting incremental in your config to no with this, then your expectations are incorrect. This setting is for skipping directories that are already imported.

I see also that you have copy AND move set to yes. While move overrides copy, it's better to keep just one of those in your config, keeping it simpler.

What strange is:

sampsyo commented 11 months ago

Indeed; @DjSlash is right here: the .1 marker is just beets's response when it tries to put a file somewhere where a file already exists.

There's something odd about the way you've set up your config: you are importing from and to the same directory (/mnt/Music/Library), and you have copy: yes set. This will mean that you have two copies of the same files in the same directory. It's actually not clear to me what happens when you simultaneously set copy: yes and move: yes at the same time; you probably want to pick one or the other. (And even better if you can spare to separate your "incoming"/unorganized Lidarr directory from your organized library directory.)

kirkegaard commented 11 months ago

You're both right that having both copy and move doesnt make sense. Ive removed the copy but it seems to still happen. I've actually tried importing from a different folder outside my library but that just results in doubling the files which i guess makes sense since i have autotag turned off.

-rwxr-xr-x 1 christian media 12541726 Dec 10 23:44 '01 Firecracker.1.m4a'
-rwxr-xr-x 1 christian media 12541726 Dec 10 23:45 '01 Firecracker.2.m4a'
-rwxr-xr-x 1 christian media 12541726 Dec 10 23:45 '01 Firecracker.3.m4a'
-rwxr-xr-x 1 christian media 12541726 Jun 15  2011 '01 Firecracker.m4a'

I made a quick test with the same config file on my macbook and here it seemed to do exactly what i expected. I wonder if it could have to do with how my share is set up and that beets has trouble fingerprinting the files? How exactly does beets determine if a file is a duplicate?

sampsyo commented 11 months ago

Hmm; I don't think fingerprinting is the problem here. The issue is that beets wants to put a file at path X, but it finds that a file already exists at path X, so it needs to avoid the conflict.

Maybe a verbose log when importing with copying off would help?