INTERACT FORUM

Please login or register.

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

Author Topic: Can I list database entries that no longer have a valid path?  (Read 944 times)

stevemac

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
Can I list database entries that no longer have a valid path?
« on: February 06, 2014, 07:40:02 am »

MC 19.0.114

So I don't know exactly how it happened, but managed to lose a folder on one HDD that contained a lot of MKVs.  The folder looked OK but had a child folder with no name (or was non printing characters) that appeared to contain a copy of the parent folder's contents.  This folder appeared tonight (whilst it may be a coincidence it was around the time I was altering JRMCs auto -import settings & creating particles from files in that folder).  My first attempt of removing the folder with no name failed.  Tried again after a reboot and it got rid of the parent folder as well.  I wasn't able to recover from the recycle bin so I have a long recovery process ahead of me (might have to rethink not backing up these files......)

Anyway - in my current views I cannot see these files - which makes it more difficult to work out what I lost.  Is there a query I can run to list database entries that no longer have a valid path / filename?  I have tried [=ismissing([filename])]=1 & it doesn't show them.  For what it's worth the Fix Broken Links was set to Yes (protect files on missing drives).  Given I don't use removable drives should this be set to 'No'?

thanks,

Steve
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Can I list database entries that no longer have a valid path?
« Reply #1 on: February 06, 2014, 01:07:13 pm »

Fix broken links is a bit of a challenge.

For most users, on a local disc, a "broken link" means the file is moved or deleted.  MC can try to re-connect its idea of the file's full path (because the file was moved), and if it can't, move the entry from the Main database to the Removed database (because the file was deleted, and henceforth considers the file as no longer in the library).

But with network file systems, or removable drives, it is impossible to positively determine the existence of a file under any of these conditions:

   - permanently gone (file system responsive, but file moved to some other location)
   - temporarily unresponsive (for some non-deterministic quantity of time - how long do you wait before giving up?)

So MC tries to figure out which files are on remote or removable drives, and tries to do the right thing as best it can with reasonable timeouts.

Unfortunately, it gets even more complicated when file systems can nest other file systems, transparently to MC, so MC can't use simple heuristics to assume an entire network file system is missing.

It seems the consensus is that it is best to disable Fix broken links if you have network file system or removable drives that are either swapped out frequently, are offline frequently, or you have any other concerns the MC will do the wrong thing in its attempt to reconnect the Filename field with the actual physical path to the file from the OS' point of view.

The custom search query you use will work in a view on only the files that are in that view.  So you may want to create a Smartlist and using the ismissing() rule so that the entire Main database is being used (i.e. all files, no filtering of media types, etc.).  By the way, this is equivalent:

   [=ismissing()]=1

since the Filename field is the default argument to IsMissing().

The IsMissing() function simply asks the OS if path value inside the Filename field (or the argument you've passed) is valid and exists.

I believe the Fix links settings should be a per Folder setting, since each Folder you've listed in auto-import may have different characteristics.
Logged
The opinions I express represent my own folly.

stevemac

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
Re: Can I list database entries that no longer have a valid path?
« Reply #2 on: February 06, 2014, 02:05:47 pm »

Thanks again MrC. 

[=ismissing()]=1 showed one file I had cleaned up after the issue.  What ever happened / whatever I did broke it good and proper.

I've taken your advice & changed the fix broken links setting

cheers,

Steve



Logged
Pages: [1]   Go Up