2009-11-20, 16:43
Hi there,
I often heard about this problem in this forum and also needed something like this by myself so I wrote a little shell-script that will try to find mediafiles that are not yet in the library. This script is ugly and dirty but it works, at least for me.
The script does not change the database at all! It only queries the database and doesn't modify anything in it. The only files that are written are the ones described below.
This is work in progress. I'll try to improve it further and will also try to include some more specific database queries. If you have any suggestions, let me know.
Settings
Within the settings there are the following variables that you are urged to look at and change to values that fit your environment:
Limitations
This script does not check whether any given entry in the library contains useful information. There might be entries that only contain the filename and a bookmark for example. These entries should also be considered as "missing in the library" but it's quit difficult to distinguish between items that were scraped but without getting useful information and items that didn't get any result at all and that are for a different reason ion the library. For conditions under which an entry is added to the library, consult the documentation.
Results
As result of this script there will be three files (each preceeded with a prefix, if set):
Execution
All you need to do is copy the code to an empty textfile, adjust the settings to your needs, save this file and run it with the following commandYou might also set the executable-bit to the file and run it directly, just as you like.
Here we go:
[EDIT: the script is now available at the wiki only:
http://wiki.xbmc.org/?title=Linux-Script...ped_Movies ]
I often heard about this problem in this forum and also needed something like this by myself so I wrote a little shell-script that will try to find mediafiles that are not yet in the library. This script is ugly and dirty but it works, at least for me.
The script does not change the database at all! It only queries the database and doesn't modify anything in it. The only files that are written are the ones described below.
This is work in progress. I'll try to improve it further and will also try to include some more specific database queries. If you have any suggestions, let me know.
Settings
Within the settings there are the following variables that you are urged to look at and change to values that fit your environment:
- DBPATH points to the video-database (the file itself, not just the directory)
- PREFIX will set a prefix that is used for all files that are created during the runtime of the script. It may include an absolute or relative path and a prefix of the filename. A good idea for this setting is something like the homefolder and a file-prefix or a temporary folder. Any given folder must already exist.
Limitations
This script does not check whether any given entry in the library contains useful information. There might be entries that only contain the filename and a bookmark for example. These entries should also be considered as "missing in the library" but it's quit difficult to distinguish between items that were scraped but without getting useful information and items that didn't get any result at all and that are for a different reason ion the library. For conditions under which an entry is added to the library, consult the documentation.
Results
As result of this script there will be three files (each preceeded with a prefix, if set):
- db-only.lst
This file contains entries that are in the library only but not in the filesystem. If you want to get rid of them, usually a library clean-up (within XBMC) should do the job - fs-only.lst
This is the most relevant file, as the files listed in it don't exist in the library but exist in the file system. There may be different reasons why they are not (yet) scraped. But at least now you know which files your library is missing - db-stacked.lst
This file only shows up, which entries in the library are stacked entries, i.e. entries that are considered a single media item but consisting of multiple files.
Execution
All you need to do is copy the code to an empty textfile, adjust the settings to your needs, save this file and run it with the following command
Code:
sh <filename>
Here we go:
[EDIT: the script is now available at the wiki only:
http://wiki.xbmc.org/?title=Linux-Script...ped_Movies ]