script.module.metautils dev

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #91
slyi Wrote:I was just using json for simplity for my own testing, sql is definatly the best option. I was playing with t0mmo test sample to enable metahandler async. I needed to add a couple of helper queries to metahandlers but otherwise it works well and loads unscraped content faster.

http://dl.dropbox.com/u/6589941/asyncmet...ult.py.txt
http://dl.dropbox.com/u/6589941/asyncmet...ers.py.txt

There is a still some bugs in it that i need to figure out and add back in updating the UI as each thead completes.

Threads run in the background even if the users exit the app and the will still save the requested data to the DB for next load.

Very cool stuff

Would you be interested in helping apply asynchronous calls to the next major version of Icefilms? Since you are already playing with Icefilms code... Smile
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #92
Just pushed a quick update that adds 'year' to the movie meta table, this is the year that is passed in by the user

I want to enhance this slightly to take the year from the 'premiered' date and use in in 'year' if the user does not pass in a year, as I missed this one when looking at infolabels.. 'year' is an infolabel and most skins make use of it

Does anyone know of a skin that displays 'premiered' ?

Also tested and slightly fixed up the watched status, it works well.. I've updated the first post with instructions on how to use, it's pretty simple.. but will need some practical testing in case it needs enhancements

Otherwise I'm pretty happy with how it scrapes, stores, retrieves the data.. next up is some enhancements:

- method to insert metadata packs into database so that each addon can supply it's own pack
- individual item update, I believe I just need to return a list of matches from TMDB based on movie name.. should be easy to do
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #93
Hey Eldorado

Just been trying to make t0mm0's common module can add your infolabes but am having a hard time trying to get it to work.

Any tips to why the error

http://pastebin.com/sUYWTrid

Code:
def add_Metadirectory(self, queries, infolabels, img='',fanart='',total_items=0,isFolder=True):
    
        infolabels= self.unescape_dict(infolabels)
        url = self.build_plugin_url(queries)
        listitem = xbmcgui.ListItem(infolabels['title'], iconImage=img,thumbnailImage=img)
        listitem.setInfo('video', infolabels)
        
        xbmcplugin.addDirectoryItem(self.handle, url, listitem,isFolder=is_folder, totalItems=total_items)
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #94
k_zeon Wrote:Hey Eldorado

Just been trying to make t0mm0's common module can add your infolabes but am having a hard time trying to get it to work.

Any tips to why the error

http://pastebin.com/sUYWTrid

Code:
def add_Metadirectory(self, queries, infolabels, img='',fanart='',total_items=0,isFolder=True):
    
        infolabels= self.unescape_dict(infolabels)
        url = self.build_plugin_url(queries)
        listitem = xbmcgui.ListItem(infolabels['title'], iconImage=img,thumbnailImage=img)
        listitem.setInfo('video', infolabels)
        
        xbmcplugin.addDirectoryItem(self.handle, url, listitem,isFolder=is_folder, totalItems=total_items)

It's because currently his library doesn't allow adding meta data to directories, only to video items... it should be an easy fix if it can be done the way I think it can, just haven't tried it yet..
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #95
Eldorado Wrote:It's because currently his library doesn't allow adding meta data to directories, only to video items... it should be an easy fix if it can be done the way I think it can, just haven't tried it yet..


Yes that was what i am trying to do. this bit of code goes in t0mm0's common module, but i cannot get it to work.
Unless i need to add more code that i am not aware of.

As soon as i get this working i can get on with finishing my addon.
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #96
k_zeon Wrote:Yes that was what i am trying to do. this bit of code goes in t0mm0's common module, but i cannot get it to work.
Unless i need to add more code that i am not aware of.

As soon as i get this working i can get on with finishing my addon.

Ah.. quickly scanned what you had there

Error must be in the meta data you are passing in, whatever it is wants an integer vs string, kind of hard to tell which one it is.. can you try systematically adding them one by one until the error hits?

Just finished up a quick method to return a list of possible matches to use where the user would like to refresh meta data for an individual movie, I'll send it up soon and update first post with instructions
(This post was last modified: 2011-10-21 18:40 by Eldorado.)
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #97
I just used and tweaked the AddDir that is already in t0mm0's common module.

If it works for Add_videoitem then it should work here.

Strange
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #98
k_zeon Wrote:I just used and tweaked the AddDir that is already in t0mm0's common module.

If it works for Add_videoitem then it should work here.

Strange

I was thinking that add_video_item should be the one to get modified, just add a parm to it to specify if it's a folder.. if you add a isfolder=True it will do what you want
find quote
slyi Offline
Junior Member
Posts: 39
Joined: Sep 2011
Reputation: 0
Post: #99
Eldorado Wrote:Very cool stuff

Would you be interested in helping apply asynchronous calls to the next major version of Icefilms? Since you are already playing with Icefilms code... Smile

Yes I be happy to help, do you have a github for icefilms using t0mmo lib yet or is too early, I updated the two files above for some updates which seen to fix most remaining issues apart from a dup "Seven days" issue on "s".
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #100
hey Eldorado

found that when adding the Plot, i get through approx 157 then it errors

self.log_debug(u'adding movie: %s - %s' % (infolabels['title'], infolabels['plot']))

listitem.setInfo('video', {'Title': infolabels['title'], 'Genre': infolabels['genre'], 'Plot': infolabels['plot']})

Looked through the Log http://pastebin.com/W6SMz97B
and found a the Plot being returned as None.
This is not a str or int

should it not return 'None' as a string or just ' '

Edit:

In my new Def i have added a check that if infolabels['plot'] = None then make infolabels['plot'] ='' (ie a string)
maybe i will come accross more of these when adding each infolabel.
I did:
Code:
if infolabels['plot'] is None:
            infolabels['plot']=''
         if infolabels['rating'] is None:
            infolabels['rating']=float(0)
         if infolabels['genre'] is None:
            infolabels['genre']=''
         if infolabels['duration'] is None:
            infolabels['duration']=int(0)  
         if infolabels['mpaa'] is None:
            infolabels['mpaa']=''
         if infolabels['trailer_url'] is None:
            infolabels['trailer_url']=''
         if infolabels['cast'] is None:
            infolabels['cast']=''

Maybe you should change the return from None to ''

Edit:
Also found that Trailer Urls load but when trying to play they dont. Is there a way to get the Youtube trailer to play using the Youtube addon.
(This post was last modified: 2011-10-22 12:10 by k_zeon.)
find quote
Post Reply