WDLXTV MediaLibrary

From WikiDLXTV
Jump to: navigation, search

Preamble

This is still a work in progress and heavily beta!

This page will be updated continuously while there is ongoing development.
If you intend to play around with this you should bring basic linux skills and be able to work on the shell.



IMPORTANT!!

STARTING WITH VERSION 1.4.8 YOU MUST BE RUNNING EXT3-Boot VERSION OF WDXLTV! **
YOU NEED TO ADD THE pdo_sqlite.so PHP5 MODULE, WHICH IS NOT POSSIBLE WITH FLASH VERSION! **

Changelog

v1.4.9
 - fixed webend playback function
 - added webend sort options

v1.4.8
 ** IMPORTANT!!
 ** STARTING WITH THIS VERSION YOU MUST BE RUNNING EXT3-Boot VERSION OF WDXLTV! **
 ** YOU NEED TO ADD THE pdo_sqlite.so PHP5 MODULE, WHICH IS NOT POSSIBLE WITH FLASH VERSION! **

 - added TV series support (TVDB)
 - completely reworked Webend media browser (not finished,only for movies so far)
 - switched to using PDO in PHP5 
 - added MySQL support (requires mysql-client.5.1.app.bin)
 - fixed TMDB cache handing
 - added support for storing images in database
 - added variable thumb source options (webend and UMSP)
 - added WEC
 - lot's of backend changes and fixes

v1.3.11
 - added ExtSheet support for UMSP plugin (WDTVExt plugin included)
 - added MediaMark support for UMSP plugin (WDTVExt plugin included)

v1.3.10
 - fixed TMDB double imports
 - fixed web plugin sql query

v1.3.9
 - fixed tgmd import
 - fixed sqlite web tool buttons
 - fixed a couple of sql related bugs
 - added support for setting cache dir (eg. config_tool -c MOVIESCAN_CACHE_DIR='/tmp/mnt/whatever/.tmdb')

v1.3.8
 - initial beta release


Introduction

History

This project is something I was carrying around with me for quite some time now and never got to finish it.
It all started when I started playing around with sqlite and the media library that comes with the WD firmware. It always bothered me that it was only working with locally attached media and not with xmounted network shares. (yeah, there is the .addMounts hack, but that's not what I had in mind.) So I tried inserting my own entries into the database just to discover that DMAOSD periodically deletes them again. Also there are quite some problems when you try to use sqlite with a database file on a network share (locking issue) which drove me to implement WDLXTV-DB (which is in the firmware for quite some time now and can already be used by MediaMark for example).


wdlxtv-ml.app.bin

Here's the second step now and I've been working on it for quite some time.
This app.bin provides a script ('moviescan') which will import mediafiles into the database and offers the possibility to search TMDB (http://www.themoviedb.org/) for movie info (rating, cast, etc, ...) and put this info into the database as well. Optionally you can import this information from .tgmd files if available.


What is this good for?

You can use this database for many cool things, I included two small examples:

  • a very simple media browser
    This will only show the files in your library and allows you to toggle the MediaMark for the file and edit some file properties like title, year, imdb id, tmdb id.
  • a UMSP plugin
    This will enable you to browse your files sorted by different criteria: year, rating, latest additions, genre.

These are meant as examples and I hope you come up with some even more sophisticated additions.You will find some develpoment informations further down in this article.


Download

*wdlxtv-ml.app-1.4.8.tgz<del>


Installation

  • get WDLXTV_DB up and running
  • download wdlxtv-ml.app.tgz
  • extract wdlxtv-ml.app.bin <del>and .wdtvext-plugins to USB drive and connect it to WDTV
  • to enable Moviesheets in UMSP plugin set EXTSHEET_USE_SQL=ON (available in WEC)
config_tool -c EXTSHEET_USE_SQL=ON
  • reboot


Enable PDO Modules

Starting from version 1.4.8 you have to run this script once to copy the needed PHP5 PDO modules to your EXT3-Boot system.
This script will also install the WDTVExt plugins.

/apps/wdlxtv-ml/etc/setup.sh

Then once again reboot your device.


Usage

This app.bin provides a shell script moviescan which imports data into the sqlite database.

Also included is a simple web plugin and UMSP plugin as examples.


Help

Run the script without any arguments or -h to get a little help:

# moviescan 
  moviescan version 1.3.8 by recliq

  usage: moviescan [options] update <PATH> [<PATH> [<PATH>]] [<DEPTH>]
         moviescan [options] init
         moviescan [options] clean

  options:
	-a|--auto [<num>|s]	enable auto chooser, default: s (skip)
	-c|--use-cache		enable tmdb file cache
	-d|--debug		enable debug output
	-e|--use-dirname	use dirname instead of filename for search
	-g|--use-tgmd		use .tgmd files as info source
	-i|--no-vidinfo		disable video info
	-l|--lang <lang>	set TMDB language (two letter country code), default: en
	-n|--use-nfo		search .nfo files for imdb id
	-t|--use-tmdb		use TMDB as info source

I will explain the important options later on.


Init database

The first thing you have to do is to create the needed database structures and initialize the database:

moviescan init

This will drop any existing databases and data without asking you again!


Import files

Then you are ready to import some files, in this case i'll import from my xmounted TestShare

moviescan update /tmp/media/usb/TestShare -c -t -v


moviescan Options

  • -h or --help
    Display commandline help.
  • -v or --verbose
    Enable verbose mode.
  • -d or --debug
    Enable debug mode. (lot's of output!)
  • -i or --no-vidinfo
    Disable getting video info with ffmpeg.
  • -a or --auto [<num> | s]
    Enable auto mode. If multiple results are found on TMDB search the script will not ask to select a title but will always auto answer with the given number or skip.
    Default: s (skip)
  • -g or --use-tgmd
    Searches for a .tgmd file and uses the info provided to feed the database.
  • -t or --use-tmdb
    Searches for movie information using TMDB (themoviedb.org).
  • -c or --use-cache *EXPERIMENTAL*
    Enable TMDB file cache.
    You have to set this path before you can use this feature:
    config_tool -c WDLXTV_ML_CACHE_DIR='/tmp/mnt/whatever/.wdlxtv-ml-cache'
  • -e or --use-dirname
    Use the parent dirname instead of the filename to build the search name.
  • -n or --use-nfo
    Search for imdb id in existing .nfo files.
  • -l or --lang <lang>
    Set TMDB language for results (two letter country code), falls back to en if language is not available.
    Default: en


Config Options

All these settings can be accessed through WEC uin the Apps tab.
Some settings are only visible depending on an other config setting. (Due to some limitations you have to reload the WEC page after you changed eg. WDLXTV_ML_DBTYPE.)

  • WDLXTV_ML_DBTYPE=[sqlite|mysql]
    Chose the database backend to use. To use mysql backend you need mysql-client.5.1.app.bin.


  • WDLXTV_ML_SQLITE_DB='/path/to/your/sqlite/file'
    SQLite database file to use.
    Default: /tmp/wdlxtv.db


  • WDLXTV_ML_MYSQL_USER='wdlxtv'
    MySQL User
    Default: wdlxtv


  • WDLXTV_ML_MYSQL_PASS='wdlxtvpw'
    MySQL Password
    Default:


  • WDLXTV_ML_MYSQL_HOST=192.168.1.111MySQL Host
    Default:


  • WDLXTV_ML_MYSQL_DB='wdlxtv'
    MySQL Database
    Default: wdlxtv


  • WDLXTV_ML_CACHE_DIR='/path/to/your/cache/dir'
    Configure path for the cache. Search results and images are stored in cache.
    Default:


  • WDLXTV_ML_SAVE_IMAGES=[ON|OFF]
    Enable/disable saving of images in the database. Not recommended with WDLXTV-DB.
    default: OFF


  • WDLXTV_ML_THUMB_ORDER=[HD|DB|INET|CACHE]
    This options defines how to search for images in webend and UMSP plugin. You can order these strings any way you want.
    Default: HD|CACHE|INET


  • WDLXTV_ML_DEBUG=[0-5]
    Currently unused.


ToDo

  • add support for TV series (TVDB)
  • get MediaMark working
  • get Moviesheets working
  • get Linksheets working
  • implement automatic media scans
  • webend media import/update
  • webend browser for TV series
  • UMSP browser for TV series


Screenshots (preview)

Movie Browser
Movie Details
UMSP Category List
UMSP Genre List


Bugs and Discussion

WDLXTV Forum - WDLXTV Media Library (beta)


Development

SQL schemas


--Recliq 2011