Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
some shows don't have genre listed on their page. They aren't listed under genres right now.
I want incremental updates. it would be much faster. I am a novice to database queries which is probably slowing me down.
I had the idea of displaying the cache to the user and then silently updating the cache in the background for new items.
Posts: 87
Joined: Aug 2010
Reputation:
1
I can understand, last week has been my crash course in python, together with sqlite and sql querries for the first time, but making the db was a process where i would inveritably have xbmc crashing on me, so i made sure that the update to db was incremental. Check if in db, if not then query tvdb, that was my logic, and also cache a state whre you querry tvdb and if not found save that state, so that you don't keep going over and over the same shows.
I was thinking of adding a date column of when the tvdb was queried for that show, and next time if db is asked for it and state says not found in tvdb, but was checked like a month back, then it can re-query tvdb for that item.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
I committed small update to change to use mechanize for login. It should work much better. It also will inform the user if the email or password is incorrect.
thanks to mighty_bombero for the code.
Posts: 10
Joined: Aug 2011
Reputation:
0
2011-09-05, 04:12
(This post was last modified: 2011-09-05, 13:53 by cmo1982.)
Sorry about that - I'm clearly a noob here. I'll repost.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
please don't post logs on the forum. please delete it and post it to a paste service. it is much harder to read a jumbled mess.
what platform are you on? seems to be a mechanize module problem.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
cmo1982: it seems to be a bug in handling redirects in python 2.4. The server sends a HTTP Error 302 Moved temporarily to redirect to the sign-in page. the redirected page has a space in it and it should be encoded as '%20' but isn't and throws an error because python wants it encoded correctly.
I can add an option to use the old login code for people using that version of python. It isn't as reliable. It also seems slower to me. I haven't actually timed it though.
which xbmc build are you using?
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
devicenull: I am actually redoing the database structure with 2 tables. I did it for movies. it has movies and moviedata. I assigned the asin(amazon standard id number) as the primary key in each. movies is just title,url,poster. everything scraped from the initial page. It is just the prime movies.
I can use moviedata so cache metadata for My Library items as well so it doesn't have to look them up each time. If it encounter a new item it scrapes and caches it. The asin is unique among all videos so I thought it would work well for the primary key. I will look into preventing duplicates like you suggested.
It also has tvdb and tmdb options.
anyway I hope the database code will look better soon. I would love for you to suggest any improvements on the new code when I post it. anyway I am off to lunch.
Posts: 76
Joined: Feb 2011
Reputation:
0
Thanks for the excellent addon.
I'm able to play My Videos on AppleTV2.
Now i'm ready to rent a movie and try playing it.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
I committed an update so it can now cache the metadata on the fly for new items in your library. The queue feature will also make use of this.
it has a lot of under the hood changes for the next update. It will include tvdb and tmdb module support for better posters and fanart. It can also supplement the database a bit too.
It will be pretty easy to update too because I can process the releases in the past 30 days page and have it update the database with the newest items. It will also be possible to do a full movie or tv show rescan without metadata update. This is relatively quick because it is much fewer web requests. It is slow doing a full database with metadata rebuild though.
devicenull: I am a sql novice so appreciate any sql suggestions. if you want to check out the current code.
Some duplicates are in the amazon database itself. They don't duplicate asin but do duplicate content exactly. In fact a few deep space nine season 1 episodes a peppered through out the show list. Deep space nine also has a couple season 5 listings on amazon. I am just going to make removing items from the database as a context items in xbmc so one can prune items they dislike.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
devicenull: the tables serve different purposes. Not all metadata is for the prime items. the movies table is only prime movies. The moviedata table is used to cache all movie metadata for any asin encountered. This would include My Library and the new feature My Queue when I commit it. the data in the movies table are always updated from a list source. the data in moviedata are always updated from page source. the list source is scraped for some things My Library.
I am also adding scraping items for some prime items as well. The past 30 days of new movies will always be a new scraped list. When the list is loaded any new items metadata for it is saved. It will also add those items to your prime library if missing.
what is a 1-to-N relationship?
why does it matter when I populate them?
I will make it one connection and use different cursors. I fixed that query.