script.module.metautils dev

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #121
What about creating a switch where when calling Get_Meta

ie
meta = metaget.get_meta('movie', CleanHTML(name), year=sYear, Trailer=??)

?? could be Youtube or Plain etc.... Just an idea

Otherwise when adding meta to the Dir creating routine in our addon , we add the Trailer as another dict.

Code:
addon.add_Metadirectory({'mode' : 'GetMovieSource', 'url' : url }, meta ,total_items=len(match),title=CleanHTML(name) + '  (' +  sYear + ')' , img=meta['cover_url'],trailer=resolvedYoutubeURL)

Eldorado Wrote:I was considering it, but then thought it's probably best that I don't do that in case things such as the youtube addon changes, or you just would like to play it differently for whatever reason eg. with the urlresolver

I guess this is up for debate, generally I like to pass back unmolested data which may force you to take certain directions unless there is a specific reason for touching it, this could be a case where I do.. but I'm very 50/50 on it

Anyone want to chime in on the topic?
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #122
k_zeon Wrote:Eldorado, How would you call the search feature to update a single Movie. If on Apple TV2 , would it be select movie then hold menu to popup context menu...

Basically that, add an option to your context menu to be something like 'Refresh Meta Data'.. I would word it in a way that is similar to the local library

If you can figure out how to use the already present 'Refresh' button that you see when viewing the movie info then even better!

Basically from there take the results and put them into a dialog box, capture which one the user selects and pass imdb id/tmdb id into get_meta() again.. it will then grab the info for that id and update the DB
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #123
k_zeon Wrote:What about creating a switch where when calling Get_Meta

ie
meta = metaget.get_meta('movie', CleanHTML(name), year=sYear, Trailer=??)

?? could be Youtube or Plain etc.... Just an idea

Otherwise when adding meta to the Dir creating routine in our addon , we add the Trailer as another dict.

Code:
addon.add_Metadirectory({'mode' : 'GetMovieSource', 'url' : url }, meta ,total_items=len(match),title=CleanHTML(name) + '  (' +  sYear + ')' , img=meta['cover_url'],trailer=resolvedYoutubeURL)

I was thinking you would do something like this, using your code and adding a get_trailer() function:

Code:
meta = get_meta('movie', CleanHTML(name), year=sYear)
meta['trailer'] = get_trailer(meta['trailer_url'])
addon.add_Metadirectory({'mode' : 'GetMovieSource', 'url' : url }, meta ,total_items=len(match),title=CleanHTML(name) + '  (' +  sYear + ')' , img=meta['cover_url'])

edit - actually after thinking about this a bit, I am storing and passing back 'trailer_url' which is the untouched data, I can just continue doing that and pass back 'trailer' as well with it touched up with the code to make it play via the Youtube addon.. I'll fix up the code sometime soon
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #124
I got the Youtube trailers playing from the info screen.

No idea how to use the refresh button on the info screen. would be cool.

Must be set by a boolean true=active. thought maybe it was an infolabel

ie infolabel['refresh']=true
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #125
k_zeon Wrote:I got the Youtube trailers playing from the info screen.

No idea how to use the refresh button on the info screen. would be cool.

Must be set by a boolean true=active. thought maybe it was an infolabel

ie infolabel['refresh']=true

Haven't seen anything such as that, but then you would also need to step in and handle the code that the button executes..

I've been playing with context menus and testing single movie refresh, as it turns out my current implementation in metahandlers isn't so great Smile I've revamped it a bit, still a bit messy.. once I'm happy with it, I'll push another version out

But the watched/unwatched status seems to work well

Now need to find t0mm0 and get him to add contextmenu support to his library! Smile
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #126
Eldorado Wrote:Haven't seen anything such as that, but then you would also need to step in and handle the code that the button executes..

I've been playing with context menus and testing single movie refresh, as it turns out my current implementation in metahandlers isn't so great Smile I've revamped it a bit, still a bit messy.. once I'm happy with it, I'll push another version out

But the watched/unwatched status seems to work well

Now need to find t0mm0 and get him to add contextmenu support to his library! Smile

Dragonwin has context support and he has even made a fork on t0mm0s module.
I did see it on his git hub before but not sure if its there now.
Maybe give him a text.
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #127
k_zeon Wrote:Dragonwin has context support and he has even made a fork on t0mm0s module.
I did see it on his git hub before but not sure if its there now.
Maybe give him a text.

Yeah I read over his posts in the urlresolver thread, then just popped it in myself on my local copy

I have a very small addon that I'm using for testing quick things.. much in the same sense as t0mm0 has for his urlresolver

I'll pop that up soon as well, should make the usage of all this stuff pretty easy to follow
find quote
k_zeon Offline
Senior Member
Posts: 204
Joined: Aug 2011
Reputation: 0
Post: #128
sounds good. thanks
find quote
slyi Offline
Junior Member
Posts: 39
Joined: Sep 2011
Reputation: 0
Post: #129
Eldorado Wrote:It would be nice to get to the point of using t0mm0's libraries with Icefilms, but I can only assume there will need to be major re-structuring of the code to get there.. the 1.1.0 release will likely just focus on the already included new features, then if anyone wants to take the challenge after that to rework it with t0mm0's libs

Can you post up the full debug log where you are getting that error? Basicalliy means it is trying to insert an exact duplicate row into the episode_meta table, and for some reason it did not find and delete the original one before trying to add the new

Sorry i have not been on in while, I need a couple of helper functions added to metahandler.py https://github.com/slyi/xbmc-metautils/b...andlers.py before i can implement it in icefilms. Can you please review. I still learning gitgui so excuse my rookie mistakes ! :-)
find quote
Eldorado Offline
Posting Freak
Posts: 922
Joined: May 2009
Reputation: 11
Post: #130
slyi Wrote:Sorry i have not been on in while, I need a couple of helper functions added to metahandler.py https://github.com/slyi/xbmc-metautils/b...andlers.py before i can implement it in icefilms. Can you please review. I still learning gitgui so excuse my rookie mistakes ! :-)

Can you point me to specifically which functions you are referring? Smile

I may have fixed your error with the duplicate key, I updated the episode stuff on how it checks for duplicate entries before inserts, it was using the title as one of they keys where it probably shouldn't
find quote
Post Reply