Weather Radar
#1
I'm a programmer but not really a python or plugin developer but I did manager to hack some code together that downloads animated weather radar as the Weather backdrop specified on the custom skin settings screens. I tried just placing a single animated .gif file as the background but didn't find any that worked so what I wound up doing was writing code to extract all the layers to individual .png files. I also played with downloading sites with sequential jpg images but that's more of a hack than even I'm used to doing due to too many filename schemes.

I had to manually change a few settings in home.xml for how long to display each image and change randomize to false. One major issue was that even though new images were placed into the watched folder XBMC was not refreshing the cache. Using sqlite3 code I find the cached images in Textures.db, delete the cached files from Thumnails then remove the cache records from the texture table which seems to work even if I'm on the weather tab at the time.

View My Video

Questions and things I need to change

1. I need to use XBMC functions for the SQL work otherwise the script will not work with MySql. What's the best was to implement those functions with the XBMC framework?

2. Are there any issues with deleting thumbnails and cache records as long as they're ones I create? Playing around I did wind up with a few orphan png files and texture records but that was due to various naming schemes I was playing with. According to thumbnail wiki XBMC should detect the files are new.

"3. We generate a hash of the image, based on size and modified date, that we can use to check whether the original image has changed or not."

3. What is the exact format of animated gif required. I read the fanart wiki but it didn't have much info. I tried 4-5 different gif files I downloaded and also wrote some code to take the extracted png files I created and reassemble them back into a animated gif but could not get any of those to work either.

http://wiki.xbmc.org/?title=MultiImage_Control

4. I've got cron running the script every five minutes but I'd like to come up with a way to do it so that it runs every 5 or 10 minutes whenever XBMC is loaded.

At my current python/addon skill level it will take me about 2 months to turn this into an addon.
Mythbuntu doesn't need viruses - we have Sudo
Reply
#2
the weather.com plus plugin had the same functionality,
maybe you could check their code instead of reinventing the wheel.

i wouldn't bother with animated gifs if i were you,
just use a multiimage control to load a directory with .jpg images.

if you manage to turn this into an addon, you wouldn't have to worry about the cron job, as xbmc has a built-in 'alarmclock' functionality.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Weather Radar0