2009-12-09, 02:03
@firnsky: Check trac before you do anything else - there are patches there for mysql for instance.
jmarshall Wrote:@firnsky: Check trac before you do anything else - there are patches there for mysql for instance.
wstewart Wrote:Looks very interesting: http://trac.xbmc.org/ticket/7529
Andrewishy Wrote:Q. What’s in the database?It also stores a lot of other metadata (which you mention) such as playcount, lastplayed, etc which are not scraped.
A. A location of the media (where the video file is) and a load of automatic metadata generated from scrapers based on the filename convention
Andrewishy Wrote:Q. If you have multiple xbmc’s can they share the database?Yes. There are patches submitted on trac to allow the sharing of databases (via MySQL).
A. No, the location of all the files is dependant on what xbmc can see and different instances may see different files systems
Andrewishy Wrote:Q. Do I need to have all the instances of xbmc on to share the databases?Only if you wanted to share the local SQLite3 database. If you are using a central database (eg MySQL) then no not all instances need to be on.
A. if you shared the databases directly then yes this would have to happen
Andrewishy Wrote:As the simplest solution is often the best I think that using the export feature and saving the database to a sub directory where the video is located ( for example .database .Actors .fanart etc) and putting a hash in the filename would allow all instances of xbmc to update to the latest information on boot.Oddly enough your are trying to create another database, albeit a file based one.
Andrewishy Wrote:I would however propose the following steps to make this happen:1. A more information rich is a great idea.
1. Re-visit the internal database so it has all the info in it required for this feature (
2. Create a more consistent format for the export feature export all data in the database and all pointed to pictures and store this in a hidden sub directory where the video is located. These files may either need to be labelled with hashes or date/time stamped something to identify that they have changed without having to read them all
3. overhaul the scanning so the data in the hidden files is checked to see if it is newer than what’s in the database
4. automatic export and cleaning of the database (after each scan) so that all new items are saved with the video.
Andrewishy Wrote:Some issues that need to be addressed:1. This will be an issue of your file based database system. You need to ensure it is ACID compliant. Which is much easier achieved with existing database systems.
1. what happens if two xbmc’s try and write to the files at the same time? – probably wont happen but worth thinking about
2. different versions of xbmc? Maybe we need a version number in the stored files too so that the instances know what the data will mean or will the xml format be fine?
3. would it be better to store a raw database in each dir with the same format as the internal database? – maybe this would be more work and less usable as metadata
Andrewishy Wrote:Just one concern about the central db is it will require a server to be on all the time, I'm currently using a dumb NAS drive for my content so don't have another spare server (and I don't think the average user would have one either)
Quote:Originally Posted by firnsyThe NAS is an off the shelf device and only supports file sharing and i so don't want to re-flash it to make it do other things (its a Ethernet/USB external HD not a full uPnP device so low power but good enough for HD video transfer).
Quote:Originally Posted by AndrewishyYes it does require a server to be up all the time (just like your NAS has to be up all the time). The patches should safely fall back to the local database (via SQLite3) when the remote database is not available.
Just one concern about the central db is it will require a server to be on all the time, I'm currently using a dumb NAS drive for my content so don't have another spare server (and I don't think the average user would have one either)
This is an advanced feature set and is not expected to be initially adopted by the average user with a dumb NAS drive. You could always re-flash your NAS and make it smarter