Repeated theme imports

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
markd
Advanced Member
Posts: 234
Joined: Fri Jul 21, 2006 4:32 pm

Repeated theme imports

Post by markd »

Hi Scott-

I'm working on adapting THC Jukebox for multi-zone use. What I'm trying to do is make a one zone import file, that has all the required devices, tasks, and theme. This is imported repeatedly, once per zone. Then I am taking advantage of the way that HB handles multiple devices with same name (the appended -1, -2, -3 etc) in my script in order to service all the different zones.

All this works great. There is a flaw though (which is why I am in the Bug section ;-). The duplicated Theme itself is handled right (incremented number), but the FILE that contains it is not- when I import, I get a warning that the file is going to be over-written. If you let it do this, it breaks all the links between the devices and theme (bad- a lot of extra work!). What I have been doing to work around this is to stop HB, manually rename the file, then use MDBplus to fix the filename in the database, as I can't find a way to do this from within HB. I have to do this between each import.

So my bug comes down to this- importing a theme file that is already in the themes directory is not handled properly. There should be a third option for collisions- overwrite, don't import, and import with incremented filename.

Thanks

Markd
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Repeated theme imports

Post by ScottBot »

Just getting a chance to look into this... finally.

I think a better solution is to just rename/number the file as it does with Devices, Tasks, etc. That way the new theme file will always be unique. Overwriting Theme files seems really dangerous. I never really added the necessary protection for this scenario, but I can see where it would be an issue with your setup.
Scott
markd
Advanced Member
Posts: 234
Joined: Fri Jul 21, 2006 4:32 pm

Re: Repeated theme imports

Post by markd »

Ok with me- that fixes my case!

Thanks

Markd
Post Reply