Using OAuth URLs for thumbnails
#1
Hello.

I'm writing an addon that interfaces with an OAuth API. This API allows me to list and download videos, and also to obtain their thumbnails.

While populating ListItems I was thinking of supplying XBMC with pre-authed URLs as the 'thumbnail' attribute, but it seems XBMC does multiple requests to this resource (HEAD, followed by two GETs). Since OAuth authorizations carry a nonce, after the first request all the others will fail.

What would be the best approach to solve this issue? I was thinking of downloading all the thumbs of that page and supply local file:// URLs, but loading all the thumbs is a slow process to do before rendering the page. Also, where would I store all these thumbnails?

Thanks for the help.
Reply
#2
Let me quote my reply from the other thread, here is a better place for that discussion:

(2013-07-31, 21:12)sphere Wrote:
(2013-07-31, 18:43)EDevil Wrote: Some async mechanism to supply the URL both in the "thumbnail" attribute of a ListItem and in the "path" attribute when listing a SlideShow would be perfect.

This is already possible.
In Detail:
- You can use setResolvedUrl() for the path which is async (your plugin will be called to retrieve the playpath when needed).
- You can write an image plugin and use its plugin url as slideshow path (combine with above).

But anyway, its sad that there is no real progress on 27/30 api wishes.
My GitHub. My Add-ons:
Image
Reply
#3
I already use a "plugin://" URL that uses setResolvedUrl() on the "path" attribute of ListItems in the video and audio components of my addon. Both contents play fine. It is only in the images component that setResolvedUrl with "plugin://" paths is not supported.

You suggested writing a custom Image plugin that would do the slideshow instead of using the builtin slideshow? How hard would this be? Is there some other plugin I can use as an example? This is my first plugin so please bear with me...

Would this enable me to use "plugin://" URLs in the "thumbnail" component of ListItems?

Thanks for the help!
Reply
#4
(2013-08-01, 10:04)EDevil Wrote: I already use a "plugin://" URL that uses setResolvedUrl() on the "path" attribute of ListItems in the video and audio components of my addon. Both contents play fine. It is only in the images component that setResolvedUrl with "plugin://" paths is not supported.

You suggested writing a custom Image plugin that would do the slideshow instead of using the builtin slideshow? How hard would this be? Is there some other plugin I can use as an example? This is my first plugin so please bare with me...

Would this enable me to use "plugin://" URLs in the "thumbnail" component of ListItems?

Thanks for the help!

The plugin VFS (URLs with "plugin://") only gets resolved on ListItems path (not in thumbnail or iconImage).

But you can start a (builtin) slideshow to a plugin VFS where you expose a bunch of listitems with each pointing to plugin VFS single listitem which uses setResolvedUrl to return its path async. So this way only works for slideshows on an image plugin.
My GitHub. My Add-ons:
Image
Reply
#5
I have tried to do what you suggest. What ended up happening was that when I click on a picture, which should start the SlideShow functionality, I get an empty list.

This is my code: https://github.com/edevil/CloudPTXBMC/bl...don.py#L90

So, browse_image() builds lists of ListItem with paths of type "plugin://". These paths point to show_image() which immediately returns a single ListItem with setResolvedUrl(). Is this not it?
Reply
#6
I tried it myself and you are right - it doesn't work!
Either I am wrong or it worked some time ago.

Sorry.
My GitHub. My Add-ons:
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Using OAuth URLs for thumbnails0