INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Possible database inconsistency  (Read 402 times)

drfrost

  • Recent member
  • *
  • Posts: 10
Possible database inconsistency
« on: July 25, 2020, 05:10:23 pm »

Each album in my library is stored in a uniquely named directory. For a very few albums, the track files are being referenced twice when the album is selected - for example:

E:\Audio\Music\B\+Beethoven\Beethoven_ Symphony No. 3 ''Eroica'' (Hogwood) {20160824}\
  [01] Symphony No. 3 _Eroica__ I. Allegro Con Brio.mp3
  [01] Symphony No. 3 _Eroica__ I. Allegro Con Brio.mp3
  [02] Symphony No. 3 _Eroica__ II. Marcia Funebre_ Adagio Assai.mp3
  [02] Symphony No. 3 _Eroica__ II. Marcia Funebre_ Adagio Assai.mp3

Using locate-external confirms that both of the duplicate entries points to the same real file.

Is there a way to check the db for consistency to find all the albums affected in this way, so I can fix the issue? Import and auto-import do not make any difference. Given that I have several thousand albums, examining each individual album is impractical.

How and when this happened I don't know - I've moved the library between 5 different computers over the years.

I would like to understand how to prevent a recurrence.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71354
  • Where did I put my teeth?
Re: Possible database inconsistency
« Reply #1 on: July 25, 2020, 05:20:22 pm »

That can happen if you have auto import set to import two locations that point to the same files.  For example:

\\machinename\music\
and
e:\music

Hover your mouse over two of these and look carefully at the file location.

You can use the search window to display one location or the other, then delete it.
Logged

drfrost

  • Recent member
  • *
  • Posts: 10
Re: Possible database inconsistency
« Reply #2 on: July 25, 2020, 07:13:18 pm »

Thanks for the quick response. However, I have not been using "directory mounted" drives, and the hover trick points to the identical filepath for both files of any duplicate set.

I did manage to get a list of affected albums by doing a db extract to xml, then grepping for 'name="Filename"', sort, sort -u and diff. (I love unix/cygwin for this sort of stuff!). There may well be a better way, but that worked for me.

From this I was able to determine that the issue occurred around the time that I was restructuring the data storage so that 'instead of all composers starting with B' being in the same flat directory, I added subdirs such as '...\B\+Beethoven\', '...\B\+Bellini\' etc. I did this from within MC so as to avoid losing db statistics info. However, at that time, I had the actual storage mounted from a network drive, so possibly that may have been the underlying cause. The db itself was still local, though. Even then, not all of the directories moved were affected - maybe only 5% or so. Annoying.

At least now the storage is back on a directly mounted local drive, so I can now plough through those albums identified and clean them up.

Looking forward to MC27.

Best regards
Logged
Pages: [1]   Go Up