XBMC Library Updater Addon

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
robweber Offline
Fan
Posts: 598
Joined: Sep 2009
Reputation: 15
Post: #71
(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.
find quote
robweber Offline
Fan
Posts: 598
Joined: Sep 2009
Reputation: 15
Post: #72
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....update.zip
find quote
Radikaltimes Offline
Senior Member
Posts: 166
Joined: Mar 2009
Reputation: 0
Post: #73
is there a way to add clean library to the process?

[Image: watched-fanart.jpg]
find quote
robweber Offline
Fan
Posts: 598
Joined: Sep 2009
Reputation: 15
Post: #74
(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=Adv...library.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.
find quote
Lathlas Offline
Junior Member
Posts: 13
Joined: Jun 2008
Reputation: 0
Post: #75
(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!
find quote
Radikaltimes Offline
Senior Member
Posts: 166
Joined: Mar 2009
Reputation: 0
Post: #76
(2012-03-27 02:26)robweber Wrote:  
(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=Adv...library.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.

perfect .. Smile

[Image: watched-fanart.jpg]
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #77
Hi,

I have a problem where sometimes my network shares don't come up and so on an update library (i have it set to autoclean on update for various reasons) i lose my db.

Would it be possible to add an option to settings to check for the existance of a specified path before doing the scan?

I have it hardcoded in my local copy of the script now but the option may be useful to others.

I just use a simple

Code:
if not xbmcvfs.exists(some_path):
    #skip scan

to check before letting the update run.
find quote
rflores2323 Offline
Posting Freak
Posts: 1,950
Joined: Jan 2009
Reputation: 2
Post: #78
^ is a great idea as I have had the same problem with my setup and stopped using the addon due to this. If this could be implementedI would get this going on my system again.

ATV1 with crystalbuntu V1 (11.eden). Theater remote URC MX-810, droidx wtih xbmc remote, or transformer tf101 with YATSE. 2 x ATV2 (V12.0 Eden).

find quote
robweber Offline
Fan
Posts: 598
Joined: Sep 2009
Reputation: 15
Post: #79
(2012-03-29 23:10)paddycarey Wrote:  Hi,

I have a problem where sometimes my network shares don't come up and so on an update library (i have it set to autoclean on update for various reasons) i lose my db.

Would it be possible to add an option to settings to check for the existance of a specified path before doing the scan?

I have it hardcoded in my local copy of the script now but the option may be useful to others.

I just use a simple

Code:
if not xbmcvfs.exists(some_path):
    #skip scan

to check before letting the update run.

I understand your issue, and definitely sympathize, but I'm unsure how your fix will translate well to users in general. Imagine an instance where you have 4 or 5 different paths as part of your video sources. Issuing the UpdateLibrary() function goes through each of the content sources and scans for new content. Using a xbmcvfs check how does the addon know which of the paths to check before running the update? Should it check all of them? What if one fails but the others succeed - you'll still get an update that will most likely remove the non-existant path (via the auto clean operation)? What if the path legitmately doesn't exist? (ie it should be removed) - you'll never get another update.

I'm not tossing out this idea but it needs some thought before I can be sure it will work for everyone. Thanks for pointing this out though, I had not encountered this before with my setup.
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #80
One option might be to use the JSON api to get a list of all the configured shares (pretty sure this can be done) and then attempt to write/delete/touch/whatever a small file on each one to make sure they're up. This obviously requires having write access to the shares.

Does the JSON API give a different response when attempting to list a share if it's down as opposed to empty? If so then that would be one simple way to implement this.
find quote
Post Reply