Kodi Community Forum

Full Version: How to prevent Kodi from caching a thumbnail.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Knowing that Kodi caches images "fanart\thumbnail" to enhance performance/speed of image loading; Is there a way to Force an image to reload every time it is accessed\mouse overed\reloaded? I have a .jpg that, even though it's Url is static - it is updated every 5-10 min on the website with most recent radar image w/ timestamp. Would be nice look.
Looking to possibly write an addon for the topic of Weather local\regional\world w/ recaps. Most of the radars will be .m3u8's.

Here is an example: h tps://radar.cbslocal.com/wjz/radar_anime/SatRad_Mid_Atlantic.jpg

I looked/searched through a couple of years worth of info and it appears it may not be possible. The only remedy is to clear the thumbnail cache and delete the Textures#.db - not what I would prefer. Would be nice if it is possible.
Any ideas?

Additional question - some radar's are animated .gif's - is there a way to display them?

Thanks, m5Germany

If I placed this in the wrong forum or written the request incorrectly, Please advise - as it has been years since my last post.
Maybe @bossanova808 might know
I indeed have animated radars in OzWeather - https://kodi.wiki/index.php?title=Add-on:Oz_Weather and code at: https://github.com/bossanova808/weather.ozweather

I use timestamps in the filenames to avoid caching issues - https://github.com/bossanova808/weather....ar.py#L177 - either adding to the end of file names, or renaming existing files to a new timestamp when needed.

I use the Kodi multitimage (slideshow) control in the skin files to actually show them - https://github.com/bossanova808/reposito...rRadar.xml

I believe if you have an animated gif and use the standard image control, it will animate (but you have less control that way than using multiimage and a series of frames).

I'm afraid that's really all I know about it.  Basically, I just hack it at the filename end of things to avoid the Kodi cache altogether.

Hope there is something there that helps...I've used this approach successfully for over 10 years now...
(2022-02-08, 21:22)m5Germany Wrote: [ -> ]Knowing that Kodi caches images "fanart\thumbnail" to enhance performance/speed of image loading; Is there a way to Force an image to reload every time it is accessed\mouse overed\reloaded? I have a .jpg that, even though it's Url is static - it is updated every 5-10 min on the website with most recent radar image w/ timestamp. Would be nice look.
Looking to possibly write an addon for the topic of Weather local\regional\world w/ recaps. Most of the radars will be .m3u8's.

Here is an example: h tps://radar.cbslocal.com/wjz/radar_anime/SatRad_Mid_Atlantic.jpg

I looked/searched through a couple of years worth of info and it appears it may not be possible. The only remedy is to clear the thumbnail cache and delete the Textures#.db - not what I would prefer. Would be nice if it is possible.
Any ideas?

Additional question - some radar's are animated .gif's - is there a way to display them?

Thanks, m5Germany

If I placed this in the wrong forum or written the request incorrectly, Please advise - as it has been years since my last post.


Here's some code I use to force freshness.  It is call by a service timer every 30 minutes but that interval could easily be changed. 


python:
def updateTexturesCache(contenturl):     # Update Kodi image cache timers
 
    try:
        from sqlite3 import dbapi2 as sqlite
    except:
        from pysqlite2 import dbapi2 as sqlite
                      
    DB = os.path.join(xbmcvfs.translatePath("special://database"), "Textures13.db")
    db = sqlite.connect(DB)

    serverport = '%' + media.getServerport(contenturl) + '%'        #  Get Mezzmo server port info
    newtime = (datetime.datetime.now() + datetime.timedelta(days=-3)).strftime('%Y-%m-%d %H:%M:%S')
    cur = db.execute('UPDATE texture SET lasthashcheck=? WHERE URL LIKE ? and lasthashcheck=?', \
    (newtime, serverport, ""))                                                         # Update Mezzmo image cache timers with no dates
    rows = cur.rowcount       
    db.commit()
    cur.close()
    db.close()
    mgenlog = 'Mezzmo textures cache timers '  + str(rows) + ' rows updated.'
    xbmc.log(mgenlog, xbmc.LOGINFO)
    media.mgenlogUpdate(mgenlog)    


Basically it sets the cache timer back 3 days which forces Kodi to refresh it each time.  The serverport variable is simply the main server URL which identifies the URL.  Depending upon what the source of the images is, this would need to be adjusted to match or you could simply update all but that would impact all ached images on Kodi.  In the case of your example serverport could be:

serverport = '%https://radar.cbslocal.com%'


Jeff
Thanks for quick reply.
@Karellen, @bossanova808, @jbinkley60

Thanks for quick response: This gives me something to work with. I really appreciate your help. Thanks, m5