xDatabase

Xlobby plugin development

xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:10 pm

XDatabase


This is a collection of routines that i have needed over the last few years, I am guessing someone else mid find them useful as well. The functions can be broken into the following sections:

1) Routines for finding/editing items in a category.
2) Routines for saving and restoring a database in a "move" friendly way (move a directory and still pick up the info).
3) Routines for adding user ratings to a category entry.
4) Routines for adding last played data to a category.
5) Routines for manipulating databases.
6) Routines for caching database coverart.
7) Miscalanious routines.

I am running on the latest "pay" Lobby release, but it is a simple plug-in so I cant see any problems on the free ware version.

Before the plugin changes a database it will create a copy of the original file so you should be able to roll it back if needed. I would still recommend that you make a backup of your database files before running it for the first time, i am pretty sure it works without any problems but i would hate anyone to lose any data.

If you are interested the source code is included, you need Microsoft Visual C# 2005 Express Edition to build it, but can be obtained from microsoft free of change.

To install download
xDataBase.zip
(122.67 KiB) Downloaded 1500 times
and then extract it to the plugin directory in the Xlobby folder. I have included a sample ini file which you will have to open up in notepad and select the actions you want. It defaults to doing nothing so should not break anything.

If you have already set-up the plug-in, download
no ini file.zip
(120.91 KiB) Downloaded 1334 times
(it does not contain a ini file so will not overwrite any of your settings).



Change List
31 Mar 2008 - Beta 1 released.
2 Apr 2008 - Beta 2 released.
2 Apr 2008 - The plugin looks for a ini file in "..\plugins\xdatabase\xdatabase.ini" and not "c:\program files\xlobby..."
3 Apr 2008 - Beta 3 released.
3 Apr 2008 - added ini file option to use the the file creation date - General - Get Date Added From File = true/false
3 Apr 2008 - added ini file option to add item specific xdb.date.added - General - Add Date Added For "type" = true/false
4 Apr 2008 - fixed bug which reset play counter
4 Apr 2008 - fixed bug in use file creation date
4 Apr 2008 - sort info correctly added to albums/tracks and movies
16 Apr 2008 - added options for generated default images and combining them with a background image
16 Apr 2008 - added funtion to take a screen shot - image file from screen>filename>x>y>width>height
16 Apr 2008 - added ini file option control the delay between saving the database and triggering the xlobby load
Ini File, Delay Between DB Save And Refresh = 500

16 Apr 2008 - added ini file option control the delay between saving the database and triggering the xlobby cache clear
Ini File, Delay Between DB Save And Cache Clear = 100

21 Apr 2008 - added ini file option - General - Add All Entry this will add a tag called "xdb.all" to each item in the db.
21 Apr 2008 - added ini file option - General - Add All Entry Value, if this is blank it xdb.all is set to the "type" field, if not this text is used.
21 Apr 2008 - If your copy of xlobby supports it the find functions will now use the "xlobby:category:search forward".

4 Jun 2008 - Added support for star images for imdb ratings and user ratings
4 Jun 2008 - Added support for image reflections


Sean.
Last edited by S Pittaway on Wed Jun 04, 2008 3:55 pm, edited 23 times in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:10 pm

Routines for finding/editing items in a category


database jump
Description: This will move backwards or forwards in a category (it’s like calling item next several times).
Parameters: database jump>XXX>YYY, where XXX is the category name, YYY is the number of items to skip (use +Y/-Y to skip backwards or forwards? to jump to a random entries).
Tags: None.
Example: database jump>movies>+5
Example: database jump>movies>-10
Example: database jump>movies>?


database find
Description: This will iterate though a category until it finds the value you are looking for or you end up where you started.
Parameters: database find>XXX>YYY>ZZZ, where XXX is the category name, YYY is the field name to search and ZZZ is the value we are looking for.
Tags: None.
Example: database find>movies>title>a film name


database find sorted
Description: As above, but this assumes that category is sorted on the field you are looking for so is faster.
Parameters: database find sorted>XXX>YYY>ZZZ, where XXX is the category name, YYY is the field name to search and ZZZ is the value we are looking for.
Tags: None.
Example: database find sorted>musicdetails>tracknumber>12


database find abc
Description: As above, but used for ABC type screens. This only looks for a match on the first character, if it can find it stops at the nearest entry.
Parameters: database find abc>XXX>YYY>ZZZ, where XXX is the category name, YYY is the field name to search and ZZZ is the value we are looking for.
Tags: None.
Example: database find abc>movies>title>C


database add to all
Description: This will update a field for all of the entries in a category (NOT THE DATABASE), if the value is blank it removes the field.
Parameters: database add to all>XXX>YYY>ZZZ, where XXX is the category name, YYY is the field name to search and ZZZ is the value we want to set.
Tags: User selected.
Example: database add to all>movies>xdb.played>true


database append (add)
Description: This can be used to build a / separated string (for things like genres). If the tag was blank it set it to be the text you specify, if its not a / and the text is added
Parameters : database append (add)>XXX>YYY>ZZZ, where XXX is the category name, is the field and ZZZ is the value to append.
Tags: User specified.
Example: database append (add)>movies>genre>Family


database append (remove)
Description: This can be used to build a / separated string. Any text you specify is removed from the field.
Parameters : database append (remove)>XXX>YYY>ZZZ, where XXX is the category name, is the field and ZZZ is the value to remove.
Tags: User specified.
Example: database append (remove)>movies>genre>War


database append (toggle)
Description: This can be used to build a / separated string. If the text you specify is in the filed it is removed, if not it is added.
Parameters : database append (toggle)>XXX>YYY>ZZZ, where XXX is the category name, is the field and ZZZ is the value to toggle.
Tags: User specified.
Example: database append (toggle)>movies>genre>War


database append (all)
Description: Similar to database append (all) but acts on the whole category (NOT THE DATABASE).
Parameters: database set played (all)>XXX>YYY, where XXX is the category name, YYY is an optional field that can be "blank" to clear the played times or a date/time").
Tags: User selected.
Example: database append (all)>movies>genre>Family
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:10 pm

Routines for adding user ratings to a category entry


database set rating
Description: This will set a rating field for the current entry in a category. This rating is a single character repeated 1 - 5 times (i.e. *, **, ****, ****, *****). This character can be anything you want (its specified in the ini file), I use ¶ which under “Wingdings” is a nice star character.
Parameters: database add to all>XXX>YYY, where XXX is the category name, YYY is the new rating (inc/dec/toggle/*/**/***/****/*****).
Tags: xdb.rating.
Example: database add to all>movies>*****


database set rating (all)
Description: As above, buts sets all of the entries in the category (NOT THE DATABASE)
Parameters: database set rating (all)>XXX>YYY, where XXX is the category name, YYY is the new rating (inc/dec/toggle/*/**/***/****/*****).
Tags: xdb.rating.
Example: database set rating (all)>movies>*****
Last edited by S Pittaway on Thu Apr 03, 2008 8:03 am, edited 1 time in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:11 pm

Routines for adding last played data to a category


database set played
Description: This will set the selected item in a category to be marked as played, this will store the current time and increment any play counts.
This adds the following fields to the item:
"xdb.played" = played/un-played
"xdb.played.count" = number of times played
"xdb.last.played" = time when the file was played (e.g. "11 January 2008 20:11")
"xdb.last.played.str" = descriptive time when the file was played (e.g. "11 January 2008 20:11")
"xdb.last.played.sort" = a sort able version of the play time (e.g. "080111081118")
Parameters: database set played>XXX>YYY, where XXX is the category name, YYY is an optional field that can be "blank" to clear the played times or a date/time").
Tags: See above
Example: database set played>movies
Example: database set played>movies>blank
Example: database set played>movies>01-01-2000 18:00


database set played (all)
Description: As above but acts on the whole category (NOT THE DATABASE).
Parameters: database set played>XXX>YYY, where XXX is the category name, YYY is an optional field that can be "blank" to clear the played times or a date/time").
Tags: See above
Example: database set played (all)>movies
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:11 pm

Routines for saving and restoring a database


database export
Description: This will save the item information to a xIE file next to the items parameter. If a database is deleted this information can then be re-loaded into the database.
If the parameter was "G:\Amistad\VIDEO_TS\video_ts.ifo" a file called "G:\Amistad\VIDEO_TS\video_ts.ifo.xIE" would be written containing the data for that item (plot etc).
Parameters: database export>XXX, where XXX is the database name.
Tags: None,
Example: database export>movies


database import
Description: This will re-load information saved during by a "database export".
This will save the old database file as database.xml.bup so if anything goes wrong you can recover the old database.
Parameters: database import>XXX, where XXX is the database name.
Tags: None,
Example: database import>movies


database load tag file
Description: This will import data from a ?? separated text file. You can specify the separator (I use ¦ =Alt-Gr+`).
This will save the old database file as database.xml.bup so if anything goes wrong you can recover the old database.
Parameters: database load tag file>database name>tag file>separator>tags to export(separate tags by &).
Tags: User specified.
Example: database load save file>movies>c:\movie_info.txt>¦>parameter&display&runtime


database save tag file
Description: This will export data to a ?? separated text file. You can specify the separator (I use ¦ =Alt-Gr+`).
Parameters: database save tag file>database name>tag file>separator>tags to export(separate tags by &).
Tags: User specified.
Example: database save tag file>movies>c:\movie_info.txt>¦>parameter
Last edited by S Pittaway on Wed Apr 16, 2008 8:59 am, edited 1 time in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:11 pm

Routines for manipulating databases


database add extra tags
Description: This will add extra fields to a database.
See notes on Database Add Extra Tags.
Parameters: database add extra tags>database name.
Tags: xdb.id, xdb.id.parent.x, xdb.random, xdb.short.rating, xdb.imdb.rating
xdb.rating, xdb.date.added, xdb.date.added.sort, xdb.played, xdb.played.count, xdb.last.played
sorttitle, artist.sort, album.artist, albumname.sort, album.artist.sort, albumname.search, tracknumber, trackname.search
Example: database add extra tags>movies


database add random tag
Description: This will update the xdb.random tag that gets added by "database add extra tags".
I used to use this to generate a smart playlist shuffle, but the new "shuffle playlist now" is good enough...
Parameters: database add extra tags>XXX, where XXX is the database name.
database add random tag>XXX>YYY, where XXX is a category and YYY is the to number of items to update (quicker than doing all of them).
Tags: xdb.random.
Example: database add random tag>playlist>1000
database add random tag>music


database sort
Description: This will sort a database, to sort by multiple fields separate them by :, use +- for asc/desc and & to generate a sort string.
This will save the old database file as database.xml.bup so if anything goes wrong you can recover the old database.
I mainly use the to correctly sort databases which contain sub-directories.
Parameters: database sort>XXX, where XXX is the database name.
Tags: None,
Example: database sort>movies>-year:sorttitle
database sort>music>&artist:&albumname


database post refresh
Description: This call "database add extra tags" and "xcache update", it only scans the xml file once so its a little quicker than calling them separately.
This will save the old database file as database.xml.bup so if anything goes wrong you can recover the old database.
Parameters: database post refresh>database name.
Tags: xdb.id, xdb.id.parent.x, xdb.random, xdb.short.rating, xdb.imdb.rating
xdb.rating, xdb.date.added, xdb.date.added.sort, xdb.played, xdb.played.count, xdb.last.played
sorttitle, artist.sort, album.artist, albumname.sort, album.artist.sort, albumname.search, tracknumber, trackname.search
Example: database post refresh>movies


database strip tags
Description: This will remove all of the specified tags from a database.
This will save the old database file as database.xml.bup so if anything goes wrong you can recover the old database.
Parameters: database strip tags>database>tags to strip(separate tags by &).
Tags: User specified.
Example: database strip tags>movies>upc&studio


database auto scroll
Description: This will "tick" its way thro a category, a bit like a slideshow. it calls item next every xxxx ms.
Parameters: database auto scroll>XXX>YYY, where XXX is a category and YYY delay between item changes. YYY can also be + to slow down or - to speed up the changes,
Tags: None.
Example: database auto scroll>pictures>2500
database auto scroll>pictures>-
database auto scroll>pictures>+


database auto scroll stop
Description: This turns of a auto scroll.
Parameters: None
Tags: None.
Example: database auto scroll stop>


database resize coverart
Description: This will resize all of the covers in a database. THIS IS A ONE WAY CHANGE SO BE CAREFULL!
I used to use this to fix the aspect ratio on my dvd/cd covers, I now use the local cache instead.
Parameters: database resize coverart>XXX>YYY>ZZZ, where XXX is the database to resize, YYY is the width in pixels, ZZZ is the Height in pixels.
Tags: None.
Example: database resize coverart>music>500>500
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:12 pm

Routines for caching database coverart


xcache update
Description: This will make a local copy of the coverart for a specified database.
See notes on Database Image Cache.
Parameters: cache image rotate>XXX>FORCE_UPDATE(true/false), where XXX is the database whose entry we want to rotate. If FORCE_UPDATE is set all images will be re-built, if its false only new items will be parsed.
Tags: coverart, xdb.cache.original, xdb.cache.thumb, xdb.cache.fullscreen.
Example: xcache update>movies>true


xcache purge
Description: This will remove any unused images from the local cache folder.
See notes on Database Image Cache.
Parameters: cache purge>XXX, where XXX is the database to clean.
Tags: None.
Example: xcache purge>movies


xcache remove
Description: This will remove any cache information from a database and point the coverart at the original.
See notes on Database Image Cache.
Parameters: cache remove>XXX, where XXX is the database to strip the cache info from.
Tags: coverart, xdb.cache.original, xdb.cache.thumb, xdb.cache.fullscreen, xdb.cache.rotate
Example: xcache remove>movies


xcache image rotate
Description: This will rotate a cache image. The original image is unaffected.
See notes on Database Image Cache.
Parameters: cache image rotate>XXX>YYY, where XXX is the database whose entry we want to rotate and YYY is the rotation (0, 90, 180, 270).
Tags: xdb.cache.rotate
Example: xcache image rotate>movies>90
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:12 pm

Miscalanious routines


music playlist generator
Description: This will generate a playlist file from a database (or a database entry).
If shuffle is set, the playlist will be biased in favour of un played songs and higher rating songs.
Parameters: database>root parameter (blank to inc all tracks)>playlist file name>shuffle=true/false
Tags: None.
Example: music playlist generator>C:\xlobby-music.m3u>>true
music playlist generator>%audioplayer>now>parameter%>C:\xlobby-music.m3u>>true


theartertek playlist generator
Description: This will resize a given file.
If shuffle is set, the playlist will be biased in favour of un played songs and higher rating songs.
If Loop is set, when ThearterTek has finished the last file, it will loop back to the first entry.
Parameters: database>root parameter (blank to inc all movies)>playlist file name>shuffle=true/false>recurse=true/false>loop=true/false.
Tags: None.
Example: theartertek playlist generator>C:\xlobby-tt.plt>%movies>parameter%>true>true


image file from screen
Description: This will take a screen shot.
Parameters: image file resize>filename>x>y>width>height, where filename is the file to save the screen shot, x/y/w/h is the area you want to take a shot off.
Tags: None.
Example: image file from screen>c:\default.bmp>0>0>1366>768


image file resize
Description: This will resize a given file.
I used to use this to fix the aspect ratio on my dvd/cd covers, I now use the local cache instead.
Parameters: image file resize>XXX>YYY>ZZZ, where XXX is the image file path, YYY is the new width in pixels, ZZZ is the new Height in pixels.
Tags: None.
Example: image file resize>c:\default.bmp>300>500


image file convert
Description: This will make a copy of a given file, the copy can be converted from one format to another and also resized if needed.
I use this to update the TheartreTek logo so it shows the cover from the current DVD.
Parameters: image file resize>SRC>DST>WIDTH>HIEGHT, where SRC is the source file and DST is the destination file, To resize an image set WIDTH/HIGHT to be whatever you want.
If they are set to -1 no resizing is done.
Tags: None.
Example: image file convert>%movies>coverart%>C:\Program Files\TheaterTek\TheaterTek DVD 2.0\background.bmp>300>500


image file create blank
Description: This will create a blank (black) image.
Parameters: DST>WIDTH>HIEGHT, where DST is the destination file and image set WIDTH/HIGHT are whatever you want.
Tags: None.
Example: image file create blank>C:\Program Files\TheaterTek\TheaterTek DVD 2.0\background.bmp>300>500
Last edited by S Pittaway on Wed Apr 16, 2008 9:04 am, edited 2 times in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:12 pm

Database Add Extra Tags


This will add extra tags to the database and manipulate some of the existing ones.

It will save the old database file as database.xml.bup so if anything goes wrong you can recover the original database.

In the plug-in inifile, you need to create a block for the database you are interested in (this is the database name in square brackets, i.e. [movies]), you can then control the tags added using the following settings:

General - Add Standard Tags = true/false
If the following are NOT present they are added and set to
xdb.id = unique id this entry (format 000000000)
xdb.id.parent.1 = if this is a sub item, this is the id of the parent (format 000000000)
xdb.id.parent.2 = if this is a sub item of a sub item, this is the id of the parent's parent (format 000000000)
xdb.random = a random value (biased on xdb.rating/xdb.last.played)
xdb.date.added = current date (format can be changed in the ini file)
xdb.date.added.sort = YYMMDDHHMMSS
xdb.played = un-played
xdb.played.count = 0
xdb.last.played =
xdb.last.played.sort = 0000000000
xdb.rating = ***
if it is a using a movie template it add/update
sorttitle
if its a album it will add/update
artist.sort
album.artist
albumname.sort
album.artist.sort
albumname.search (this is a find all option for searching and is equal to "artist.sort / albumname.sort")
if its a track
artist.sort
tracknumber (if the tracknumber is blank I will set it to be its position in the album)
trackname.search (this is a find all option for searching and is equal to "artist.sort / albumname.sort / trackname")

General - Add Directory Size = true/false
If this is set the plug-in will lookup the directory size (format 0.00 Gb) for the parameter and write it to a field called "xdb.dir.size".

General - Convert Old Tags = true/false
If this is set the plug-in will try and convert tags from older versions of the plug-in to there new names. It will also convert tags from xmusic into the new format.

General - Add Played Info To Dirs = true/false
If this is set and the item is a directory I will blank the played tags.

General - Sort Database Before Processing = blank/tags to sort on
If this is set I will manually sort the database BEFORE updating the data in it.

Genre - Tidy = true/false
If this is set I will tidy the genre field - I will remove duplicate entries, sort them alphabetically, replace the separators with / and try and fix the case (e.g. SCI-fi = Sci-fi).
When parsing the genre field it will automatically replace any genre entries specified in the "[Genre Lookup]" section of the ini file.

Genre - Inherit From Parent (if blank) = true/false
If this is set and an item has no genre, I will copy the genre from the parent.

Genre - Add Family Genre For U/PG Films = true/false
If this is set and a film has a rating of U or Pg I will automatically mark it as a family film.

Actors - Tidy = true/false
If this is set I will tidy the Actors field - I will remove duplicate entries, sort them alphabetically and replace the separators with /.
When parsing the actors field it will automatically replace any entries specified in the "[Actor Lookup]" section of the ini file.

Titles - Tidy = true/false
If this is set I will copy the display tag to the title and name. I will also add a sorttitle if its not present.

Rating - Tidy = true/false
Is set, this will add a new tag - xdb.short.rating this will contain a short version of the rating tag, if the rating was Rated 15 for mild use of the word fart, the short rating would be 15.

Rating - Target Country = Blank or uk/us
Used to localise the "Rating - Tidy" function.

Rating - Inherit From Parent (if blank) = true/false
If the rating is blank and this is set I will copy the rating from the parent.

Runtime - Use hh:mm = true/false
Runtime - Add Short Runtime = true/false
If "Runtime - Add Short Runtime" is set the runtime field is simplified to xxx mins. If "Use hh:mm" is set the format used is hh:mm.

IMDB - Generate stars = true/false
This will add a tag called xdb.imdb.rating. If the item contains a imdb rating I will turn it into the same format as the xdb.rating (i.e. imdb rating = 6.5/10 -> xdb.imdb.raing = ******)


If "Format Star Image" is specified in the ini file i will also add xdb.rating.image and xdb.imdb.star.rating.image fields which point to a star image file.
Last edited by S Pittaway on Wed Jun 04, 2008 2:45 pm, edited 3 times in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:12 pm

Database Image Cache


This plug-in can make a local copy of the coverart used by a database. The original image is not affected.

It will save the old database file as database.xml.bup so if anything goes wrong you can recover the original database.

For each item in the DB it can creates a thumbnail image (dimensions can be specified in the ini file) and if wanted a full screen image (again dimensions can be specified in the ini file), The coverart for each database entry is then updated to point at the thumbnail image.

You can also combine it with a background image and the display text to produce things like (this is a generated folder image) -
d-g.[.backup.].pictures.2007-08-20,.our.holliday.in.china.3..morgans.photo.shoot.jpg

Or (this is a default image)-
t-g.[.backup.].avi's.the.ren.and.stimpy.show.16.-.stimpy's.fan.club.16.-.stimpy's.fan.club.avi.jpg


It will add the following tags to each item in the database (and modify the coverart field):

"xdb.cache.original" - this is the original coverart filename.
"xdb.cache.thumb" - the new local thumbnail image filename
"xdb.cache.fullscreen" - the new local full screen image filename (if not needed it used the thumbnail).
"xdb.cache.rotate" - the local image can be rotated, this stores it.


In the plug-in inifile, you need to create a block for the database you are interested in (this is the database name in square brackets).

You can then specify the following:

[b]Key = string

This is the tag containing the cover file name.

xCache - Keep AR = true/false
This determines if i should stretch the image or keep the original aspect ratio.

xCache - Default Image = image file
If the item has no coverart this will be used instead (leave blank to disable)

xCache - Only Draw Title If No Cover
We can draw the display string on the generated image, if this is set it will only do it for items with no coverart.

xCache - Text Colour
We can draw the display string on the generated image, this controls its colour.

xCache - Text Shadow Colour
We can draw the display string on the generated image, this controls its shadow colour.

xCache - Text Font Name
We can draw the display string on the generated image, this controls its shadow colour.


The following control the settings used for Folder/Thumb and Full Screen images. (Replace Thumb with whichever you want to set) -

xCache - Thumb Image Height = int
Image height in pixels.

xCache - Thumb Image Width = int
Image width in pixels.

xCache - Thumb Cache Type (jpg/png ect) = jpg/png/tif/bmp etc
This is the format of the xCache file saved.

[b]xCache - Thumb Background Image = image file name[\b]
If this is set, i will draw this image using width/height and THEN draw the category image on top of it...

[b]xCache - Thumb Overlay Rect X = int[\b]
If a background image is set, this is controls the area that the category image is draw into (x/y/w/h).

[b]xCache - Thumb Overlay Rect Y = int[\b]
If a background image is set, this is controls the area that the category image is draw into (x/y/w/h).

[b]xCache - Thumb Overlay Rect W = int[\b]
If a background image is set, this is controls the area that the category image is draw into (x/y/w/h).

[b]xCache - Thumb Overlay Rect H = int[\b]
If a background image is set, this is controls the area that the category image is draw into (x/y/w/h)

[b]xCache - Thumb Title Rect X = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Title Rect Y = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Title Rect W = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Title Rect H = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Title Font Size = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Title Font Size = int[\b]
If a background image is set, this is controls the area that the display text is draw into (x/y/w/h)

[b]xCache - Thumb Reflectivity = double[\b]
This controls the reflectivity of the shadow image and can vary from 0 to 1.
If it is 0 the no reflection is added, If it is 1 all of the image will be reflected.
I think a good value is 0.33

[b]xCache - Thumb Reflectivity Blend Color = text[\b]
This determines the type of reflection that is generated.
If it is left blank (or set to TRANSPARENT) a "real" reflection is added that can be over-layed on another background image - i.e. its a transparent reflection. To do this the file type must be set to png!
Transparent reflections seem to seriously slow down xlobby and they burn up memory really quickly. It may even cause memory errors if you have a large amount of coverart...
If it is set to a solid colour i will simply fade the reflection into that colour. This means you can use jpgs which saves a lot of memory!
If you screen is using a solid background go for the solid type - its quicker to draw and uses a lot less memory - i guess this is why the apple uses a black background :)




Notes:
If the "Full Screen" entries are left out any references to "Full Screen" return the thumb.
If "Folder Thumb" entries are present and the database contains directories it will create a image based on a few images in the (sub) directory(s).
Last edited by S Pittaway on Tue Jun 03, 2008 2:37 pm, edited 5 times in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 1:13 pm

Ini File Settings


The ini file is split up into blocks which control various functions of the plug-in.

The "blocks" are [Debug], [Settings] and any databases you are processing e.g. [movies] [music] etc


[DATABASE]

*** see notes on Database Image Cache ***

*** see notes on Database Add Extra Tags ***


[Debug]

LogFile = string
This is the file path of the log file (used to debug the plug-in).

Enabled = true/false
If this is set, a debug file is created (used to debug the plug-in).

Clear On Startup = true/false
If this is set, whenever xlobby is started the debug file is cleared (used to debug the plug-in).


[Settings]

Format Rating Char = char
This is the character used on the xdb.rating/xdb.imdb.star.rating, the default is "¶" which is a nice star if you use the "wingdings" font.

Format Null Classification = string
If a database item does not have a rating, xdb.short.rating is set to this. The default value is a space " ".

Format Null Genre = string
If a database item does not have a genre, it is set to this. The default value is a space "Unclassified".

Format Played Text = string
When you call "database set played", xdb.played is set to this. Its default value is "un-played"

Format Unplayed = string
When a new item is added to the database, or you reset it the xdb.played tag is set to this. Its default value is "un-played"

Format Date Added = string
This is the format of the xdb.date.added field, its default value is "d MMM yy"

Format Date = string
This is the format of any dates added, its default value is "d MMM yy, hh:mm"

Format Date Sort
This is the format of any sort dates, its default value is "yyMMddhhmm"

Format Id = 000000
This is the format used when generating the xdb.id tags.

xCache Root Directory = directory path
This controls the directory into which any xCache files are written, the default is "...Xlobby\Plugins\xDatabase\Cache Files"

Format Star Image = image path
If this is set for xdb.rating/xdb.imdb.rating i will also create a xdb.rating.image/xdb.imdb.star.rating.image/ field which points at a "star image".
The images need to be named in the same way with a range of 0 to 100. in the Format Star Image you replace the number with a *.

For example you could have a collection of star images like this C:\Stars\stars-1.png .. C:\Stars\stars-10.png .. C:\Stars\stars-100.png and you would set the ini file entry to be Format Star Image = C:\Stars\stars-*.png


Here is a copy of the ini file that i use:

[Settings]
Format Id = 000000
Format Rating Char = ¶
Format Played Text = played
Format Unplayed Text = un-played
Format Date Added = d MMM yy
Format Date = d MMM yy, hh:mm
Format Date Sort = yyMMddhhmm
Format Null Classification =
Format Null Genre = Unclassified

[pictures]
General - Convert Old Tags = true
General - Add Standard Tags = true
;.. xCache Common ...............................
xCache - Key = parameter
xCache - Keep AR = true
xCache - Text Font Name = Vladimir Script
xCache - Text Colour = Black
xCache - Text Shadow Colour = DarkGray
xCache - Only Draw Title If No Cover = false
;.. xCache Folders ..............................
xCache - Folder Image Height = 400
xCache - Folder Image Width = 500
xCache - Folder Cache Type (jpg/png ect) = png
xCache - Folder Background Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.photo.png
xCache - Folder Overlay Rect X = 30
xCache - Folder Overlay Rect Y = 7
xCache - Folder Overlay Rect W = 437
xCache - Folder Overlay Rect H = 326
xCache - Folder Title Rect X = 30
xCache - Folder Title Rect Y = 344
xCache - Folder Title Rect W = 440
xCache - Folder Title Rect H = 38
xCache - Folder Title Font Size = 16
xCache - Folder Title Font Size = 16
;.. xCache Thumbs ..............................
xCache - Thumb Image Width = 500
xCache - Thumb Image Height = 400
xCache - Thumb Cache Type (jpg/png ect) = png
xCache - Thumb Background Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.photo.png
xCache - Thumb Overlay Rect X = 30
xCache - Thumb Overlay Rect Y = 7
xCache - Thumb Overlay Rect W = 437
xCache - Thumb Overlay Rect H = 326
xCache - Thumb Title Rect X = 30
xCache - Thumb Title Rect Y = 344
xCache - Thumb Title Rect W = 440
xCache - Thumb Title Rect H = 38
xCache - Thumb Title Font Size = 16
;.. xCache Fullscreen ...........................
xCache - Full Screen Image Width = -1
xCache - Full Screen Image Height = 1536
xCache - Full Screen Cache Type (jpg/png ect) = jpg

[movies]
General - Convert Old Tags = true
General - Add Standard Tags = true
General - Sort Database Before Processing = sorttitle
General - Add Directory Size = true
Runtime - Add Short Runtime = true
Runtime - Use hh:mm = true
Genres - Tidy = true
Genres - Inherit From Parent (if blank) = true
IMDB - Generate stars = true
Actors - Tidy = true
Titles - Tidy = true
Rating - Tidy = true
Rating - Inherit From Parent (if blank) = true
Rating - Target Country = uk
Rating - Add Family Genre For U/PG Films = true
;.. xCache Common ...............................
xCache - Keep AR = false
xCache - Text Font Name = Arial Rounded MT Bold
xCache - Text Colour = White
xCache - Text Shadow Colour = Black
xCache - Only Draw Title If No Cover = true
xCache - Default Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.dvd.default.png
;.. xCache Thumbs ...............................
xCache - Thumb Image Width = 531
xCache - Thumb Image Height = 781
xCache - Thumb Cache Type (jpg/png ect) = png
xCache - Thumb Background Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.dvd.png
xCache - Thumb Overlay Rect X = 15
xCache - Thumb Overlay Rect Y = 15
xCache - Thumb Overlay Rect W = 500
xCache - Thumb Overlay Rect H = 750
xCache - Thumb Title Rect X = 40
xCache - Thumb Title Rect Y = 40
xCache - Thumb Title Rect W = 460
xCache - Thumb Title Rect H = 500
xCache - Thumb Title Font Size = 42

[music]
General - Convert Old Tags = true
General - Add Standard Tags = true
General - Add Played Info To Dirs = false
General - Get Date Added From File = true
General - Add Date Added For "type" = true
Genres - Tidy = true
;.. xCache Common ...............................
xCache - Keep AR = false
xCache - Text Font Name = Arial Rounded MT Bold
xCache - Text Colour = White
xCache - Text Shadow Colour = Black
xCache - Only Draw Title If No Cover = true
xCache - Default Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.music.default.png
;.. xCache Thumbs ...............................
xCache - Thumb Image Width = 525
xCache - Thumb Image Height = 525
xCache - Thumb Cache Type (jpg/png ect) = png
xCache - Thumb Background Image = C:\Program Files\xlobby\plugins\xDataBase\Images\bg.music.png
xCache - Thumb Overlay Rect X = 14
xCache - Thumb Overlay Rect Y = 14
xCache - Thumb Overlay Rect W = 498
xCache - Thumb Overlay Rect H = 498
xCache - Thumb Title Rect X = 24
xCache - Thumb Title Rect Y = 37
xCache - Thumb Title Rect W = 478
xCache - Thumb Title Rect H = 456
xCache - Thumb Title Font Size = 28

Notes:

For the pictures database I want it to set the date added etc and I want decent sized thumbs but the full size picture is more detailed (my TV uses a resolution of 1366x768 so I scale the images based on that, widths are left out so it wont stretch photos).

For the movies database I want it to tidy all of the fields up and I want good quality thumbs (I don’t need a big full screen image so I leave it out, I also want a fixed aspect ratio so I set the width AND height)

For music database. I want to add the extra tags and I want good quality fixed aspect ratio thumbs.
Last edited by S Pittaway on Wed Jun 04, 2008 2:47 pm, edited 4 times in total.
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: xDatabase

Postby dalanik on Mon Mar 31, 2008 2:11 pm

Woooooooooow!!! :)
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Re: xDatabase

Postby CiXel on Mon Mar 31, 2008 3:58 pm

Point of reference with Beta 1:
The location of xDatabase.ini file seems hard coded to c:\program files\xlobby\plugins\xdatabase
Make sure to create that location and drop your active ini into into place.
(Tip: Creating a shortcut to that file in your 'local' directory provides an easy way to make modifications to it)
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: xDatabase

Postby scottw on Mon Mar 31, 2008 4:13 pm

S Pittaway wrote:XDatabase


if you are using xMusic, dont try this yet!
i have an updated version of xMusic which uses the same tag names has this plugin...
when i get chance i will tidy the code up and release a new version to match this...



Great, I can't wait. I use xMusic ALOT!!!!
scottw
 
Posts: 774
Joined: Mon Feb 06, 2006 4:21 pm
Location: Glen Burnie, Maryland

Re: xDatabase

Postby S Pittaway on Mon Mar 31, 2008 4:59 pm

it IS supposed to look for in "..\plugin\xdatabase".

i make a "fix" a while ago, so i could run it from a standalone application and that seems to have cocked it up :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Next