Problem with merging tracks into albums when importing

When importing with autotagging I noticed:

Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,                                                                                      
Enter search, enter Id, aBort, plaY? A                                                                                                                 
This album is already in the library!                                                                                                                  
Old: 11 items, MP3, 320kbps, 35:35, 95.6 MiB                                                                                                           
Old: 19 items, MP3, 320kbps, 61:10, 144.4 MiB                                                                                                          
New: 1 items, MP3, 258kbps, 2:44, 5.2 MiB                                                                                                              
[S]kip new, Keep all, Remove old, Merge all? M

So it looks like it didn’t properly merge stuff. I’m not looking forward to manually check every single music folder.

I often chose “merge” to complete albums with missing tracks.

So how do I check or is there a way to check my existing music for doubles and have beets fix it?

Running beets inside docker with the music and downloads folder mapped into the container. The command I use to import:

docker exec -u abc -it beets /bin/bash -c ‘beet import /mnt/downloads/completed/music/*’

I can share my config if needed?

Hello! Could you elaborate a little bit on what went wrong here? What happens after you choose “M”—as in, what’s in your database for the relevant album if you do beet ls and beet ls -a with an appropriate query?

Hi and thanks for trying to help. Let me see what info I can add to my initial post.

I had a cron job (with the -q for quiet option beet import -q) going off every 4h to auto-import music from a specific folder. I changed that cron job to once every 24h as I thought it might have crashed with my manual imports.
Every now and then I’d execute the above command without the -q and fix whatever could not automatically be imported.

During my manual imports, I saw the above issue with multiple old files existing. I remember checking the music library folder and indeed finding songs like song-name.1.mp3 song-name.2.mp3 etc…. So there definitely were leftovers from beets imports.

Also while manually running these imports a few times I had beets crash and give me some python errors which looked like parts of code from scripts. Unfortunately I haven’t noted them down. :frowning:

I’ve chosen “-M” a few times, it seems to work but then later either beets crashed or whatnot, sometimes I found that the imported music files had not been moved to the library folder as they should have.

I can’t remember which artist/album had the multiple old files issue, so I started poking around and found this mess.

image

  • there are multiple folders for the Back to Black and Frank album
  • some of them have cryptic numbers at the end
  • the last 3 folders only contain albumart.jpg
  • the 4th folder from the bottom contains exactly 1 song

I also found that another artist somehow has 2 albums with the same name, except for a capital A instead of an a. I have no idea how this happened since all music in my music library has been processed and put there by beets. Any ideas?

image

I’ll share my beets config.yaml here: config.yaml - Pastebin.com

oh, here’s another folder from my library with clear problems: Bossa nova.

ls -al /Music/Ana\ Caram/                                                                                              
total 501                                                                                                                                            
drwxrwx---   10 1000 1000   10 Oct  9 13:39  .                                                                                                       
drwxrwx--- 1043 1000 1000 1043 Oct  6 01:47  ..                                                                                                      
drwxrwx---    2 1000 1000   15 Oct  8 05:09  Amazonia                                                                                                
drwxrwx---    2 1000 1000    3 Oct  9 13:39 'Bossa nova'                                                                                             
drwxrwx---    2 1000 1000   15 Oct  9 13:39 'Bossa nova [2802]'                                                                                      
drwxrwx---    2 1000 1000   15 Oct  4 22:06 'Hollywood Rio'                                                                                          
drwxrwx---    2 1000 1000   17 Jun 18 23:51 'Postcards from Rio_ The Ana Caram Collection'                                                           
drwxrwx---    2 1000 1000   18 Oct  8 05:15 'Rio After Dark'                                                                                         
drwxrwx---    2 1000 1000   12 Jun 18 23:52 'Sunflower Time'                                                                                         
drwxrwx---    2 1000 1000   14 Oct  8 05:18 'The Other Side of Jobim'                                                                                
ls -al /Music/Ana\ Caram/Bossa\ nova                                                                                   
total 3103                                                                                                                                           
drwxrwx---  2 1000 1000       3 Oct  9 13:39  .                                                                                                      
drwxrwx--- 10 1000 1000      10 Oct  9 13:39  ..                                                                                                     
-rwxrwx---  1 1000 1000 3079547 Jun 18 23:49 '03 - Rio.mp3'                                                                                          
ls -al /Music/Ana\ Caram/Bossa\ nova\ \[2802\]/                                                                        
total 46907                                                                                                                                          
drwxrwx---  2 1000 1000      15 Oct  9 13:39  .                                                                                                      
drwxrwx--- 10 1000 1000      10 Oct  9 13:39  ..                                                                                                     
-rw-rw----  1 1000 1000 3579517 Oct  9 13:41 '01 - Chega de saudade (No More Blues).mp3'                                                             
-rw-rw----  1 1000 1000 3280524 Oct  9 13:41 '02 - Samba de verao (Summer Samba).mp3'                                                                
-rw-rw----  1 1000 1000 4711354 Oct  9 13:41 '03 - Rio.mp3'                                                                                          
-rw-rw----  1 1000 1000 5496813 Oct  9 13:41 '04 - Garota de Ipanema (Girl from Ipanema).mp3'                                                        
-rw-rw----  1 1000 1000 4083587 Oct  9 13:41 '05 - Agua de beber (Water to Drink).mp3'                                                               
-rw-rw----  1 1000 1000 3322140 Oct  9 13:41 '06 - Chovendo na roseira (Double Rainbow).mp3'                                                         
-rw-rw----  1 1000 1000 4897096 Oct  9 13:41 '07 - O amor em paz (Once I Loved).mp3'                                                                 
-rw-rw----  1 1000 1000 3253648 Oct  9 13:41 '08 - O pato (The Duck).mp3'                                                                            
-rw-rw----  1 1000 1000 3805341 Oct  9 13:41 '09 - Voce vai ver (You'\''ll See).mp3'                                                                 
-rw-rw----  1 1000 1000 2648260 Oct  9 13:41 '10 - Brigas, nunca mais (No More Quarrels).mp3'                                                        
-rw-rw----  1 1000 1000 4099699 Oct  9 13:41 '11 - Olha pro ceu (Look to the Sky).mp3'                                                               
-rw-rw----  1 1000 1000 4290193 Oct  9 13:41 '12 - Samba do aviao (Song of the Jet).mp3'                                                             
-rwxrwx---  1 1000 1000   37936 Jun 18 23:49  albumart.jpg

I am now doing a:
docker exec -u abc -it beets /bin/bash -c 'beet import /mnt/downloads/completed/music/Ana*'

lets see what happens. I will report below. So far, beets sees a new album and I chose “Apply”

> docker exec -u abc -it beets /bin/bash -c 'beet import  /mnt/downloads/completed/music/Ana*'                                 
>                                                                                                                                                      
> /mnt/downloads/completed/music/Ana Caram/Bossa Nova (11 items)                                                                                       
> Correcting tags from:                                                                                                                                
>     Ana Caram - Bossa Nova                                                                                                                           
> To:                                                                                                                                                  
>     Ana Caram - Bossa nova                                                                                                                           
> URL:                                                                                                                                                 
>     https://musicbrainz.org/release/94b76471-d52e-490c-ba1f-e89549ec1f0b                                                                             
> (Similarity: 92.6%) (tracks, missing tracks) (CD, 1995, US, Chesky Records, JD129)                                                                   
>  * Chega de Saudade              -> Chega de saudade (No More Blues) (title)                                                                         
>  * Summer Samba (Samba de Verão) -> Samba de verão (Summer Samba) (title)                                                                            
>  * Garota de Ipanema             -> Garota de Ipanema (Girl from Ipanema) (title)                                                                    
>  * Agua de Beber                 -> Agua de beber (Water to Drink) (title)                                                                           
>  * Chovendo Na Roseira           -> Chovendo na roseira (Double Rainbow) (title)                                                                     
>  * O Amor Em Paz                 -> O amor em paz (Once I Loved) (title)                                                                             
>  * O Pato                        -> O pato (The Duck) (title)                                                                                        
>  * Você Vai Ver                  -> Você vai ver (You'll See) (title)                                                                                
>  * Brigas, Nunca Mais            -> Brigas, nunca mais (No More Quarrels) (title)                                                                    
>  * Olha Pro Céu                  -> Olha pro céu (Look to the Sky) (title)                                                                           
>  * Samba Do Avião                -> Samba do avião (Song of the Jet) (title)                                                                         
> Missing tracks (1/12 - 8.3%):                                                                                                                        
>  ! Rio (# 3) (3:15)                                                                                                                                  
> [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,                                                                                  
> Enter search, enter Id, aBort, plaY? A                                 
> This album is already in the library!                                                                                                                
> Old: 1 items, MP3, 128kbps, 3:09, 2.9 MiB                                                                                                            
> Old: 12 items, MP3, 133kbps, 47:13, 45.3 MiB                                                                                                         
> New: 11 items, MP3, 192kbps, 45:04, 62.3 MiB
> [S]kip new, Keep all, Remove old, Merge all? M
> 
> /mnt/downloads/completed/music/Ana Caram/Bossa Nova                                                                                                  
> /music/Ana Caram/Bossa nova/03 - Rio.mp3                                                                                                             
> /music/Ana Caram/Bossa nova [2802]/01 - Chega de saudade (No More Blues).mp3                                                                         
> /music/Ana Caram/Bossa nova [2802]/02 - Samba de verao (Summer Samba).mp3                                                                            
> /music/Ana Caram/Bossa nova [2802]/03 - Rio.mp3                                                                                                      
> /music/Ana Caram/Bossa nova [2802]/04 - Garota de Ipanema (Girl from Ipanema).mp3                                                                    
> /music/Ana Caram/Bossa nova [2802]/05 - Agua de beber (Water to Drink).mp3                                                                           
> /music/Ana Caram/Bossa nova [2802]/06 - Chovendo na roseira (Double Rainbow).mp3                                                                     
> /music/Ana Caram/Bossa nova [2802]/07 - O amor em paz (Once I Loved).mp3                                                                             
> /music/Ana Caram/Bossa nova [2802]/08 - O pato (The Duck).mp3                                                                                        
> /music/Ana Caram/Bossa nova [2802]/09 - Voce vai ver (You'll See).mp3                                                                                
> /music/Ana Caram/Bossa nova [2802]/10 - Brigas, nunca mais (No More Quarrels).mp3                                                                    
> /music/Ana Caram/Bossa nova [2802]/11 - Olha pro ceu (Look to the Sky).mp3                                                                           
> /music/Ana Caram/Bossa nova [2802]/12 - Samba do aviao (Song of the Jet).mp3 (24 items)                                                              
> Tagging:                                                                                                                                             
>     Ana Caram - Bossa nova                                                                                                                           
> URL:                                                                                                                                                 
>     https://musicbrainz.org/release/94b76471-d52e-490c-ba1f-e89549ec1f0b                                                                             
> (Similarity: 84.6%) (unmatched tracks, tracks) (CD, 1995, US, Chesky Records, JD129)                                                                 
>  * O amor em paz (Once I Loved) (5:02) -> O amor em paz (Once I Loved) (5:13) (length)                                                               
> Unmatched tracks (12):                                                                                                                               
>  ! Chega de Saudade              (# 1) (3:48)                                                                                                        
>  ! Summer Samba (Samba de Verão) (# 2) (3:25)                                                                                                        
>  ! Garota de Ipanema             (# 4) (5:45)                                                                                                        
>  ! Agua de Beber                 (# 5) (4:16)                                                                                                        
>  ! Chovendo Na Roseira           (# 6) (3:28)                                                                                                        
>  ! O Amor Em Paz                 (# 7) (5:13)                                                                                                        
>  ! O Pato                        (# 8) (3:23)                                                                                                        
>  ! Você Vai Ver                  (# 9) (4:00)                                                                                                        
>  ! Brigas, Nunca Mais            (#10) (2:47)                                                                                                        
>  ! Olha Pro Céu                  (#11) (4:20)                                                                                                        
>  ! Samba Do Avião                (#12) (4:35)                                                                                                        
>  ! Rio                           (# 3) (3:15)                                                                                                        
> [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,                                                                                  
> Enter search, enter Id, aBort, plaY? M

And the result of that:

ls -al /sixer/Music/Ana\ Caram/                                                                                              
total 469                                                                                                                                            
drwxrwx---   10 1000 1000   10 Oct 10 10:18  .                                                                                                       
drwxrwx--- 1043 1000 1000 1043 Oct  6 01:47  ..                                                                                                      
drwxrwx---    2 1000 1000   15 Oct  8 05:09  Amazonia                                                                                                
drwxrwx---    2 1000 1000    3 Oct 10 10:19 'Bossa nova [2802]'                                                                                      
drwxrwx---    2 1000 1000   15 Oct 10 10:19 'Bossa nova [2803]'

That’s interesting! Given the background, it’s kind of hard to see exactly what happened in the past that led to this… we’re only seeing the “after the fact” evidence and making inferences.

Is there any way you could try to reproduce this pattern by manually invoking a similar import a few times?

Sure can do.

docker exec -u abc -it beets /bin/bash -c 'beet import  /mnt/downloads/completed/music/Ana*' 

/mnt/downloads/completed/music/Ana Caram/Bossa Nova (11 items)                                                                                       
Correcting tags from:                                                                                                                                
    Ana Caram - Bossa Nova                                                                                                                           
To:                                                                                                                                                  
    Ana Caram - Bossa nova                                                                                                                           
URL:                                                                                                                                                 
    https://musicbrainz.org/release/94b76471-d52e-490c-ba1f-e89549ec1f0b                                                                             
(Similarity: 92.4%) (tracks, missing tracks) (CD, 1995, US, Chesky Records, JD129)                                                                   
 * Chega de Saudade              -> Chega de saudade (No More Blues) (title)                                                                         
 * Summer Samba (Samba de Verão) -> Samba de verão (Summer Samba) (title)                                                                            
 * Garota de Ipanema             -> Garota de Ipanema (Girl from Ipanema) (title)                                                                    
 * Agua de Beber                 -> Agua de beber (Water to Drink) (title)                                                                           
 * Chovendo Na Roseira           -> Chovendo na roseira (Double Rainbow) (title)                                                                     
 * O Amor Em Paz                 -> O amor em paz (Once I Loved) (title)                                                                             
 * O Pato                        -> O pato (The Duck) (title)                                                                                        
 * Você Vai Ver                  -> Você vai ver (You'll See) (title)                                                                                
 * Brigas, Nunca Mais            -> Brigas, nunca mais (No More Quarrels) (title)                                                                    
 * Olha Pro Céu                  -> Olha pro céu (Look to the Sky) (title)                                                                           
 * Samba Do Avião                -> Samba do avião (Song of the Jet) (title)                                                                         
Missing tracks (1/12 - 8.3%):                                                                                                                        
 ! Rio (# 3) (3:15)                                                                                                                                  
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,                                                                                  
Enter search, enter Id, aBort, plaY? A   
This album is already in the library!                                                                                                                
Old: 1 items, MP3, 192kbps, 3:15, 4.5 MiB                                                                                                            
Old: 12 items, MP3, 128kbps, 47:07, 43.7 MiB                                                                                                         
New: 11 items, MP3, 192kbps, 45:04, 62.3 MiB                                                                                                         
[S]kip new, Keep all, Remove old, Merge all? M
                                                                                                                                                     
/mnt/downloads/completed/music/Ana Caram/Bossa Nova                                                                                                  
/music/Ana Caram/Bossa nova [2802]/03 - Rio.mp3                                                                                                      
/music/Ana Caram/Bossa nova [2803]/01 - Chega de saudade (No More Blues).mp3                                                                         
/music/Ana Caram/Bossa nova [2803]/02 - Samba de verao (Summer Samba).mp3                                                                            
/music/Ana Caram/Bossa nova [2803]/03 - Rio.mp3                                                                                                      
/music/Ana Caram/Bossa nova [2803]/04 - Garota de Ipanema (Girl from Ipanema).mp3                                                                    
/music/Ana Caram/Bossa nova [2803]/05 - Agua de beber (Water to Drink).mp3                                                                           
/music/Ana Caram/Bossa nova [2803]/06 - Chovendo na roseira (Double Rainbow).mp3                                                                     
/music/Ana Caram/Bossa nova [2803]/07 - O amor em paz (Once I Loved).mp3                                                                             
/music/Ana Caram/Bossa nova [2803]/08 - O pato (The Duck).mp3                                                                                        
/music/Ana Caram/Bossa nova [2803]/09 - Voce vai ver (You'll See).mp3                                                                                
/music/Ana Caram/Bossa nova [2803]/10 - Brigas, nunca mais (No More Quarrels).mp3                                                                    
/music/Ana Caram/Bossa nova [2803]/11 - Olha pro ceu (Look to the Sky).mp3                                                                           
/music/Ana Caram/Bossa nova [2803]/12 - Samba do aviao (Song of the Jet).mp3 (24 items)                                                              
Tagging:                                                                                                                                             
    Ana Caram - Bossa nova                                                                                                                           
URL:                                                                                                                                                 
    https://musicbrainz.org/release/94b76471-d52e-490c-ba1f-e89549ec1f0b                                                                             
(Similarity: 84.6%) (unmatched tracks, tracks) (CD, 1995, US, Chesky Records, JD129)                                                                 
 * O amor em paz (Once I Loved) (5:02) -> O amor em paz (Once I Loved) (5:13) (length)                                                               
Unmatched tracks (12):                                                                                                                               
 ! Chega de Saudade              (# 1) (3:48)                                                                                                        
 ! Summer Samba (Samba de Verão) (# 2) (3:25)                                                                                                        
 ! Garota de Ipanema             (# 4) (5:45)                                                                                                        
 ! Agua de Beber                 (# 5) (4:16)                                                                                                        
 ! Chovendo Na Roseira           (# 6) (3:28)                                                                                                        
 ! O Amor Em Paz                 (# 7) (5:13)                                                                                                        
 ! O Pato                        (# 8) (3:23)                                                                                                        
 ! Você Vai Ver                  (# 9) (4:00)                                                                                                        
 ! Brigas, Nunca Mais            (#10) (2:47)                                                                                                        
 ! Olha Pro Céu                  (#11) (4:20)                                                                                                        
 ! Samba Do Avião                (#12) (4:35)                                                                                                        
 ! Rio                           (# 3) (3:09)                                                                                                        
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,                                                                                  
Enter search, enter Id, aBort, plaY? A   
acousticbrainz: Acousticbrainz did not provide infoabout highlevel                                                                                   
acousticbrainz: Acousticbrainz did not provide infoabout lowlevel                                                                                    
acousticbrainz: Acousticbrainz did not provide infoabout rhythm                                                                                      
acousticbrainz: Acousticbrainz did not provide infoabout tonal                                                                                       
acousticbrainz: Acousticbrainz did not provide infoabout lowlevel                                                                                    
acousticbrainz: Acousticbrainz did not provide infoabout rhythm                                                                                      
acousticbrainz: Acousticbrainz did not provide infoabout tonal                                                                                       
acousticbrainz: Acousticbrainz did not provide infoabout highlevel                                                                                   
acousticbrainz: Acousticbrainz did not provide infoabout lowlevel                                                                                    
acousticbrainz: Acousticbrainz did not provide infoabout rhythm                                                                                      
acousticbrainz: Acousticbrainz did not provide infoabout tonal                                                                                       
acousticbrainz: Acousticbrainz did not provide infoabout highlevel                                                                                   
acousticbrainz: Acousticbrainz did not provide infoabout highlevel
...

and the result is:

ls -al /sixer/Music/Ana\ Caram/
total 469
drwxrwx— 10 1000 1000 10 Oct 12 10:11 .
drwxrwx— 1043 1000 1000 1043 Oct 6 01:47 …
drwxrwx— 2 1000 1000 15 Oct 8 05:09 Amazonia
drwxrwx— 2 1000 1000 3 Oct 12 10:11 ‘Bossa nova [2803]’
drwxrwx— 2 1000 1000 15 Oct 12 10:11 ‘Bossa nova [2804]’
drwxrwx— 2 1000 1000 15 Oct 4 22:06 ‘Hollywood Rio’
drwxrwx— 2 1000 1000 17 Jun 18 23:51 ‘Postcards from Rio_ The Ana Caram Collection’
drwxrwx— 2 1000 1000 18 Oct 8 05:15 ‘Rio After Dark’
drwxrwx— 2 1000 1000 12 Jun 18 23:52 ‘Sunflower Time’
drwxrwx— 2 1000 1000 14 Oct 8 05:18 ‘The Other Side of Jobim’

as we can see, the folders with the numbers went one up from 2802 and 2803 to 2803 and 2804 while the original files to be imported are still in the downloads folder.

ls -al /sixer/tmp/downloads/completed/music/Ana\ Caram/Bossa\ Nova/                                                          
total 64279                                                                                                                                          
drwxrwxr-x 2 1000 1000      13 Oct  9 13:39  .                                                                                                       
drwxrwxr-x 3 1000 1000       3 Oct  8 05:19  ..                                                                                                      
-rw-rw-r-- 1 1000 1000 5511040 Oct  7 19:01 '01 Chega de Saudade.mp3'                                                                                
-rw-rw-r-- 1 1000 1000 4968320 Oct  7 19:01 '02 Summer Samba (Samba de Verão).mp3'                                                                   
-rw-rw-r-- 1 1000 1000 8331136 Oct  7 19:01 '04 Garota de Ipanema.mp3'                                                                               
-rw-rw-r-- 1 1000 1000 6188928 Oct  7 19:01 '05 Agua de Beber.mp3'                                                                                   
-rw-rw-r-- 1 1000 1000 5027712 Oct  7 19:01 '06 Chovendo Na Roseira.mp3'                                                                             
-rw-rw-r-- 1 1000 1000 7577472 Oct  7 19:01 '07 O Amor Em Paz.mp3'                                                                                   
-rw-rw-r-- 1 1000 1000 4913024 Oct  7 19:01 '08 O Pato.mp3'                                                                                          
-rw-rw-r-- 1 1000 1000 5797760 Oct  7 19:01 '09 Você Vai Ver.mp3'                                                                                    
-rw-rw-r-- 1 1000 1000 4038528 Oct  7 19:01 '10 Brigas, Nunca Mais.mp3'                                                                              
-rw-rw-r-- 1 1000 1000 6287232 Oct  7 19:01 '11 Olha Pro Céu.mp3'                                                                                    
-rw-rw-r-- 1 1000 1000 6639488 Oct  7 19:01 '12 Samba Do Avião.mp3'

Apart from the import problem, would “beet update” fix the existing library problems or will it not touch and move files/albums? I tried the “-p” option and it ran forever and spit out loads of changes it would presumably do but msot were just dealing with bpm info and some such unrelated stuff.

docker exec -u abc -it beets /bin/bash -c 'beet update -p'

Anyone got any hints for me please?