Which library items no longer have files?
#1
(Can't believe I've never registered here in all the years I've been using XBMC. Glad to join the throngs. Moving on...)

One of my hard drives recently went kaput, and unfortunately I don't have records of what was on there. XBMC still has the missing episodes in its library. Rather than do a "Clean library" and get rid of them, I'd like to see a list of the library entries for which video files no longer exist so I can replace them.

I have indeed scoured the forum and internet, but I can only find information on the opposite problem: files without library entries.

I use Sickbeard for shows that are still on the air, so I was able to re-scan those for missing files. But I don't use it to manage older shows and would like to see if XBMC can give me that info easier than asking Sickbeard to manage and check my entire collection.

What's the best way to go about this? Thanks in advance, folks.
Reply
#2
Maybe try to go to Add Source and go to the source that went kaput, you should be able to get the list.
Box 1: ODroid N2+ 4GB
Box 2: Intel NUC D34010WYK (Windows afedchin's Krypton MVC Build)
Box 3: Vero 4K
RIP schimi2k | I miss you buddy :(
Reply
#3
One of the easiest should to Export Video Library to Single file and then look for <path> or <basepath> in videodb.xml.

You can import the XML files to Excel for example and then filter the path column to only show those that begins for G:\ if the failed drive had G: as drive letter.

Or you can use some script to extract the path information for that specific drive from the XML file.

Otherwise you can search directly in the database.
Reply
#4
My fault, I should have mentioned that the failed hard drive was part of a Drive Bender pool on a Windows Home Server, exposed to XBMC as a single combined network share. So the paths are all the same: \\SERVER\TV\Series Name, etc. And there's no obvious system to how Drive Bender stores them, so they're randomly distributed across multiple shows and seasons.

The only way to differentiate the files that need to be replaced is to go through the entire library and check if each video file still exists on the share or is gone. Since that's what the Clean Library function does, I was hoping there would be a way to do the same process, but listing the files not found instead of deleting them from the library.

I've been through a few different methods to do the same thing outside of XBMC, including trying to get a list of those missing files out of Drive Bender itself, but all to no avail. I'm here because I thought XBMC might be able to help me.

Hope that's clearer. Thanks for the suggestions, though.
Reply
#5
You could try this script, running the "qa" test should identify missing files (amongst other things). Just add the following to the properties file texturecache.cfg:

Code:
qaperiod = 9999
qa.file = yes

then run as:

Code:
./texturecache.py qa movies
-- or --
./texturecache.py qa tvshows
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#6
(2013-03-26, 05:24)MilhouseVH Wrote: You could try this script
Thanks, Milhouse (or should I say "Thrillho"). But I'm running Windows and would prefer not to install Python on the XBMC machine. I tried running your script from the server, which does have Python installed, to check the library over the network but I can't get it to give me results -- just leaves me hanging for a long time with a flashing cursor. Checked your support page and directions, of course, but it's a bit opaque on how to use it on Windows over the network as your first post says you've tested.

Is there another way to do this that doesn't require installing new software?
Reply
#7
To use the "over the network" features, which basically means JSON, you need to create a config file in the same folder as the script, called texturecache.cfg.

Edit this config file, and add the following:

Code:
xbmc.host = <your xbmc server ip address> (ie. 192.168.0.8)
webserver.port = <webserver port> (ie. 80, or 8080)
webserver.username =
webserver.password =
qaperiod = 9999 (Consider everything, not just the last 30 days)
qa.file = yes (Verify that the media file exists when performing QA tests - complain when missing)

And you should be good to go.

With a remote setup like the above, you'll be restricted to only the JSON functions, so that's all the j* and all the qa* options.

(2013-03-26, 17:30)Yellowbox Wrote: Is there another way to do this that doesn't require installing new software?

Highly unlikely, but the best of luck.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#8
(2013-03-26, 04:48)Yellowbox Wrote: The only way to differentiate the files that need to be replaced is to go through the entire library and check if each video file still exists on the share or is gone.

Well, thats easy, just one line of code Wink

Do the export to a single file, create a batch file next to videodb.xml named FindThem.bat and put this in it and save
Code:
@for /f "tokens=3 delims=<>" %%x in ('type videodb.xml ^| find "<path>"') do if not exist "%%x" echo:%%x>>MissingFolders.txt
(All on same line)

Run the script and open MissingFolders.txt when it's done.
Reply
#9
(2013-03-27, 01:14)kaffekask Wrote: Do the export to a single file, create a batch file next to videodb.xml named FindThem.bat and put this in it and save
Code:
@for /f "tokens=3 delims=<>" %%x in ('type videodb.xml ^| find "<path>"') do if not exist "%%x" echo:%%x>>MissingFolders.txt

That's brilliant and worked quite well, thanks! I had to alter it slightly because I was looking for non-existent files, not folders. And they were all smb:// paths, which cmd didn't like. But I just did a search and replace in the videodb.xml to change them to UNC format and then ran the script. Then there were the HTML entities, but god bless Notepad++.

Anyhoo, I learned a lot from your little line of code, and you saved my tuchus. Thanks very much!
Reply
#10
Glad it worked out for you after some fixing, it was just a quick script I put together and tried with local paths.

With a few more lines the smb:// paths could have been solved in the script also.
Reply

Logout Mark Read Team Forum Stats Members Help
Which library items no longer have files?0