dvdprofiler2xbmc

DESCRIPTION:

This script will attempt to match up media files from a set of directories to the collection.xml file exported from DVD Profiler. For matches, the script will then create a moviename.nfo from the data in collections.xml and also copy the front cover image to moviename.tbn. Both files will be placed in the same directory as the source media file.

Then on XBMC, set the source content to none to remove the meta data from the library, then set the source content back to Movies to import the media. This time, the data in the .nfo files will be used instead of scraping.

NOTES:

1) currently you lose a few meta data fields such as Rating and Director using this script instead of a scraper.

2) Currently only supports file based media containers, not directory based.

3) Media filename convention is to take the media’s title from DVD Profiler, replace any punctuation with a space character, then replace any multiple spaces with a single space. Next remove any leading or trailing spaces.

Optionally can append “ - YYYY” where YYYY is the movie’s release year.

Naturally the extension is the media’s container type. Note, you should not include in the title edition info like “Widescreen” or “Special Edition” eventhough there are some mistakes in the DVD Profiler profiles that do include these in the title.

FEATURES/PROBLEMS:

Features:

  • Creates .nfo files from exported collection.xml from DVD Profiler

  • If .nfo does not have an <id> tag, then tries to find the IMDB ID by using the title and production/release years to search IMDB.

  • Sets file permissions for files and directories

  • Media can be contained in a set of directories (they can be mount points)

  • Adds sub-directory names as genres to .nfo files

Problems:

  • Always overwriting .nfo. Needs to only write if there has been a change.

  • Loses any tags not directly supported. Needs to change from overwrite to merge.

  • IMDB ID scraping doesn’t handle boxed sets or multiple movies per media file. I don’t see how to work around this exept to eliminate from media library.

  • Needs a better method to setup AppConfig defaults. Current thinking is to prompt for required parameters on first run.

  • Needs to support selectable/multiple regex based naming conventions

  • Needs to support directory containers

  • Does not support stacking

  • .dvdprofiler2xbmcrc uses base 10 integers for permissions. Should be either base 8 or symbolic.

SYNOPSIS:

First check the version by running:

$ bin/dvdprofiler2xbmc -v
INFO dvdprofiler2xbmc: Dvdprofiler2xbmc 0.0.2
INFO dvdprofiler2xbmc: saving: /home/royw/.dvdprofiler2xbmcrc

Notice that this generated a config file for you (/home/royw/.dvdprofiler2xbmcrc) in your home directory.

Now edit the config file. Be sure to change the following fields to match your system:

collection_filespec: /home/royw/DVD Profiler/Shared/Collection.xml
images_dir: /home/royw/DVD Profiler/Shared/Images
directories:
- /media/dad-kubuntu/public/data/videos_iso
- /media/dcerouter/public/data/videos_iso
- /media/royw-gentoo/public/data/videos_iso
- /media/royw-gentoo/public/data/movies
genre_maps: !map:Mash
  Anime: Animation
  Science-Fiction: Science Fiction
  SciFi: Science Fiction
  Musical: Musicals

The “collection_filespec” points to the collection.xml file exported by DVD Profiler.

The “images_dir” points to the directory containing the images (cover scans) from DVD Profiler.

The “directories” are the top level directories of where your media is stored. Note, may be mount points or symbolic links.

The “genre_maps” is a list of genres to rename. In the above example, “Anime” will be renamed “Animation”, “Science-Fiction” will be renamed “Science Fiction”, etc.

You may want to adjust these also:

file_permissions: 436
dir_permissions: 511

Note the permissions are the base 10 integer of the octal permission mask. For example, 436 (base 10) is 664 (base 8) and 511 (base 10) is 777 (base 8).

Save the .dvdprofiler2xbmcrc file.

You may want to get the command line help by running:

dvdprofiler2xbmc --help

To process your media, simply run:

dvdprofiler2xbmc

REQUIREMENTS:

  • ruby 1.8.x

  • rubygem

INSTALL:

sudo gem install royw-dvdprofiler2xbmc

UNINSTALL:

sudo gem uninstall royw-dvdprofiler2xbmc

optionally

rm ~/.dvdprofiler2xbmcrc

LICENSE:

(The MIT License)

Copyright © 2009 Roy Wright

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.