PDA

View Full Version : Manual DB addition (expanded)


HarshReality
2006-12-09, 17:30
I know devs (all praise to spiff) are working on TV lookups. For the momment the manual db entry is a work around (title & genre) could it be expanded to look for nfo before prompting title/genre and include additional information?

Example:
<title>Heroes s01e06 Better Halves</title>
<date>10/30/2006</date>
<genre>Television Series</genre>
<synopsis>Hiro and Ando plan to continue on their journey to New York, but they are given a tempting offer by a high-roller while still in Las Vegas. The Horn Rimmed Glasses man arranges a meeting for his daughter Claire with her biological parents, with Claire hoping that they can shed some light on her abilities. While at Isaac's, Hiro calls again, and Peter is able to relay future Hiro's message. Suresh returns to India to bury his father, saying goodbye to Eden. Niki receives a surprise visitor at her home.</synopsis>

holding in mind I am not totally familiar with all the fields written to the xml or database but this is only an example.

Currently have over 700 episodes and wouldnt mind writting nfo for all of them if we could get xbmc to make use of the information.

kraqh3d
2006-12-09, 19:44
its never enough, is it? you know xbmc is open source, right? feel free to make patches and submit them yourself.

ok, now that i vented, i'll get down off my soap box...

lemme take a look at this, its probably easy to add given that this is mostly in place. you can already add info for a manual entry by copying a userdata/database/imdb/tt#######.xml file to a userdata/database/imdb/xx#######.xml file. (this is why that xx number is in the popup when you make an addition. i guess you didnt read the original note on the topic.)

you'll need to make an xml file matching the filename with extension which has the same fields as the imdb tt xml files. when manually adding a file, if the xml file exists, the data will get imported, otherwise, you get the prompt for title and genre (and then can still add the other data manually but most of it is only visible when you bring up the info for the item.)

HarshReality
2006-12-09, 20:37
Will add an entry and see what I can do to edit the xml for a desired result.

Glad I could be of help with the venting... let me know if ya need a target ;)

kraqh3d
2006-12-09, 20:37
ok that was easy. expect in svn in a day. i need to do a little more work on it to tidy it up.

(theoretically, the same code could be used to allow the scanner to import data from a local xml file, skipping the imdb lookup. the scanner relies uses stacking so matching up with a xml file gets a little trickier. and i just dont feel like doing it right now.)

** edit **
its in svn... give it a try...

HarshReality
2006-12-09, 22:24
You are the bomb!

http://harshreality.home.insightbb.com/xbmc/screenshot004.JPG

I manually selected the thumbnail once I got to the details screen. IF you hit refresh it goes to IMDB for the lookup (I found this out because of the date in the screenshot it didnt like 9-26-2006) and with this particular work you dont have an option to remove from DB.

GREAT WORK! you had to have broken a few speeding laws LOL

kraqh3d
2006-12-09, 23:23
I'll fix the problem with "Refresh" now.

** edit **
I changed it so that the refresh button is disabled when viewing the info from a manually added title to prevent accidental lookup on IMDB.

** edit 2 **
you can include a <thumb> tag in the xml file referencing a thumbnail on the web and it'll load.

DonJ
2006-12-10, 00:53
This makes me look so much more forward to the new video db! Thx again kraqh3d for ur great work.

SleepyP
2006-12-10, 13:58
hey HR, where did you grab the content for that XML file in the first place?

HarshReality
2006-12-10, 14:58
TV.com ;)

<details>
<title>Heroes s01e01 Genesis</title>
<year>2006</year>
<director>Peter Godfrey</director>
<tagline>Ordinary people discovering extraordinary abilities</tagline>
<runtime>60 min</runtime>
<thumb></thumb>
<credits>Tim Kring / Dave Semel</credits>
<rating>9.2</rating>
<votes>1070</votes>
<genre>Television Series</genre>
<cast></cast>
<plot>In this episode, we are introduced to Peter Petrelli, a young man who dreams of flying, and his brother Nathan, a ruthless politician who thinks that Peter is dreaming his life away. Meanwhile, ordinary people from all around the world are starting to suspect that they have abilities beyond those of normal humans. Artist Isaac Mendez believes that he is painting the future, high school cheerleader Claire Bennet is suddenly able to recover from any wound almost instantly, Japanese businessman Hiro Nakamura tries to convince a friend that he can bend space and time, and single mother Niki Sanders starts seeing strange things in mirrors.</plot>
<outline>Upon learning of his father's death, genetics Professor Mohinder Suresh begins to look into his research for a clue to why he was killed. When he follows his father's trail to New York City, however, Mohinder learns that someone else is on the trail of the same research. Someone who may kill to protect the secrets of the next step in human evolution.</outline>
</details>

kraqh3d
2006-12-10, 17:35
cast information works correctly too. the downloaded xml files only use a "\n" between the names but i'm pretty sure the code will work with dos style "\r\n" characters in between them.

(resulting in something which looks like this in notepad:

<cast>
Masi Oka as Hiro Nakamura
Milo Ventimiglia as Peter Petrelli
...
...
</cast>

Livin
2006-12-10, 18:40
Harsh,
Are you really going to build 700 separate XMLs?

If you have so much spare time you should code up a python script to scrape tv.com or something to do it automatically!

HarshReality
2006-12-10, 19:31
If I knew how I would, but since I dont I'll settle for what I can do ;)

El Piranna
2006-12-11, 00:50
I have a new idol, it's name is kraqh3d :D I only have one thing to say: wow! :D I promise i will try to make a little schematic the next time i will suggest a feature before ask for it if i don't have time to improve it myself ;)

HarshReality
2006-12-11, 00:54
Schematic?

cold_realms
2006-12-12, 10:56
hate to jump off topic (well off to the side) but is the new TV DB lookup only acknowledging the format in sXXeXX?

God I hope not, but if it is I'll deal as long as we get separate db for other nifty features like separate listing properties and fast DB for all for those of us with 3k in video files :)

El Piranna
2006-12-12, 16:20
Schematic?

Yeah! A little script of how i would implement it if i knew how to do it. I have some programming skills and i'm doing some little OpenGL games, but i'm not confident to improve myself at something serious as XBMC.

Excuse me if my messages are a bit strange, i have my english skils a little outdated :D

HarshReality
2006-12-12, 16:50
No worries, I tend to bend things... I can mimic but as for originallity I was born without imagination.

kraqh3d
2006-12-12, 23:50
cold_realms:
there is no new tv db nor was it ever said that there would be.

el piranna:
it would be easiest to code up something in either python or perl since you should be able to find ALOT of example code on http retrieval and html/xml parsing. it would function something like this:

1) probably need to use a POST method to tv.com with some search query
2) parse that output to find the "correct" item
3) GET that next webpage
4) parse that output (you probably would need to repeat steps 3 and 4 a few times until you get to the episode details page)
5) once your at the episode details page, you parse that data and re-format it into the xml format that xbmc is expecting and write it out to disk.

basiaclly, you just mine the data out of their html page and output an xml file that xbmc understands.