• 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
script.module.metautils dev
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?
Reply
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
Reply
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
Reply
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
Reply
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
Reply
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.
Reply
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
Reply
sounds good. thanks
Reply
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 ! :-)
Reply
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
Reply
Excellent I'll update my sample tomorrow, its the bottom 2 functions
Reply
slyi Wrote:Excellent I'll update my sample tomorrow, its the bottom 2 functions

The 2 cache lookup by imdb functions?

Why do you need those versus using the standard either get_meta() or get_episode_meta() ? They both search the cache db first before searching online..

What you are doing in there is also already done in _cache_lookup_episode() and _cache_lookup_by_id(), imdb id's are passed into both, just they are not public
Reply
Eldorado Wrote:The 2 cache lookup by imdb functions?

Why do you need those versus using the standard either get_meta() or get_episode_meta() ? They both search the cache db first before searching online..

What you are doing in there is also already done in _cache_lookup_episode() and _cache_lookup_by_id(), imdb id's are passed into both, just they are not public

What im after is a way to poll the local cache, without spawning a online request. I was creating the batch querys, as i come from the net world where you aim to hit the DB a little as possible due to net / file io which have a perrf cost normally, maybe on sqlite its less of an issue.

Yes the private functions are probably the way to go, but i didnt know if i should reference these directly. Is there an reason, they are private?
Reply
slyi Wrote:What im after is a way to poll the local cache, without spawning a online request. I was creating the batch querys, as i come from the net world where you aim to hit the DB a little as possible due to net / file io which have a perrf cost normally, maybe on sqlite its less of an issue.

Yes the private functions are probably the way to go, but i didnt know if i should reference these directly. Is there an reason, they are private?

I usually put functions private if I don't think there's any need to call them externally.. kind of a way to simplify the class Smile

Just took a peak.. if you call them directly you will be missing out on some formatting of the data which I do in get_meta

- convert the cast from a string to a tuple which xbmc expects (I have to store it in the db as a string)
- create and return 'trailer' with the youtube plugin hookup
- Returns the name in 'title' that you passed in rather than the title from the DB - you will notice the movie name in the DB is stripped and lower cased

I assumed you would want to search online if it's not found in DB? Otherwise you will have movie/tvshows without meta data in your listings

Is it worth it to maybe add a switch to get_meta to search online or not?

Edit - ok now that I am fully awake, I read over your code again and see what you are doing.. good idea to group them all and do one batch call, would be interesting to see processing time of batch vs one at a time calls - but I still need to ask, why would you want to skip doing an online call for a movie/tvshow not found in cache db?
Reply
Pushed in some more updates, it's gotta be almost there! Smile

- single movie refresh should be working solid, would like others to test this one out.. it's really meant to correct failed lookups or incorrect matches when searching by name. If you already have the imdb/tmdb id then it may insert a duplicate entry
- a bunch of other small fix ups here and there, more logging etc.
- dates converting properly now

Would really like some good testing against the refresh stuff, I'm pretty sure I got it to be as good as we can get in an addon

I've also added a small tester addon to the repository, it's very quick and just shows how to search a movie by the 3 different forms:

- by imdb id
- by tmdb id
- by name/year

Then does tvshow, seasons, and episodes all with meta data

Also demonstrating how to toggle watched/unwatched status via the context menu.. still need to do some coding to automatically set it when you have actually watched the video, but is outside of metahandlers

And last showing how to do a single movie meta refresh via context menu

I should note that the tester addon works on the t0mm0's latest version of his common library plus my own edits to add context menu support so it won't actually work until he is able to add that support officially... so for now you can at least read the code Smile


Also... I'm noticing that I'm not getting watched marks to show, has anyone else been able to get them to show up? I'm pretty sure I am correct in setting infolabel 'overlay' to 6 for unwatched, 7 for watched... ? Using the confluence skin you should see a check mark when a video is marked as watched
Reply
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11

Logout Mark Read Team Forum Stats Members Help
script.module.metautils dev2