Kodi Community Forum
Library Auto Updater - Version 1.1.0 - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152)
+---- Thread: Library Auto Updater - Version 1.1.0 (/showthread.php?tid=119520)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32


- robweber - 2012-03-01

stevenD Wrote:I can't get it working either. I get this error in the log:
Code:
20:12:13 T:94728192   ERROR: Error Contents: global name 'timer_amounts' is not defined
20:12:13 T:94728192   ERROR: Traceback (most recent call last):
                                              File "/var/mobile/Library/Preferences/XBMC/addons/service.libraryautoupdate/default.py", line 6, in <module>
                                                AutoUpdater().runProgram()
                                              File "/var/mobile/Library/Preferences/XBMC/addons/service.libraryautoupdate/service.py", line 31, in runProgram
                                                if(time.time() >= self.last_run + (timer_amounts[self.Addon.getSetting('timer_amount')] * 60 * 60)):
                                            NameError: global name 'timer_amounts' is not defined

Found it! If you disable the startup delay this will go away. I'm sending out the fix tonight. I never use the startup delay myself so this one slipped through the cracks. I tested it out when it was first implemented and hadn't thought it changed, sorry about that.

Just an FYI, the addon repo is still showing 0.5.1 as the most current version, this is the one with the import os error, I received a confirmation of the pull but haven't had my HTPC update from the main repo to that version yet. a quick fix is to add "import os" to the top of service.py with the rest of the imports.

Just wanted to update this piece - 5.4 is the eden repo now, and so were 5.2 and 5.3. I was still on Eden Beta 3 due to the early issues with RC1 so I may have still been "pointed" at the eden-pre repo where 5.1 is the final update there.

Just as a shout out to everyone, I'm very sorry for the bugs in the last release. Normally the updater is rock solid and I'm pretty disappointed with the pieces that didn't work out. I'm developing a better test mechanism to make sure all the i's are dotted and t's crossed in the future.


- ceravis - 2012-03-06

@robweber - no worries, we're not exactly paying you for your hard work Wink Thanks for this great addon!


- stevenD - 2012-03-06

Thanks! Works for me, on Eden RC2...


- robweber - 2012-03-07

Thanks! Glad it is working.

I started a new thread for a pure Cron XBMC scheduler that enhances the code already in the updater addon (as I hinted at a few posts ago). I'm looking for a little help finishing up the GUI portion of it, so anyone that knows something about skinning please check that out.

http://forum.xbmc.org/showthread.php?p=1039056

-Disclaimer: the Cron XBMC addon is not meant to be a replacement for the Updater addon. I do expect people will use one or the other, but I think there will always be a place for an easy library timer type addon. Cron XBMC is meant as a more advanced scheduler for people that need that type of flexibility. -


- robweber - 2012-03-09

Update 5.6

Hopefully within the next couple days you'll see update 5.6 pushed out to the Eden Repo. A few things to point out in this new release:

1) Support for notifications has been added (enabled by default). This will show XBMC notifications to display the next update time (in days, hours and minutes). These notifications will display on startup, after an update is begun, and when settings change. They aren't obtrusive (that I can tell) but will give confirmation that yes the addon is working and how long until you can expect an update.

2) The manual run component has been changed slightly. You'll now get a dialog box where you can see how long until the next update, and then confirm or cancel a manual run of the update. This should serve as both a check ("how long until the next update?") and a way to kick-start a manual run.

3) I've changed the cron expression library to one called croniter. This library has more functionality and I like that you could use python datetime objects or regular unix timestamps with it.

As usual if there are any problems or requests please post them here.


RE: XBMC Library Updater Addon - LoL - 2012-03-19

Hey robweber, thx for this great addon!

Few Questions/Requests Wink
- Is there a possibility to only update TV-shows and not Movies?
- Would it be possible to add an option to automatically run the watchlist addon after a library update? Or do a restart of xbmc after updating so watchlist gets updated?

Thx, LoL Wink



RE: XBMC Library Updater Addon - robweber - 2012-03-20

(2012-03-19, 17:31)LoL Wrote: Hey robweber, thx for this great addon!

Few Questions/Requests Wink
- Is there a possibility to only update TV-shows and not Movies?
- Would it be possible to add an option to automatically run the watchlist addon after a library update? Or do a restart of xbmc after updating so watchlist gets updated?

Thx, LoL Wink

Thanks, glad you find the addon useful. Regarding your requests:

1. I would really like to offer this functionality, but need to explore it a little more. You can give a 'path' parameters to the update library function, the problem is I'll need a way of figuring out which paths belong to which pieces of content. Right now everything is either Video or Music, but I may be able to find a way to query the main video DB and get the info. Not making any promises though! On the plus side I am working on separating the timers for video and music, I know people have been asking for this so I'd like to get this one done soon. It really isn't too hard but I wanted to reconfigure the codebase to make it easier to add more timers in the future as well.

2. Running a script once the library update finishes is a great idea - not something that occurred to me before. I think once I have the music/video timers separated I will try to add this functionality. This way you could kick off another addon/script for each video and music.

Thanks for the suggestions. I'll be sure to post back here as updates come out so you have an idea of when you might see some of this.



RE: XBMC Library Updater Addon - GJones - 2012-03-20

(2012-03-20, 03:54)robweber Wrote:
(2012-03-19, 17:31)LoL Wrote: Hey robweber, thx for this great addon!

Few Questions/Requests Wink
- Is there a possibility to only update TV-shows and not Movies?
- Would it be possible to add an option to automatically run the watchlist addon after a library update? Or do a restart of xbmc after updating so watchlist gets updated?

Thx, LoL Wink

Thanks, glad you find the addon useful. Regarding your requests:

1. I would really like to offer this functionality, but need to explore it a little more. You can give a 'path' parameters to the update library function, the problem is I'll need a way of figuring out which paths belong to which pieces of content. Right now everything is either Video or Music, but I may be able to find a way to query the main video DB and get the info. Not making any promises though! On the plus side I am working on separating the timers for video and music, I know people have been asking for this so I'd like to get this one done soon. It really isn't too hard but I wanted to reconfigure the codebase to make it easier to add more timers in the future as well.

2. Running a script once the library update finishes is a great idea - not something that occurred to me before. I think once I have the music/video timers separated I will try to add this functionality. This way you could kick off another addon/script for each video and music.

Thanks for the suggestions. I'll be sure to post back here as updates come out so you have an idea of when you might see some of this.
I would prefer setting the path myself. That would allow specifying the folder that gets updated without waiting for others. I have 4 different movie sources.



RE: XBMC Library Updater Addon - robweber - 2012-03-20

(2012-03-20, 04:22)GJones Wrote: I would prefer setting the path myself. That would allow specifying the folder that gets updated without waiting for others. I have 4 different movie sources.

This idea sounds a bit better than trying to get path information out of the video database and keep track of it. I'll add this to the request list and see how it can be worked in. Thanks.


RE: XBMC Library Updater Addon - Lathlas - 2012-03-21

I'd like for the startup delay option to apply to every instance of the auto update script running. If it triggers while I'm watching something, then it runs as soon as I'm done watching, which prevents me from removing what I just watched from the library or conveniently watching something else immediately. Stopping the update from the context menu tends to cause my ATV2 to hang for as much as a minute while it processes.

I would also like for the default timers to include some factors of 24 so they can trigger on a more regular schedule. 4, 6 & 12 would be nice. I tried to use the cron timer and it was kind of difficult.

Thank you for your hard work on this service, I love it even if it does annoy me once in a while.


RE: XBMC Library Updater Addon - robweber - 2012-03-21

(2012-03-21, 18:07)Lathlas Wrote: I'd like for the startup delay option to apply to every instance of the auto update script running. If it triggers while I'm watching something, then it runs as soon as I'm done watching, which prevents me from removing what I just watched from the library or conveniently watching something else immediately. Stopping the update from the context menu tends to cause my ATV2 to hang for as much as a minute while it processes.

I would also like for the default timers to include some factors of 24 so they can trigger on a more regular schedule. 4, 6 & 12 would be nice. I tried to use the cron timer and it was kind of difficult.

Thank you for your hard work on this service, I love it even if it does annoy me once in a while.

Thanks for the comments - looks like the request list is growing! I can understand the frustration when the scan starts right after you finish watching something. I've had it happen to me as well, and if there are shows found, or a lot of paths, can take a while to finish. The timer options were kind of just my best guess at what appropriate levels might be, but I can see how your adjustments would help. Definitely good ideas.


RE: XBMC Library Updater Addon - robweber - 2012-03-26

Version 0.5.8

There are so many backend changes going on in this one I'd like some help testing before submitting it for a repo pull request. I'm posting a link to a zip file containing the latest changes, anyone is welcome to give it a quick test and let me know what you think. Notable changes include:
  • Separating of Video and Music Timers
  • Interval timer now uses a cron expression on the backend for better reuse of code
  • 1 minute delay of scan if scan should have run during media playback. This should prevent the problem that sometimes happens when XBMC is done playing media and a scan starts instantly. Starting a new media file resets the 1 minute timer again. (thanks @Lathlas for the idea).

By consolidating the code to use cron in the service portion I'm hoping to move on to custom path scanning after this. Each timer is now contained separately so adding more should be a lot easier. Thanks in advance to anyone helping test this out.

http://xbmclibraryautoupdate.googlecode.com/files/service.libraryautoupdate.zip


RE: XBMC Library Updater Addon - Radikaltimes - 2012-03-27

is there a way to add clean library to the process?


RE: XBMC Library Updater Addon - robweber - 2012-03-27

(2012-03-27, 00:36)Radikaltimes Wrote: is there a way to add clean library to the process?

Adding the function to clean the database is pretty trivial. The problem I found when trying to add this earlier is that there is no way to tell if a database clean operation is happening (like you can with scanning) so it is possible to hose up the xbmc process by executing it while another is already running. I did a test case with a cron expression set to run fairly often, like every 10 minutes, and locked up xbmc. Granted you wouldn't set them off that close together, but what happens if a clean operation takes 1-2 hours and another kicks off?

I've thought about how to get around this and the best I can think of is to only allow the clean database function to execute minimum once every 24 hours. Another option you have is add a setting to the advancedsettings file that does a clean immediately following an update. http://wiki.xbmc.org/index.php?title=AdvancedSettings.xml#.3Cvideolibrary.3E

I guess that was just a really long way of saying that I've been working on it. Having a variable to check like there is with scanning to tell if it is running or not would be a big help.


RE: XBMC Library Updater Addon - Lathlas - 2012-03-27

(2012-03-26, 23:16)robweber Wrote:
  • 1 minute delay of scan if scan should have run during media playback. This should prevent the problem that sometimes happens when XBMC is done playing media and a scan starts instantly. Starting a new media file resets the 1 minute timer again. (thanks @Lathlas for the idea).

Awesome, thank you!