robweber / cronxbmc

A simple Cron-like service for Kodi
MIT License
19 stars 19 forks source link

Doens't work #14

Closed shnabz closed 6 years ago

shnabz commented 6 years ago

I can add a cron, and I can see that I have added a cron by using manager.getJobs(). Howevere it doesn't show in the GUI or the xml and the cron never gets called. No error messages are shown in the Kodi log.

shnabz commented 6 years ago

It seems to be writing the cron.xml to my app's root dir.

shnabz commented 6 years ago

I changed line 153 to f = xbmcvfs.File(xbmc.translatePath('special://profile/addon_data/service.cronxbmc/cron.xml'),"w") and now it's working.

robweber commented 6 years ago

Interesting, the utils.data_dir() might actually be resolving to the data directory of whatever addon you're using it in if you're calling the manager class directly from another addon. I never really thought through how that would work when using it as an import.

Probably best to hardcode the cron.xml path as you've done. If you want to do a PR with your changes I'll merge it in, otherwise I can add it too.

robweber commented 6 years ago

Importing it as part of another addon is definitely one of the ways you can use cronxbmc. The fact that it didn't work is an oversight on my part. There is even a part in the README file regarding how to import it.

I'll push this fix later today, I think your solution will keep it working as expected.

shnabz commented 6 years ago

👍🏼