INTERACT FORUM

Please login or register.

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

Author Topic: diffing library content?  (Read 596 times)

laerm

  • Galactic Citizen
  • ****
  • Posts: 424
diffing library content?
« on: September 21, 2023, 11:44:14 am »

Hello all -

My library is just about 98k files but I've just noticed that, at some point between now and my last library backup in June, about 8k files have disappeared. Dunno why but it's entirely possible I pruned something too aggressively or that I made a filesystem move that I thought was reflected in the library but perhaps wasn't completed there. At any rate, I know I can just restore June's library backup and get those files back in the library, but I've certainly added things, moved file locations, and cleaned metadata since then. I know you can export a library to XML but I have years of experience getting frustrated by no tools being able to diff XML properly (by way of recognizing nodes in a way that is intuitive and not too literal). Are there other ways of diffing the library content? My worst-case-scenario idea is to export the library as one huge playlist in CSV - yikes - and then diff those two files but I'm pretty sure that can only tell me what's missing and changed. not give me a new library file to restore (unless I make a new, blank library and import that mega-playlist - ew - losing all of the playlists I've made :'( ).

Ideas appreciated. I can't help but think there might be an internal tool for this? :pleading: I searched the forum but surprisingly found nothing about diffing. Thanks all.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71525
  • Where did I put my teeth?
Re: diffing library content?
« Reply #1 on: September 21, 2023, 12:59:11 pm »

Did you unplug one of your drives?
Logged

laerm

  • Galactic Citizen
  • ****
  • Posts: 424
Re: diffing library content?
« Reply #2 on: September 21, 2023, 01:54:36 pm »

My NAS was offline for a little while last week while I upgraded its drives but if my NAS files had disappeared from the library, the library would probably be at about 5% of its actual size. It's not really important why it happened, though - I could've borked any number of things all different ways in the last three months - I'd just like to figure out what's missing more systematically than being steadily confused over a couple weeks, wondering where some albums went.

Thanks!
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: diffing library content?
« Reply #3 on: September 21, 2023, 05:02:00 pm »

It seems to me that the best user facing way to do this, is to export a playlist as CSV.  You can do this pretty easily by going to a view that shows everything, like Audio > Files.  Then doing File > Export Playlist .  Select CSV.  It might be easier if you limit the view to showing only a few columns that will help you.  Something like the filename and maybe album, artist, and song name?

There are check boxes for whether to include all fields, or just the ones that are showing on screen.

Speaking of the Files view:  Files has a Location column, which should contain all of your drives.  You can isolate what you export (as a CSV) by selecting a drive.  Select the files you want (highlight them) and then do an export playlist and choose "selected" instead of "all".

This might help you isolate your issue if you feel like it is on a certain drive or a certain path or something.

This isn't the easiest process nor the most automatic.  I noticed that when I did a test, I got a lot of extraneous lines that said something like "<Item Name>" with almost nothing else on the line.  I quickly eliminated them in my editor.  You should definitely review the output of the CSV playlist so you know what you're dealing with.

Best of luck to you,
Brian.
Logged

laerm

  • Galactic Citizen
  • ****
  • Posts: 424
Re: diffing library content?
« Reply #4 on: September 22, 2023, 10:30:02 am »

Oof. This sounds like less than zero fun. :P But I did expect it would be something much like this so I suppose I should put my head down and get to it. Good advice on only showing the most necessary columns, though.

Any tips on how to then bring the missing stuff back into the library, blgentry? Thanks!
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1971
Re: diffing library content?
« Reply #5 on: September 22, 2023, 01:53:27 pm »

~8000 files is quite much to check but one approach could be to use MC with mode where adding files to playing now view doesn't import file and then drag your whole music folder to playing now. Then filter out all the files that are imported (date imported has value) and you should end up the files which are not in your libary.

E: date imported seems to get populated even the file is not added in the libary so some other field where MC determines if the file is in the library should be used or filter using date imported just now
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: diffing library content?
« Reply #6 on: September 22, 2023, 02:33:11 pm »

Any tips on how to then bring the missing stuff back into the library, blgentry? Thanks!
I don't know of an elegant way to do a "merge" of your older stuff with the changes you have made.  I would be inclined to simply run auto import and let it get the things that were removed when your NAS was off.

I would also IMMEDIATELY change the setting that allows MC to remove missing files.
tools > Options > Library and Folders > configure auto import > tasks > fix broken links > NO

I can try to give more advice if you have more details that might make a difference.  Otherwise I wish you good luck.

Brian.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1971
Re: diffing library content?
« Reply #7 on: September 22, 2023, 03:08:38 pm »

I would also IMMEDIATELY change the setting that allows MC to remove missing files.
tools > Options > Library and Folders > configure auto import > tasks > fix broken links > NO
Is that BTW default YES? At least it causes problem solving maintenance effort quite regularly with missing files and then people suggest to set it off...

So perhaps the default should be off it isn't already.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: diffing library content?
« Reply #8 on: September 22, 2023, 06:14:38 pm »

I believe it defaults to YES.  It might default to Yes (protect files on missing drives).  I have set it all 3 ways at one time or another.  For 5 or 6 years now I have had it set to off.  I have learned that I prefer to be explicit about changes I made to MC.  So nearly all of the automatic things that MC does, regarding import, change, or removal, have been disabled for me.  This one is a big one and I definitely want it off.

If some of my files go missing, I want to know.  I want to see the red minus signs.  In some cases, I meant to do that.  Most of the time I means I had a problem that I need to investigate and fix.

I too would lobby that Fix Broken Links should be NO by default.

Brian.
Logged

jack wallstreet

  • Citizen of the Universe
  • *****
  • Posts: 513
Re: diffing library content?
« Reply #9 on: September 22, 2023, 06:57:28 pm »

the red minus signs have been lifesavers to me.  You want to see them.
Logged
John

markf2748

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 705
Re: diffing library content?
« Reply #10 on: September 22, 2023, 08:44:00 pm »

Long shot afterthought:  Any chance your missing library entries are sitting in MC's Removed Database?  Attached picture shows a Smartlist that detects entries deleted from the audio library which have been saved in the Removed Database.

Recent Reference:
https://yabb.jriver.com/interact/index.php/topic,135107.msg935664.html#msg935664
Logged
Pages: [1]   Go Up