• 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 14
[RFC] Database Abstraction Proposal - Request for Comments (Devs and DB Admins only!)
been away for some time now and i was re-installing my server (Rev29323) and tried to apply the patches but it seems that they are already applied .. are they?
Reply
megacrypto Wrote:been away for some time now and i was re-installing my server (Rev29323) and tried to apply the patches but it seems that they are already applied .. are they?

Yes they are.
Reply
A while back I posted that the performance on my macbook pro was not nearly as good as on my windows 7 machine. At that time the MySQL DB was on the windows 7 machine so it was pretty clear why it was performing better. Since then I have moved the MySQL DB to a server on my network so now both the windows 7 machine and my macbook pro have to connect to it remotely. The performance of my windows 7 machine went down a little but only takes about 1 second to display the TV Shows library page. My macbook pro takes about 9 seconds to do display the same page. Its not just this page; its slow for all of them that access the DB. I turned debugging on for xbmc on my macbook pro and grabbed the section from the log that contains loading the TV Shows library page.

Code:
16:08:34 T:2691785952 M:772808704   DEBUG: CGUIMediaWindow::GetDirectory (videodb://2/2/1/)
16:08:34 T:2691785952 M:772808704   DEBUG:   ParentPath = [videodb://2/2/]
16:08:34 T:2953318400 M:772808704   DEBUG: CDatabase: Connecting to database apollo at xxx.xxx.xxx.xxx:yy
16:08:34 T:2691785952 M:772808704   DEBUG: ------ Window Init (DialogBusy.xml) ------
16:08:34 T:2691785952 M:772808704   DEBUG: Alloc resources: 0.04ms (0.02 ms skin load)
16:08:39 T:2953318400 M:772141056   DEBUG: GetStackedTvShowList query: select idShow from tvshow where c00 like (select c00 from tvshow where idShow=1) order by idShow
16:08:39 T:2953318400 M:772141056   DEBUG: GetSeasonsNav query: select episode.c12,path.strPath,tvshow.c00,tvshow.c08,count(1),count(files.playCount) from episode join tvshowlinkepisode on tvshowlinkepisode.idEpisode=episode.idEpisode join tvshow on tvshow.idShow=tvshowlinkepisode.idShow join files on files.idFile=episode.idFile  join tvshowlinkpath on tvshowlinkpath.idShow = tvshow.idShow join path on path.idPath = tvshowlinkpath.idPath where tvshow.idShow = 1  group by episode.c12
16:08:39 T:2953318400 M:772141056   DEBUG: GetMoviesByWhere query: select * from movieview join movielinktvshow on movielinktvshow.idMovie=movieview.idMovie where movielinktvshow.idShow = 1
16:08:39 T:2953318400 M:772141056 WARNING: GetIcon - Unknown nodetype requested videodb://2/2/1/1/
16:08:39 T:2953318400 M:772141056 WARNING: GetIcon - Unknown nodetype requested videodb://2/2/1/2/
16:08:39 T:2953318400 M:772141056 WARNING: GetIcon - Unknown nodetype requested videodb://2/2/1/3/
16:08:39 T:2953318400 M:772141056 WARNING: GetIcon - Unknown nodetype requested videodb://2/2/1/4/
16:08:39 T:2953318400 M:772141056 WARNING: GetIcon - Unknown nodetype requested videodb://2/2/1/-1/
16:08:39 T:2691785952 M:772141056 WARNING: CRITSEC[0xbfffe6a4]: Trying to initialze initialized section.
16:08:39 T:2691785952 M:772141056   DEBUG: WindowVideoNav::GetDirectory
16:08:39 T:2953318400 M:772141056   DEBUG: OpenDir - Using authentication url smb://user:pass@server/Videos/TV%20Shows/30%20Rock
16:08:39 T:2691785952 M:772141056 WARNING: CRITSEC[0xbfffde50]: Trying to initialze initialized section.
16:08:39 T:2691785952 M:772141056 WARNING: CRITSEC[0x24f434c]: Trying to initialze initialized section.
16:08:39 T:2691785952 M:772141056   DEBUG: CDatabase: Connecting to database ViewModes at /Users/jordanh/Library/Application Support/XBMC/userdata/Database:
16:08:39 T:2691785952 M:772141056   DEBUG: CDatabase: Connecting to database ViewModes at /Users/jordanh/Library/Application Support/XBMC/userdata/Database:
16:08:39 T:2691785952 M:772141056   DEBUG: CDatabase: Connecting to database ViewModes at /Users/jordanh/Library/Application Support/XBMC/userdata/Database:
16:08:39 T:2691785952 M:772141056   DEBUG: Saving fileitems [videodb://2/2/1/]
16:08:39 T:2691785952 M:772141056   DEBUG:   -- items: 6, sort method: 21, ascending: true
16:08:39 T:2691785952 M:772141056   DEBUG: CDatabase: Connecting to database apollo at xxx.xxx.xxx.xxx:yy
16:08:43 T:2691785952 M:772403200 WARNING: GetLabel - Unknown nodetype requested 11
16:08:43 T:2956623872 M:772407296   DEBUG: thread start, auto delete: 0
16:08:43 T:2691785952 M:771440640   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
16:08:43 T:2956623872 M:771440640   DEBUG: Thread 2956623872 terminating
Reply
It's the db open that's taking all the time there - strange.
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
Reply
Jordan Wrote:The performance of my windows 7 machine went down a little but only takes about 1 second to display the TV Shows library page. My macbook pro takes about 9 seconds to do display the same page. Its not just this page; its slow for all of them that access the DB. I turned debugging on for xbmc on my macbook pro and grabbed the section from the log that contains loading the TV Shows library page.
Could you post the same portion of the log of XBMC running on the win7 machine to compare db access times?
Reply
Here is the log from my windows 7 pc:

Code:
21:58:20 T:5720 M:932687872** DEBUG: CGUIMediaWindow::GetDirectory (videodb://2/2/)
21:58:20 T:5720 M:932687872** DEBUG:** ParentPath = [videodb://2/2/]
21:58:20 T:3660 M:932655104** DEBUG: CDatabase: Connecting to database apollo at xxx.xxx.xxx.xxx:yy
21:58:20 T:3660 M:932450304** DEBUG: CVideoDatabase::GetTvShowsByWhere query: SELECT tvshow.*,path.strPath AS strPath,counts.totalcount AS totalCount,counts.watchedcount AS watchedCount,counts.totalcount=counts.watchedcount AS watched FROM tvshow JOIN tvshowlinkpath ON tvshow.idShow=tvshowlinkpath.idShow JOIN path ON path.idpath=tvshowlinkpath.idPath LEFT OUTER join (*** SELECT tvshow.idShow AS idShow,count(1) AS totalcount,count(files.playCount) AS watchedcount FROM tvshow**** JOIN tvshowlinkepisode ON tvshow.idShow=tvshowlinkepisode.idShow**** JOIN episode ON episode.idEpisode=tvshowlinkepisode.idEpisode**** JOIN files ON files.idFile=episode.idFile**** GROUP BY tvshow.idShow) counts ON tvshow.idShow=counts.idShow
21:58:20 T:5720 M:931393536** DEBUG: ------ Window Init (DialogBusy.xml) ------
21:58:20 T:5720 M:931368960*** INFO: Loading skin file: DialogBusy.xml
21:58:20 T:3660 M:931561472** DEBUG: Time for actual SQL query = 114
21:58:20 T:5720 M:931094528** DEBUG: Load DialogBusy.xml: 41.12ms
21:58:20 T:5720 M:931094528** DEBUG: Alloc resources: 41.31ms (41.31 ms skin load)
21:58:20 T:3660 M:925917184** DEBUG: Time to retrieve tvshows from dataset = 112
21:58:20 T:5720 M:928354304** DEBUG: CDatabase: Connecting to database ViewModes at C:\Users\Jordan\AppData\Roaming\XBMC\userdata\Database:
21:58:20 T:5720 M:928350208** DEBUG: CDatabase: Connecting to database ViewModes at C:\Users\Jordan\AppData\Roaming\XBMC\userdata\Database:
21:58:20 T:5720 M:928284672** DEBUG: CDatabase: Connecting to database ViewModes at C:\Users\Jordan\AppData\Roaming\XBMC\userdata\Database:
21:58:20 T:5720 M:928239616** DEBUG: Saving fileitems [videodb://2/2/]
21:58:20 T:5720 M:927993856** DEBUG:** -- items: 64, sort method: 23, ascending: true
21:58:20 T:5720 M:927981568** DEBUG: CDatabase: Connecting to database apollo at xxx.xxx.xxx.xxx:yy
21:58:20 T:5688 M:928858112** DEBUG: thread start, auto delete: 0
21:58:20 T:5720 M:930402304** DEBUG: ------ Window Deinit (DialogBusy.xml) ------
Reply
Jordan Wrote:Here is the log from my windows 7 pc...
As jmarshall said, it seems like a problem when connecting to the db, but only from the Mac (it takes five seconds just to make the connection against less than a second from the Win7 client).
Have you tried to connect to the db using any other MySQL tool from the same Mac?
Any other network problems from the Mac? (e.g. latency, etc.) Try pinging the MySQL host IP from the Mac.
Reply
charrua Wrote:Have you tried to connect to the db using any other MySQL tool from the same Mac?
Any other network problems from the Mac? (e.g. latency, etc.) Try pinging the MySQL host IP from the Mac.

I haven't noticed any network problems on the mac. The ping time is essentially the same and negligible on both the win7 and mac machines. I have noticed that using navicat to connect to the db server is a bit slow. I haven't found a place in navicat to get detailed information on the connection process in order to see exact times.
Reply
I was able to fix my slow connection problem on my mac by adding
Code:
[mysqld]
.....
......
skip-name-resolve
to the MySQL my.ini file.
Reply
Jordan Wrote:I was able to fix my slow connection problem on my mac by adding
Code:
[mysqld]
.....
......
skip-name-resolve
to the MySQL my.ini file.

Nice tip Jordan, thanks for the follow up.
Reply
I think the posts about it were lost but did someone figure out a way to get the fanart/thumbnails to work properly on a computer that did not build the library to begin with?
Reply
I have been wanting this feature for atleast 4 years I am so glad someone finally got this concept worked out. I use a couple central servers and a bunch of frontends. One xbox running xbmc on every tv in every room in the house hardwired together.I run myth, samba shares, and stream emulation. I can do all this using the central servers the only hassle is library upkeep. This eliminates that but it is not merged with the xbox trunk.

I have the tools to do it and I have a little vb experience I had a class for the 2008 version just last year in college. I am more inclined with linux than microsoft and understand patches in regards to the linux kernel more so than working with anything MS but am unsure exactly how to implement such a thing in vb.
I have compiled my own build before but I built it as it was and didn't change anything. I say this so you know I at least have the ability to build it.

Would it not just be code inserted in at certain places?

Where can I find the code and once I have the code where does it need inserted?

Any help would be greatly appreciated.
Reply
run088 Wrote:Would it not just be code inserted in at certain places?

you've just summarized all programming right there.

if you have to ask, you haven't done enough research.
Reply
I just spotted this feature, and it looks great. So, I've written a "scrapper" (a python script really) that grabs my movie library from my MySQL database (that was created using Movie Collector)

The python script takes the Movie Collector database, and writes it into a new MySQL database created by XBMC.

For the most part, it's working, but I have a few questions:

What are the Cxx fields? I've figured out some of them, but not all. Here's what I've figured out:

Code:
C00 - Title
C01 - Plot
C02 - ???
C03 - ???
C04 - ???
C05 - IMDB rating
C06 - Writer(s)
C07 - Year
C08 - Thumbnails
C09 - ???
C10 - ???
C11 - Duration
C12 - ???
C13 - ???
C14 - Genre
C15 - Director
C16 - ???
C17 - ???
C18 - Studio
C19 - ???
C20 - Fanart

I'm having a problem with thumbnails. Here's an example of a thumbnail in the database:

Code:
<thumb preview="smb://tardis/movies/images/IRobot2004293_f.jpg">smb://tardis/movies/images/IRobot2004293_f.jpg</thumb>

If I look at the movie details and manually set the thumbnail, I actually see the one that I've set, and can select it. How to I make this thumbnail the default automatically?

Thanks for this great new feature!!!
Reply
think I've found a bug, running 28256 on windows 7.

Seems to have problems with actor names like Gavan O'Herlihy specifically with the '.

Looks like it is putting a double ' in the query, its putting O\'' where as I think it should put O\'

Get the following in my log
Quote:22:43:37 T:4908 M:2735472640 ERROR: SQL: Undefined MySQL error: Code (1064)
Query: select idActor from actors where strActor like 'Michael O\''Herlihy'
22:43:37 T:4908 M:2735468544 ERROR: CVideoDatabase::AddActor (Michael O\'Herlihy) failed
22:43:38 T:4908 M:2726039552 ERROR: SQL: Undefined MySQL error: Code (1064)
Query: update episode set c00='Trouble Brewing',c01='Two sisters ask the A-Team for help when they are pressured to convert their all-natural soda pop bottling plant into a brewery.',c02='',c03='0.000000',c04='Burt Pearl / Steven L. Sears',c05='1985-05-07',c06='<thumb>http://images.thetvdb.com/banners/episodes/77904/262827.jpg</thumb>',c07='',c08=NULL,c09='',c10='Michael O\''Herlihy',c11='',c12='3',c13='24',c14='',c15='-1',c16='-1',c17='-1'where idEpisode=428
22:43:38 T:4908 M:2725892096 ERROR: CVideoDatabase::SetDetailsForEpisode (smb://MYTHTV-B1/myth/media/tv_shows/3/A-Team/Season 3/A-Team - S03E24 - Trouble Brewing.avi) failed
Reply
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
  • 14

Logout Mark Read Team Forum Stats Members Help
[RFC] Database Abstraction Proposal - Request for Comments (Devs and DB Admins only!)0