Kodi Community Forum

Full Version: How to update image when path to image is unchanged?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my weather addon I fetch a cloud layer that's superimposed over a map.

I've noticed that even though the image changes, the updated image is not displayed. Is there a way to instruct XBMC to refresh an image?

At the moment I have images stored in a made up path containing date and time, so that the Window.Property actually changes. However this means I have to manage erasing old images. I'd like to avoid this if possible.
Does the image URL (to the original cloud layer or whatever) change?

If not, there's no real way other than the way you're doing it. (Though I wonder if you could hack it by adding a couple of bogus protocol options to the image URL to get it to update?)

i.e.

http://server.com/path/to/image|somebogus=1;
(2014-01-07, 23:20)jmarshall Wrote: [ -> ]Does the image URL (to the original cloud layer or whatever) change?

No. For this question the path or url stays the same.

(2014-01-07, 23:20)jmarshall Wrote: [ -> ](Though I wonder if you could hack it by adding a couple of bogus protocol options to the image URL to get it to update?)

I don't think this will work. The path isn't a url but a local file, ie special://userdata/something/something/something/darkside.jpg

Another way to fudge it is to have two alternating cache paths. When one is used the other is cleared. Therefore when the script is called the path is always updated.

(2014-01-07, 23:34)Martijn Wrote: [ -> ]Would this help?
https://github.com/xbmc/xbmc/pull/3130

I don't think so, unless this trickles down into the skin.

My usage scenario is I set a property in python:

WINDOW.SetProperty('Weather.CloudCover', '/home/you/cloud.png')

Then I pull it into the skin with a <control type='image'>