INTERACT FORUM

Please login or register.

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

Author Topic: Compare Library to Disk Contents  (Read 465 times)

vbphil

  • World Citizen
  • ***
  • Posts: 136
Compare Library to Disk Contents
« on: October 11, 2023, 07:36:30 pm »

Is there a convenient way to compare what's in a Smart List to the disk contents of a folder?

I have a folder containing song files that are in my Library and a Smart List that is referencing that folder. When I look at the total number of songs in the Smart List it doesn't match the number of files in the disk folder. Thru the years there are orphaned files in the folder that are no long in the Library that I'd like to purge.

How could I compare the Smart List contents to that of the folder?

There doesn't appear to be any search language constructs that reference actual disk contents only the library database.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Compare Library to Disk Contents
« Reply #1 on: October 12, 2023, 07:52:15 am »

I've done something similar a while back.  It's not exactly elegant, but it gets the job done.  Here's an outline of the procedure:

1.  In MC highlight all files that are in that folder.  Presumably this includes all subfolders as well.  The FILES view is probably the best one to use for this.
2.  Open Rename Move and Copy Files tool.  Set RM&C to MOVE all selected files to a new folder that is outside of the original.  I.E. if your folder is D:\Music , move it to something like D:\TEMPMUSIC .  Details of how to do this are left to the reader.
3.  After pressing "OK", MC should move all the files, relatively instantly.  Now your original folder should be empty.  If it is not empty, the files left over were not part of MC's Library.  Now you have them isolated by themselves.
4.  Do something with these "extra" files.  Delete them, move them to a different folder, rename the existing folder, etc.
5.  Your existing files, that are in your temporary folder, should still be highlighted.  If not, highlight them again.  Open RM&C.  Now move them back to the original location, which should be EMPTY to start.

When you finish, the folder should only contain files that MC knows about.

There are many caveats here.  You should probably try this with a single Album as a test.  One of the biggest caveats is the "move all files in folder" check box.  Brief documentation is here:
https://wiki.jriver.com/index.php/Rename,_Move,_and_Copy_Files#Files_That_Will_Be_Processed

In short, you want this ON if you have images, rip logs, or any other extra files in your album directories that MC has not strictly imported.  In my case this makes sure that my album art work (which is in the same folder as each album) and my disk rip logs get moved. 

Experiment a bit first.  Go slow.  Start with one file.  Then one album.  Only do more when you are confident with your results.  This procedure has worked for me, but only you can determine if it will work correctly for your collection and your file layout.

Best of luck,
Brian.
Logged

vbphil

  • World Citizen
  • ***
  • Posts: 136
Re: Compare Library to Disk Contents
« Reply #2 on: October 12, 2023, 09:12:27 am »

Thanks for the explanation. I'll give that a try next time.

I ended up with a more manual procedure. Here it is.

In windows explorer I highlighted the folder in question and in the Search bar entered a period (.). That caused Search to display a list of everything in the folder with the subfolders listed first. Then I selected all the files in the list and from the menu bar selected the "copy path" command. That sent a list of the selected files to the clip board. I then pasted that into a Notepad+ text file. It looks like this where each line is surrounded in quotes. I did a search and replace to remove them along with a line by line sort from the Edit menu.

"F:\MCAudio2\Black Sabbath\Master of Reality\After Forever.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Children of the Grave.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Embryo.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Into the Void.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Lord of This World.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Orchid.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Solitude.m4a"
"F:\MCAudio2\Black Sabbath\Master of Reality\Sweet Leaf.m4a"


Then in MC I did a Export Playlist and selected the Smartlist I had that contained the suspected contents of the target folder. I configured the Export for a M3U Playlist (simple). I then opened that file in Notepad+. It looks like this.

F:\MCAudio2\Black Sabbath\Master of Reality\After Forever.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Children of the Grave.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Embryo.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Into the Void.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Lord of This World.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Orchid.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Solitude.m4a
F:\MCAudio2\Black Sabbath\Master of Reality\Sweet Leaf.m4a

I then manually scrolled thru the 2 lists comparing the contents. I only had a few thousand but I did discover I had mistakes not only in the file contents of target folder but also in my Smartlist. The compare could of gone quicker by using a Notepad+ plugin.

Too bad MC doesn't include a feature to do something like this, after all, it isn't only about the Library contents but also the physical contents actually in storage.
Logged
Pages: [1]   Go Up