beets-extrafiles icon indicating copy to clipboard operation
beets-extrafiles copied to clipboard

No files are processed when importing existing/"duplicate" albums

Open kassisaf opened this issue 5 years ago • 1 comments

I noticed during a large import that I was losing a lot of my cue and log files. It seems that when albums that beets sees as existing/duplicate are imported, extrafiles is attempting to move files from the folder you explicitly call the import on, rather than the current album. Could maybe also have something to do with %aunique{} being expanded?

I maintain two copies of Of Monsters and Men's "My Head Is An Animal" album because the Iceland and US releases have different recordings and a slightly different track list.

Here's what happens when I try to import them both at the same time (click for full output, but the relevant snippets are below)

beet -vv import omam

...

extrafiles: S:\Music\old\omam -> S:\Music\Sorted\Of Monsters and Men (My Head Is an Animal by Of Monsters and Men, 23 tracks)

...

$ ls -lhR ../Sorted/Of\ Monsters\ and\ Men/
'../Sorted/Of Monsters and Men/':
total 8.0K
drwxr-xr-x 1 duck 197121 0 Apr 26 16:36 '2011 - My Head Is an Animal'/
drwxr-xr-x 1 duck 197121 0 Apr 26 16:37 '2011 - My Head Is an Animal [US]'/

'../Sorted/Of Monsters and Men/2011 - My Head Is an Animal':
total 328M
-rw-r--r-- 1 duck 197121 27M Apr 26 16:36 '01 - Dirty Paws.flac'
-rw-r--r-- 1 duck 197121 29M Apr 26 16:36 '02 - King and Lionheart.flac'
-rw-r--r-- 1 duck 197121 19M Apr 26 16:36 '03 - Numb Bears.flac'
-rw-r--r-- 1 duck 197121 27M Apr 26 16:36 '04 - Sloom.flac'
-rw-r--r-- 1 duck 197121 30M Apr 26 16:36 '05 - Little Talks.flac'
-rw-r--r-- 1 duck 197121 25M Apr 26 16:36 '06 - From Finner.flac'
-rw-r--r-- 1 duck 197121 37M Apr 26 16:36 '07 - Six Weeks.flac'
-rw-r--r-- 1 duck 197121 22M Apr 26 16:36 '08 - Love Love Love.flac'
-rw-r--r-- 1 duck 197121 27M Apr 26 16:36 '09 - Your Bones.flac'
-rw-r--r-- 1 duck 197121 36M Apr 26 16:36 '10 - Lakehouse.flac'
-rw-r--r-- 1 duck 197121 55M Apr 26 16:36 '11 - Yellow Light.flac'
-rw-r--r-- 1 duck 197121 83K Apr 26 16:36  cover.jpg

'../Sorted/Of Monsters and Men/2011 - My Head Is an Animal [US]':
total 349M
-rw-r--r-- 1 duck 197121  30M Apr 26 16:37 '01 - Dirty Paws.flac'
-rw-r--r-- 1 duck 197121  29M Apr 26 16:37 '02 - King and Lionheart.flac'
-rw-r--r-- 1 duck 197121  26M Apr 26 16:37 '03 - Mountain Sound.flac'
-rw-r--r-- 1 duck 197121  32M Apr 26 16:37 '04 - Slow and Steady.flac'
-rw-r--r-- 1 duck 197121  25M Apr 26 16:37 '05 - From Finner.flac'
-rw-r--r-- 1 duck 197121  31M Apr 26 16:37 '06 - Little Talks.flac'
-rw-r--r-- 1 duck 197121  39M Apr 26 16:37 '07 - Six Weeks.flac'
-rw-r--r-- 1 duck 197121  24M Apr 26 16:37 '08 - Love Love Love.flac'
-rw-r--r-- 1 duck 197121  28M Apr 26 16:37 '09 - Your Bones.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:37 '10 - Sloom.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:37 '11 - Lakehouse.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:37 '12 - Yellow Light.flac'
-rw-r--r-- 1 duck 197121 182K Apr 26 16:37  cover.jpg

Here's how it looks when I import them individually (desired results)

beet -vv import omam/iceland/

...

extrafiles: S:\Music\old\omam\iceland -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal (My Head Is an Animal by Of Monsters and Men, 11 tracks)
extrafiles: Copying extra file: S:\Music\old\omam\iceland\My Head is an Animal.cue -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal\My Head is an Animal.cue
extrafiles: Copying extra file: S:\Music\old\omam\iceland\My Head is an Animal.log -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal\My Head is an Animal.log

...

beet -vv import omam/us/

...

extrafiles: S:\Music\old\omam\us -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal [US] (My Head Is an Animal by Of Monsters and Men, 12 tracks)
extrafiles: Copying extra file: S:\Music\old\omam\us\My Head Is An Animal.cue -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal [US]\My Head Is An Animal.cue
extrafiles: Copying extra file: S:\Music\old\omam\us\Of Monsters And Men - My Head Is An Animal.log -> S:\Music\Sorted\Of Monsters and Men\2011 - My Head Is an Animal [US]\Of Monsters And Men - My Head Is An Animal.log

...

$ ls -lhR ../Sorted/Of\ Monsters\ and\ Men/
'../Sorted/Of Monsters and Men/':
total 8.0K
drwxr-xr-x 1 duck 197121 0 Apr 26 16:42 '2011 - My Head Is an Animal'/
drwxr-xr-x 1 duck 197121 0 Apr 26 16:43 '2011 - My Head Is an Animal [US]'/

'../Sorted/Of Monsters and Men/2011 - My Head Is an Animal':
total 328M
-rw-r--r-- 1 duck 197121  27M Apr 26 16:42 '01 - Dirty Paws.flac'
-rw-r--r-- 1 duck 197121  29M Apr 26 16:42 '02 - King and Lionheart.flac'
-rw-r--r-- 1 duck 197121  19M Apr 26 16:42 '03 - Numb Bears.flac'
-rw-r--r-- 1 duck 197121  27M Apr 26 16:42 '04 - Sloom.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:42 '05 - Little Talks.flac'
-rw-r--r-- 1 duck 197121  25M Apr 26 16:42 '06 - From Finner.flac'
-rw-r--r-- 1 duck 197121  37M Apr 26 16:42 '07 - Six Weeks.flac'
-rw-r--r-- 1 duck 197121  22M Apr 26 16:42 '08 - Love Love Love.flac'
-rw-r--r-- 1 duck 197121  27M Apr 26 16:42 '09 - Your Bones.flac'
-rw-r--r-- 1 duck 197121  36M Apr 26 16:42 '10 - Lakehouse.flac'
-rw-r--r-- 1 duck 197121  55M Apr 26 16:42 '11 - Yellow Light.flac'
-rw-r--r-- 1 duck 197121  83K Apr 26 16:42  cover.jpg
-rw-r--r-- 1 duck 197121 1.9K Apr 26 16:42 'My Head is an Animal.cue'
-rw-r--r-- 1 duck 197121  22K Apr 26 16:42 'My Head is an Animal.log'

'../Sorted/Of Monsters and Men/2011 - My Head Is an Animal [US]':
total 349M
-rw-r--r-- 1 duck 197121  30M Apr 26 16:43 '01 - Dirty Paws.flac'
-rw-r--r-- 1 duck 197121  29M Apr 26 16:43 '02 - King and Lionheart.flac'
-rw-r--r-- 1 duck 197121  26M Apr 26 16:43 '03 - Mountain Sound.flac'
-rw-r--r-- 1 duck 197121  32M Apr 26 16:43 '04 - Slow and Steady.flac'
-rw-r--r-- 1 duck 197121  25M Apr 26 16:43 '05 - From Finner.flac'
-rw-r--r-- 1 duck 197121  31M Apr 26 16:43 '06 - Little Talks.flac'
-rw-r--r-- 1 duck 197121  39M Apr 26 16:43 '07 - Six Weeks.flac'
-rw-r--r-- 1 duck 197121  24M Apr 26 16:43 '08 - Love Love Love.flac'
-rw-r--r-- 1 duck 197121  28M Apr 26 16:43 '09 - Your Bones.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:43 '10 - Sloom.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:43 '11 - Lakehouse.flac'
-rw-r--r-- 1 duck 197121  30M Apr 26 16:43 '12 - Yellow Light.flac'
-rw-r--r-- 1 duck 197121 182K Apr 26 16:43  cover.jpg
-rw-r--r-- 1 duck 197121 2.1K Apr 26 16:43 'My Head Is An Animal.cue'
-rw-r--r-- 1 duck 197121  14K Apr 26 16:43 'Of Monsters And Men - My Head Is An Animal.log'

And here's my beets config

paths:
    default: %the{$albumartist}/$year_prefer_orig - $album%aunique{,country format year catalognum}/$disc_and_track - $title

...

extrafiles:
    patterns:
        cuelog:
            - '*.cue'
            - '*.log'
        info:
            - 'info.txt'
            - 'source.txt'
            - 'release.txt'
    paths:
        cuelog: '$albumpath/$filename'
        info: '$albumpath/$filename'

kassisaf avatar Apr 27 '19 00:04 kassisaf

The culprit is this code snippet: https://github.com/Holzhaus/beets-extrafiles/blob/master/beetsplug/extrafiles.py#L163-L165

I'll see if I can come up with something better (possibly using the musicbrainz release id?) when I have some spare time. Feel free to open a PR if you don't want to wait.

Holzhaus avatar May 16 '19 19:05 Holzhaus