Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhanced set_resolved_url() function, include bug fix. #68

Closed
wants to merge 2 commits into from

Conversation

ulion
Copy link
Contributor

@ulion ulion commented Dec 31, 2012

enhanced set_resolved_url() function, can set mimetype, can set succeeded=False.
prevent auto-calling plugin.finish() by set flag, which should not be called when setResolvedUrl get called.

This should be what #54 wanted

…eded=False.

prevent auto-calling plugin.finish() by set flag, which should not be called when setResolvedUrl get called.
@jbeluch
Copy link
Owner

jbeluch commented Jan 1, 2013

I had some changes for set_resolved_url locally that I hadn't pushed yet. It now takes a item (dict or xbmcswift2.Listitem) or a url optionally. If you pass an item, you can set the "properties" key to contain any properties you like, such as mimetype.

@ulion
Copy link
Contributor Author

ulion commented Jan 1, 2013

mimetype is an important property for set_resolved_url.
at the simplest condition, final url is all the function want.
but if the server did not send correct mimetype, xbmc will not play the file.
and the xbmc have to access the final url one more time to figure out the mimetype.
so normally, addon should set mimetype if it knows the mimetype.
so the final url and mimetype is the two most used parameters for call the set_resolved_url. other item infos already set in the dir listing items.
so the api should supply simple usage for the two parameters.

@dersphere
Copy link
Contributor

Being able to pass a rich listitem (including title, thumb) to set_resolved_url would have another benefit, but I'm not sure if xbmc pays attention to additional info labels.

Problem: When using smartphone apps like YATSE you can browse the plugins VFS (independently from the XBMC GUI). The problem is when you start playback from such an app, XBMC never got the original listitem. So the fullscreen OSD shows no correct title/thumb.

@ulion
Copy link
Contributor Author

ulion commented Jan 2, 2013

sure, it should be better if it can accept listitem also, I just want to keep function usage as simple as possible for the most common usage.
as the lack of info of the playing item, I also noticed, but have not found whether it can be resolved by only the serResolvedUrl call, I will do more test on it, hope it's not a xbmc bug.
on the other hand. I prefer use dict item than listitem since it's can be full dumped so I will try to make the dict item can do all list item does, such as replace context menu.
anyway, my this commit missing the listitem feature, maybe I can fix it to support listitem

@jbeluch
Copy link
Owner

jbeluch commented Jan 2, 2013

I updated set_resolved_url to take a dict here: 05da9dc.

The end_of_directory stuff still needs to be added, however. I'll use the applicable part of your PR.

@ulion
Copy link
Contributor Author

ulion commented Jan 2, 2013

the common _listitemify() code is good.
but the url and item two parameters is not so, I commented in your commited code.

@jbeluch
Copy link
Owner

jbeluch commented Feb 8, 2013

@ulion this can be closed now right? I think of the code/ideas from this PR have been incorporated?

@jbeluch
Copy link
Owner

jbeluch commented Feb 8, 2013

Ah, just noticed I have to add the _end_of_directory stuff to set_resolved_url. But then I believe everything is merged from this PR...

@ulion ulion closed this Feb 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants