# VA / compilation tracks being duplicated on each import

**URL:** <https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881>\
**Category:** Help\
**Created:** [August 16, 2019, 4:20am UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881 "2019-08-16T04:20:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![philo](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philo](https://discourse.beets.io/u/philo)\
**Post date:** [August 16, 2019, 4:20am UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/1 "2019-08-16T04:20:31Z")

</div>

Hello,

I need some help finalizing my config. It can be found here - [https://pastebin.com/Ta9XPPXd](https://pastebin.com/Ta9XPPXd)

Problem Overview:  
Tracks in VA / comps are being duplicated on each import. It’s also not labeling/naming various artist and comp releases properly + lumping multiple comps together in odd ways.

This has left me with a VA folder full of mislabeled releases with up to 30+ duplicates of each song (1 per import).

All single artist non VA / Comp releases are being categorized and named correctly.

I’m categorizing everything alphabetically, then naming each album by  
Artist - Year - album {LABEL - RELEASE Number - release year - Format} [Quality]

i.e. EELS - 1996 - Beautiful Freak {DreamWorks Records - DRD 50012 - 1997 - DE - CD} [FLAC]

There are some other oddities but that’s the big one I need to resolve right now.

Any help would be greatly appreciated, I’m lost at this point.

---

<div class="post-metadata">

**Author:** ![arogl](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/arogl/32/455_2.png) [@arogl](https://discourse.beets.io/u/arogl)\
**Post date:** [August 16, 2019, 5:17am UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/2 "2019-08-16T05:17:35Z")

</div>

Add the following lines to your config:

```auto
    albumartist:various\ artists: VA/%bucket{%asciify{%left{%the{$album},2}}}/$album - %if{$original_year,$original_year,$year} %if{$u_version,{$u_version$} }[$u_format]/$disc_and_track - $artist - $title 
    albumartist:various: VA/%bucket{%asciify{%left{%the{$album},2}}}/$album - %if{$original_year,$original_year,$year} %if{$u_version,{$u_version$} }[$u_format]/$disc_and_track - $artist - $title

```

I found not all VA albums are marked as comp

---

<div class="post-metadata">

**Author:** ![philo](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philo](https://discourse.beets.io/u/philo)\
**Post date:** [August 16, 2019, 6:07pm UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/3 "2019-08-16T18:07:25Z")

</div>

Ok, I’ll add that now. Thank you

Will that also resolve how it’s duplicating tracks every time I run an import? I have it scanning the same folder, it’s only supposed to import stuff that’s not in the database already, but it reimports any va / comp and adds duplicate files naming them as 1,2,3,4 on each pass i.e. track1.flac, track2.flac etc

Also what’s the best way to clean up the VA / comp folder in my existing library to remove all the duplicates and name releases appropriately?

---

<div class="post-metadata">

**Author:** ![philo](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philo](https://discourse.beets.io/u/philo)\
**Post date:** [August 16, 2019, 6:09pm UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/4 "2019-08-16T18:09:26Z")

</div>

Also, do I add this under Paths: ?

---

<div class="post-metadata">

**Author:** ![FlibrJibr](https://avatars.discourse-cdn.com/v4/letter/f/0ea827/32.png) [@FlibrJibr](https://discourse.beets.io/u/FlibrJibr)\
**Post date:** [August 16, 2019, 6:25pm UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/5 "2019-08-16T18:25:31Z")

</div>

> [@philo](#):
>
> Will that also resolve how it’s duplicating tracks every time I run an import? I have it scanning the same folder, it’s only supposed to import stuff that’s not in the database already, but it reimports any va / comp and adds duplicate files naming them as 1,2,3,4 on each pass i.e. track1.flac, track2.flac etc

Do you have beets configured to _`copy`_ music in to the library rather than _`move`_?  
I believe ‘copy’ is the default action

Refs:  
[https://beets.readthedocs.io/en/stable/guides/main.html#configuring](https://beets.readthedocs.io/en/stable/guides/main.html#configuring)  
[https://beets.readthedocs.io/en/stable/reference/config.html#importer-options](https://beets.readthedocs.io/en/stable/reference/config.html#importer-options)

---

<div class="post-metadata">

**Author:** ![philo](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philo](https://discourse.beets.io/u/philo)\
**Post date:** [August 16, 2019, 10:02pm UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/6 "2019-08-16T22:02:59Z")

</div>

It’s set to copy. I need to leave the original folders intact.

---

<div class="post-metadata">

**Author:** ![arogl](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/arogl/32/455_2.png) [@arogl](https://discourse.beets.io/u/arogl)\
**Post date:** [August 16, 2019, 11:47pm UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/7 "2019-08-16T23:47:05Z")

</div>

Add those lines under the paths.

Add the lines to your path config the try

```auto
beet move -p

```

This will tell you if the changes actually brings those albums back together in the VA folder.

I am not sure why it duplicates at each import, I use move as my default.

Does beets ask you to:

```auto
[S]kip new, Keep both, Remove old, Merge all?

```

when it detects a duplicate?

Try the following to see in verbose mode, as well as pretending why it does not detect the file already existing.

```auto
beet -vv imp -p <music directory> 

```

---

<div class="post-metadata">

**Author:** ![philo](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philo](https://discourse.beets.io/u/philo)\
**Post date:** [August 17, 2019, 12:29am UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/8 "2019-08-17T00:29:30Z")

</div>

Ok, thanks! I’ll try that this evening.

It doesn’t prompt me at all during imports because I have it set to quiet and fallback asis. i.e.  
quiet: yes  
quiet\_fallback: asis

Could that be why?

It doesn’t duplicate anything except what it puts in the VA folder.

---

<div class="post-metadata">

**Author:** ![arogl](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/arogl/32/455_2.png) [@arogl](https://discourse.beets.io/u/arogl)\
**Post date:** [August 17, 2019, 3:44am UTC](https://discourse.beets.io/t/va-compilation-tracks-being-duplicated-on-each-import/881/9 "2019-08-17T03:44:28Z")

</div>

The quiet option should skip the file if it is unknown. In my config I have

```auto
    quiet_fallback: skip

```

I do not have the quiet option set, I use the -q flag if I have a lot of music to import.

Looking at the code in commands.py, I think those two options will always import the item.
