Developing MeD's Movie Manager interface to XBMC - assistance is needed

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #1
Hi,

I'd like to start developing an interface between MeD's Movie Manager (pulls movie info from IMDB and stores it in a MySQL database: http://xmm.sourceforge.net/index.php?menu=main) and the XBMC. Currently my main concern with XBMC is that the movie database is stored on the XBox. I would like to have a central database using MeD's that a number of XBox's could query. Each entry would be able to return the file path, thereby allowing you play movies, but more importantly, it would allow to search through your movies for what you want, search by actor, genre etc. whatever you like. You would also have the option of viewing other information about the movie. Sifting through a file browser for the movie you want has now become a very large task...

I was going to start with a Java Servlet with which XBMC could communicate. But I need to know where to start. What is the best way for XBMC to perform queries? Would a list of movies returned in XML format be appropriate? I'm not really concerned about the XBMC end at the moment, I'll focus primarily on servlet side of things to start. I'll be able to get a start on it and leave figuring out XBMC development till a later date.

I'm a Java programmer with experience with servlets primarily. I have worked with C++ in the past.

The beauty of this method is that MeD's is also Java based, thereby allowing it to work with any future ports of XBMC!

Any help would be great, thanks!
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #2
Hi there, and welcome.

First off, one presumes you've actually tried XBMC's library features out. We use sqlite to do the db side of things, which in it's current form cannot connect to a non-local database (to my knowledge - if you know better, please let me know!). Converting sqlite stuff so that it runs as a dll will open up the possibility of having a non-local database, so that's one way you may want to look at.

Otherwise, something like XML would be a suitable method of passing stuff across. With the nice new virtual python "plugin" folder system we have under way, this would allow you to integrate it with XBMC without having to code any C++ at all (i.e. all done in python) and I would suggest that is the way you go, as I'd think that we'd be not all that keen on having it in SVN for a feature that will be useful for only a small amount of users.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #3
Excellent! That's exactly the answer I was looking for! I'll be back once I have a suitable servlet ready.

I think using XML would be the best idea as it would allow communication with other software not just XBMC. I'd like the info server to be as portable as possible.

Almost all the people I know who use XBMC view there files using a network share on a PC. This would pretty much allow anyone to have an info server for there media. Could easily be expanded to include TV shows also.

Guess I'll be learning some Python in the near future!

Thanks for the quick reply.
find quote
blaize Offline
Member
Posts: 92
Joined: Oct 2006
Reputation: 0
Post: #4
wouldnt it be usefull if we could load multiple databases then ?
like when someone connects to several computers, and all those computers have their own database, xbmc all loading them into one.
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #5
Your already seeing where I'm going with this!!!

This is why I think XML would be best. Once the schema of the XML is formalised, and generified, you would be able to easily combine the queries. Then, no matter where the data comes from, whether it already is in XML, from a database or even text files you would have everything. Plus it would be database independent.

It will also let each media location be responsible for maintaining it's own media and the information about it. A simple update could be run on all media locations, updating the database in XBMC. Then all searches could be performed locally.

In fact it would be quite easy to write a generic servlet to access data of any type by using a data persistence layer. By simply throwing Tomcat onto your media PC and writing a config file, XBMC would be able to comunicate with it.

There's potential there for this to be very cool!
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,595
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #6
phunkyfish Wrote:my main concern with XBMC is that the movie database is stored on the XBox. I would like to have a central database using MeD's that a number of XBox's could query
why not write an python-script for the XBMC client-side and a interface/parser on the MeD server-side to sync the two databases on a regular bases (or on demand). So instead of having XBMC querying the MeD database per movie you just syncronuze the whole database and then just let the end-users use XBMC own query functions to query the local database.
http://xboxmediacenter.com/wiki/index.ph...on_Scripts

Confused

phunkyfish Wrote:Almost all the people I know who use XBMC view there files using a network share on a PC. This would pretty much allow anyone to have an info server for there media. Could easily be expanded to include TV shows also.
I do not see how (or why) you would run this via file-mode in XBMC, you would have to use library mode.

Like Jonathan said/asked, have you tried XBMC in library mode?, it already does all you want, only locally, see:
http://xboxmediacenter.com/wiki/index.ph...C_Database
http://xboxmediacenter.com/wiki/index.ph...eo_Library
http://xboxmediacenter.com/wiki/index.ph...e_Scrapers
http://xboxmediacenter.com/wiki/index.php?title=IMDB

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #7
Gamester17 Wrote:why not write an python-script for the XBMC client-side and a interface/parser on the MeD server-side to sync the two databases on a regular bases (or on demand). So instead of having XBMC querying the MeD database per movie you just syncronuze the whole database and then just let the end-users use XBMC own query functions to query the local database.
http://xboxmediacenter.com/wiki/index.ph...on_Scripts

Yes, I think this is exactly what I want. And as below you could sync with MeD on multiple PC's if you so wished. I would only be using it on a single file server, but it should allow you to be able to specify multiple MeD/Other info server database locations...

Gamester17 Wrote:I do not see how (or why) you would run this via file-mode in XBMC, you would have to use library mode.

Like Jonathan said/asked, have you tried XBMC in library mode?, it already does all you want, only locally

Sorry, I did not explain myself fully. I use the file manager currently because the scrapers don't work very well. I have used the library in the past but it is somewhat lacking. The main problem with XBMC is getting the correct data into the library. Once the correct data is in there the Library functionality is almost perfect. Let me explain:

1) Movies - When you scan a bunch of movies into the library a fair portion of them will be scanned incorrectly, i.e. the info for the wrong movie will end up in XBMC, as an example, Apocalypto will come up as Apocalypse Now. Some scrapes are far worse, with no resemblance to the correct movie at all. It's about 50-50 over a hundred movies or so, half right, half completely wrong.
Also there is no way of selecting multiple genres, how would you show all "action comedies" or show all that are action or comedy?

2) TV Show - I have my shows organised in the following directory structure: "TVShowName->SeasonNumber->Files", each file is then labelled "1x11-showName-otherText.avi". If I try to scan in one directory (i.e. one show) all I get is a pile of folders labelled as numbers and nothing else. Selecting the "folder contains one TV show" option makes no difference. I guess the show name should be taken from the initial folder name and season and episode from the avi file. I could rename all the TVShow avi's so they can be processed by regular expressions... But that's a rather large job... Anyway, not really bothered by TV shows. My directory structure works well enough.

I have a few ideas on how to sort the problems with the movies. One is to have a "video.xml" in each directory stating the "movie name", "year", "imdb ID" and "video files", could have more information if you wish. This would make the scraping task much easier as you know exactly which movie it is. The "video.xml" could have details on any scrape site, and could be extended for use with TVShows also. It would make directory structure irrelevant. It's quite easy to add a video.xml to each TVShow/Movie as it's added. But creating them for every Movie/TVShow when you have a lot of them could be a huge task. However, it would yield better results than the current scrape system. Also, if directories are moved it would be easy to relink the file location to the database. Bear in mind this is all without ever connecting to an external info server. If you think this idea would be worthwhile, I'm already writing a schema to incorporate all video files, any input? Note that this is only for simple Movie/TVShow info. It would just enable better scraping.

The reason for the info server is to be able to have a central location for the information. If your XBox dies, the info is gone. Plus if you've watched a movie on one XBox and then on another XBox in the house it's marked as unwatched. If this information is stored centrally it makes more sense. There would even be option of adding multiple "watched/unwatched" users to the info server. So even if you watch stuff on different XBox's it will still show what you havn't watched correctly no matter who you are.

Let me know what you think? I'm going to use the "video.xml" idea with MeD's, if we formalise the schema between XBMC and MeD's all the better, you would have the option of supporting it in the future. You could even have an "only scan video.xml" option?
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #8
This is ridiculous. I'm trying to post a reply, if I enter the reply I want it will never display, even if I remove the quotes. Anyone encountered this problem before?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #9
Have approved your post - not sure why it's being moderated. Note that if it happens again, there's no need to keep replying - it will be approved as soon as it's noticed. Will ask the admins why it's being moderated and see if we can sort it out.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
phunkyfish Offline
Junior Member
Posts: 47
Joined: May 2007
Reputation: 0
Post: #10
Scratch that. It appeared after an hour? I hope it doesn't come up multiple times now. Any moderators around feel free to tidy up any erroneous posts. I hate wasting page real estate!Laugh
find quote
Post Reply