Author Topic: How to clean up library database file?  (Read 6044 times)

redwing

  • Guest
The number of files referenced in the library database file seems to only keep growing, without deleting no longer existing files.
For instance I have one library file that shows only 20,000 files in music library node. But if I run "rescan all files", the status bar says total number as 35,000. And if I map a new custom tag and make it rescan, it shows 150,000 files as total number while rescanning (if I look into the library file some of them are files that used to be in external HDDs that are no longer used).
How can I clean up the library file so that it only contains files currently in my library while removing all other files?
Last Edit: February 03, 2018, 12:35:33 PM by redwing

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
i am planning to add a command to compress the database for files no longer referenced in the library or playlists.

redwing

  • Guest
That'd be great!

In some cases it may be unclear whether the files no longer exist or they are temporarily inaccessible like my example file references on no-longer-used external HDDs. One way to handle this would be to make the command remove all off-line files treating them as no longer existing files. So if the user wants to keep those files in the database, the command should be run with all those storage devices connected. Or it could be offered as an option.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
I was thinking of simply removing any file thats not in the library or a playlist. If the file really is still in use, it just means it would be re-cached again but would mean playcount and other non-stored attributes would be lost.
I dont want to make it something complicated to implement.


redwing

  • Guest
The command (Tools> Advanced> Compress Library) is working great!
Solved all issues I had (I also found and deleted a playlist that contained lots of dead links for this library).
Working well for other library files as well. And now it shows a consistent total file number when rescanning.
Thanks!

sveakul

  • Sr. Member
  • ****
  • Posts: 2474
Thanks Steven for this and to redwing for bringing it up.  Question:  will the new command be available for 3.1 as well?  Not seen in the 3.1.6608 patch.  If not, I think this is what will make me take the leap to 3.2  :)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363

sveakul

  • Sr. Member
  • ****
  • Posts: 2474

redwing

  • Guest
The command only compresses the database without compressing the file.
Still the file is huge for actually referenced tracks in it and if I look into it with hex editor no data is written at all for most part.
Can you make the file smaller with the command?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34363
Sure I will do that as I guess people would expect it but its actually faster to save when a fixed space is pre-allocated.

redwing

  • Guest
OK, then maybe with just a little more room. Still it doesn't make sense a 20,000-file library keeps 150,000-file library size.

redwing

  • Guest
Thanks for the update! Now it compresses the file too.