mvallevand Wrote:I like your fix for midnight but not keen on moving time fixes out of xnewa_connect. I want it to be the glue to newa having it do all the data normalization. I might move it to lib but I definitel want it to b e a lib any future xbmc addon could use. I still have to move player out of details to isolate things better but web client and x-newa should in theory be able to work as two addons with proper planning.
That doesn't look too difficult. I can move the stuff out of xnewa_datetime.py and into xnewa_connect. I think it would make sense rename the public functions to formatDate and formatTime so that the call would be something like self.xnewa.formatDate( self.detailData['start'], withyear=True ) and self.xnewa.formatTime( self.detailData['start'] ).
On a completely unrelated front, I kind of fell down a rathole around the image storage and cache stuff. I was trying to troubleshoot an image display issue and spent way longer than I wanted to finding all the places XNEWA stores images. As it currently stands, XNEWA stores the following things (I think):
1- channel images are downloaded from NPVR and stored in script.xbmc.xnewa/fanart/Channels
2- show images are downloaded from NPVR and stored in special://temp/x-newa/covers
3- if there are images in script.xbmc.xnewa/fanart/Shows they are used instead of special://temp/x-newa/covers
4- genre images are read from script.xbmc.xnewa/fanart/Genres, but it doesn't look like they are download from NPVR
I'd like to propose (and I already having working code for this) the following:
1- channel images downloaded from NPVR would be stored in special://temp/x-newa/fanart/Channels
2- show images downloaded from NPVR would be stored in special://temp/x-newa/fanart/Shows
3- genre images downloaded from NPVR (if such a thing ever happens) would be stored in special://temp/x-newa/fanart/Genres
4- there would be an 'override folder' in addon_data/script.xbmc.xnewa called fanart with subdirectories for Channels, Shows, and Genres
5- if there are images in addon_data/script.xbmc.xnewa/fanart/ they are used instead of the ones in special://temp
A couple of nice things happens when you do this. First, updating the addon doesn't blow away the images. That would mean XNEWA wouldn't have to download the channel images again after every update *and* a user wouldn't lose any custom show images. I'm not saying the latter has happened to me, but the latter has happened to me. Second, the cache and override folders have consistent naming and all the image types have the same behavior (right now Genre Icons and Channel Icons have no cache, but Show Icons do).
I'm also wondering if, based on your desire to have XNEWA_Connect be the call point for all the central functions, the stuff in fanart.py should just be moved into XNEWA_Connect. Right now XNEWA_Connect handles the downloads and fanart.py handles the reads. That's not necessarily a big problem, but some constants have to be manually synced up between the two (like cache location) in order for everything to work right.
I'm happy to work on the image code, since I can sort of stretch and say it's within the scope of the skinning work.