Kodi Community Forum

Full Version: Library Auto Updater - Version 1.1.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
If an update has already started the addon won't do anything to try and cancel it. To be honest I'm not even sure there is a programatic way to cancel it as the update process spawns a new thread. If I remember right you can do it from the context menu in the video/music library but that might be it.

You may just have to wait it out until the update completes. One suggestion would be to use the custom video path option in this addon to scan frequently updated paths more often, and then do full library updates late at night or something when the media center isn't in use. This would probably cut down on how long you're waiting for a scan to complete. Sorry, not what you want to hear at all I'm sure but that's about as good as I can give you.
This addon is great since I only suspend/hibernate my machines but I've run into an issue that I think is the result of this plugin.

I have 2 machines running xbmcbuntu with media sources stored on a NAS and using mysql on the same NAS. I have two profiles, the master profile "adults" has a pin, the second profile "kids" does not. The sources on the second profile are locked.

If I use the XBMC settings "update library on startup" for the Kids profile when I login it will update the library without issue. After I installed and enabled this plugin however, I am required to enter the master pin to just login to the Kids profile - I believe that the way this plugin is triggering the update, or checking the service to see if an update is necessary is requiring the PIN when it should not.
I seem to have an issue with the clean not working? I dont use it to update anything i just have clean enabled, the log shows this

03:35:00 T:1112 NOTICE: service.libraryautoupdate: Starting network check
03:35:00 T:1112 NOTICE: service.libraryautoupdate: Clean Video Library
03:35:00 T:1112 NOTICE: service.libraryautoupdate: Path smb://ADMIN/G/HDTV/ does not exist

Thats all, and my deleted videos are still present (they were not on that drive either which I will need to remove from xbmc as i have renamed that folder)

Is it possible as soon as it checks one folder/drive that does not exist it just stops cleaning?
Appears once I removed the renamed folder it cleans properly again, is their anyway around this? How come it quits if it comes across a folder that no longer exists? Could it just skip that folder and continue cleaning the others?
(2013-03-09, 05:58)SophT Wrote: [ -> ]This addon is great since I only suspend/hibernate my machines but I've run into an issue that I think is the result of this plugin.

I have 2 machines running xbmcbuntu with media sources stored on a NAS and using mysql on the same NAS. I have two profiles, the master profile "adults" has a pin, the second profile "kids" does not. The sources on the second profile are locked.

If I use the XBMC settings "update library on startup" for the Kids profile when I login it will update the library without issue. After I installed and enabled this plugin however, I am required to enter the master pin to just login to the Kids profile - I believe that the way this plugin is triggering the update, or checking the service to see if an update is necessary is requiring the PIN when it should not.

I think I understand what is going on here, but just to recap:

1) You have two profiles - adult and kids
2) The sources on the second profile are locked (I'm guessing you are using "shares with default read only" in the profile settings?)

If this is the case then what is happening, although undesirable, makes sense. To be specific the addon isn't doing anything special, it's just calling the UpdateLibrary() built in function on a timer. The difference is how the service is being run in the xbmc user space. When using the "run on startup" functionality that is built into xbmc the startup function is "global" - it runs when xbmc launches and is not attached to a user. This addon runs in the "user" space. Because of how the sources on your profiles are configured xbmc can't update data on them without a pin. Try just going to your video library when logged in as either user and do an "update library" command - do you still need to enter the pin? I'm guessing for the kids profile at least you'll need to, probably for both of them since the source is probably locked under each.

To summarize - it has nothing to do with the addon, but the program space that xbmc runs it under. It's really just abiding by the rules you setup - the sources are locked and can't be modified without the pin.

(2013-03-09, 12:34)Ghostdivision Wrote: [ -> ]I seem to have an issue with the clean not working? I dont use it to update anything i just have clean enabled, the log shows this

03:35:00 T:1112 NOTICE: service.libraryautoupdate: Starting network check
03:35:00 T:1112 NOTICE: service.libraryautoupdate: Clean Video Library
03:35:00 T:1112 NOTICE: service.libraryautoupdate: Path smb://ADMIN/G/HDTV/ does not exist

Thats all, and my deleted videos are still present (they were not on that drive either which I will need to remove from xbmc as i have renamed that folder)

Is it possible as soon as it checks one folder/drive that does not exist it just stops cleaning?

What you are seeing is expected behavior. In your other post you say that once you removed the folder the clean worked correct? I'm guessing this folder was setup a a source? When you have the "verify paths before clean" option turned on the addon will not even call the Clean() function unless all xbmc sources are available first. If you delete a file or folder within a source that is fine, but if you remove the source itself then the verify paths function will fail unless you take it out of XBMC. That is the "danger" of the verify paths function. Normally xbmc would be happy to clean your files for you - and if your source is offline delete all your media. By forcing the addon to make sure all sources exists it buts the burden on you to make sure your source tree is correct before running a clean. If you don't like this behavior you can turn of the verify feature in the addon settings - just keep in mind if you media ever goes offline accidentally you're going to lose your whole library!
Okay, I'm having an issue with the Auto Library Updater not updating after a missed update.

I'm using the latest Frodo build on Windows 7, and have configured the updater to update every 12 hours. When I'm not using the system it goes to sleep with XBMC running (note that waking for events is disabled in Windows), and since the updates have so far always been scheduled to happen when it's asleep, I expect that when I wake it up it will run right away. At least, the description for the add-in says that's what's supposed to happen.

But what happens is, when I wake the system up I right away see a little pop-up in the bottom right that says update will happen in X hours. However, it's said the exact same thing for the last 3 days, and never once has an update occured. So, it doesn't seem to be realizing that the last two+ scheduled updates never happened.

Note that I can run a manual scan just fine, and I also have XBMC configured to update the library when XBMC starts, and this is working perfectly. But I was hoping to have it update the first time I wake it up from sleep for that day, without doing it manually or having to restart XBMC all the time.
So I ran into an issue, but I'm unable to find a fix.

I created a new video DB (long unrelated story) and re-added my movie and tv show sources. When I run the update, it does not clean the library, saying the source does not exist.

My sources.xml - (edited passwords, usernames, of course.) There are no pictures or music added at this point, as I'm still rebuilding.
Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Videos</name>
            <path pathversion="1">/storage/videos/</path>
        </source>
        <source>
            <name>tvshows</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/tvshows/</path>
        </source>
        <source>
            <name>Movies - Rips</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/movies/rips/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">/storage/music/</path>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
        <source>
            <name>Pictures</name>
            <path pathversion="1">/storage/pictures/</path>
        </source>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>tvshows</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/tvshows/</path>
        </source>
    </files>
</sources>
(2013-03-10, 06:27)robweber Wrote: [ -> ]I think I understand what is going on here, but just to recap:

1) You have two profiles - adult and kids
2) The sources on the second profile are locked (I'm guessing you are using "shares with default read only" in the profile settings?)

...

To summarize - it has nothing to do with the addon, but the program space that xbmc runs it under. It's really just abiding by the rules you setup - the sources are locked and can't be modified without the pin.

I kind of assumed as much, I can change the sources to not be locked in the interim of finding another solution.

Thanks again!
robweber,

just want to say thank you. this is exactly what i need.

i have it set to update every day. but the problem is, most of my stuff gets updated/downloaded at midnight. and i think its being ran at some other time other than that. how would i set it to select WHAT time it updates?
(2013-03-10, 08:21)Sunflux Wrote: [ -> ]Okay, I'm having an issue with the Auto Library Updater not updating after a missed update.

I'm using the latest Frodo build on Windows 7, and have configured the updater to update every 12 hours. When I'm not using the system it goes to sleep with XBMC running (note that waking for events is disabled in Windows), and since the updates have so far always been scheduled to happen when it's asleep, I expect that when I wake it up it will run right away. At least, the description for the add-in says that's what's supposed to happen.

But what happens is, when I wake the system up I right away see a little pop-up in the bottom right that says update will happen in X hours. However, it's said the exact same thing for the last 3 days, and never once has an update occured. So, it doesn't seem to be realizing that the last two+ scheduled updates never happened.

Note that I can run a manual scan just fine, and I also have XBMC configured to update the library when XBMC starts, and this is working perfectly. But I was hoping to have it update the first time I wake it up from sleep for that day, without doing it manually or having to restart XBMC all the time.

Please try disabling the "run on startup" portion of xbmc and see if this helps. I couldn't find the exact post but there is a discussion somewhere that explains that xbmc treats resuming from sleep the same as a "startup" call and runs library updates during that time. Because of how the addon functions, it gets all "library updated" callbacks from the system an interprets this as the system updating the library (because that is what happened), as a result it adjusts it's next run time. Bottom line - don't use the run on startup feature if you are also running this addon. If this still isn't working for you I'll need a debug log of what is happening when you wake up from a sleep.

(2013-03-10, 15:35)sufreak Wrote: [ -> ]So I ran into an issue, but I'm unable to find a fix.

I created a new video DB (long unrelated story) and re-added my movie and tv show sources. When I run the update, it does not clean the library, saying the source does not exist.

What source specifically can't it find? You could also just try disabling the verify paths option. There is the off chance that if the verify paths can't find it that the clean operation will remove stuff, but if you think it's a false message you could try it.

(2013-03-12, 20:11)gman3042 Wrote: [ -> ]robweber,

just want to say thank you. this is exactly what i need.

i have it set to update every day. but the problem is, most of my stuff gets updated/downloaded at midnight. and i think its being ran at some other time other than that. how would i set it to select WHAT time it updates?

Where you are setting the addon to update every day? Do you mean every 24 hours? In the library settings (music/video) your only options are either a cron timer, or an hourly increment. 24 hours is literally every day at midnight, 12 hours at 0 and 12, and so on. You probably want at least every 6 so you'll get 0,6,12, and 18 or a custom timer along the lines of "0 0-2 * * *" to run at midnight, 1am and 2am if you only want it to run in the late evening.

The only spot where you specific once per day is under clean library - please make sure you are configuring the right settings.
(2013-03-12, 20:43)robweber Wrote: [ -> ]
(2013-03-10, 08:21)Sunflux Wrote: [ -> ]Okay, I'm having an issue with the Auto Library Updater not updating after a missed update.

I'm using the latest Frodo build on Windows 7, and have configured the updater to update every 12 hours. When I'm not using the system it goes to sleep with XBMC running (note that waking for events is disabled in Windows), and since the updates have so far always been scheduled to happen when it's asleep, I expect that when I wake it up it will run right away. At least, the description for the add-in says that's what's supposed to happen.

But what happens is, when I wake the system up I right away see a little pop-up in the bottom right that says update will happen in X hours. However, it's said the exact same thing for the last 3 days, and never once has an update occured. So, it doesn't seem to be realizing that the last two+ scheduled updates never happened.

Note that I can run a manual scan just fine, and I also have XBMC configured to update the library when XBMC starts, and this is working perfectly. But I was hoping to have it update the first time I wake it up from sleep for that day, without doing it manually or having to restart XBMC all the time.

Please try disabling the "run on startup" portion of xbmc and see if this helps. I couldn't find the exact post but there is a discussion somewhere that explains that xbmc treats resuming from sleep the same as a "startup" call and runs library updates during that time. Because of how the addon functions, it gets all "library updated" callbacks from the system an interprets this as the system updating the library (because that is what happened), as a result it adjusts it's next run time. Bottom line - don't use the run on startup feature if you are also running this addon. If this still isn't working for you I'll need a debug log of what is happening when you wake up from a sleep.

Thanks, this may have indeed worked. I disabled the built-in update and changed the plug-in update period to 1 hour for testing. When I resumed from sleep, instead of seeing the pop-up notice right away it just sat there for 20 seconds or so, then the scanning progress bar popped up in the top center, and when that was done the status message appeared in the bottom right telling me how long to the next scan.

So, if this continues working, I think I'm good to go!
(2013-03-12, 20:43)robweber Wrote: [ -> ]
(2013-03-10, 15:35)sufreak Wrote: [ -> ]So I ran into an issue, but I'm unable to find a fix.

I created a new video DB (long unrelated story) and re-added my movie and tv show sources. When I run the update, it does not clean the library, saying the source does not exist.

What source specifically can't it find? You could also just try disabling the verify paths option. There is the off chance that if the verify paths can't find it that the clean operation will remove stuff, but if you think it's a false message you could try it.

I think its both, but fails on one source, and the other never runs. Please let me know what info you need.
Here is my xbmc.log
Code:
06:28:39 T:139838049171200  NOTICE: -->Python Interpreter Initialized<--
06:28:39 T:139838049171200  NOTICE: service.libraryautoupdate: update timers
06:28:42 T:139838049171200  NOTICE: service.libraryautoupdate: Update Library Manual Run...
06:28:42 T:139838049171200  NOTICE: service.libraryautoupdate: update timers
06:28:42 T:139838049171200  NOTICE: service.libraryautoupdate: Update Video Library
06:28:42 T:139838657373952  NOTICE: Thread CVideoInfoScanner start, auto delete: false
06:28:42 T:139838657373952  NOTICE: VideoInfoScanner: Starting scan ..
06:28:50 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/Degrassi'
                                            unix_err:'2' error : 'No such file or directory'
06:28:50 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/Degrassi/
06:28:52 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/Green%20Lantern%20The%20Animated%20Series'
                                            unix_err:'2' error : 'No such file or directory'
06:28:52 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/Green Lantern The Animated Series/
06:28:53 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/Once%20Upon%20a%20Time%20%282011%29'
                                            unix_err:'2' error : 'No such file or directory'
06:28:53 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/Once Upon a Time (2011)/
06:28:53 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/Talking%20Dead'
                                            unix_err:'2' error : 'No such file or directory'
06:28:53 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/Talking Dead/
06:28:53 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/The%20Cleveland%20Show'
                                            unix_err:'2' error : 'No such file or directory'
06:28:53 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/The Cleveland Show/
06:28:54 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/The%20Walking%20Dead'
                                            unix_err:'2' error : 'No such file or directory'
06:28:54 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/The Walking Dead/
06:28:55 T:139838657373952   ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://htpc:htpc@mediapc/tvshows/Young%20Justice'
                                            unix_err:'2' error : 'No such file or directory'
06:28:55 T:139838657373952   ERROR: GetDirectory - Error getting smb://htpc:htpc@mediapc/tvshows/Young Justice/
06:28:55 T:139838657373952  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:12
06:28:59 T:139838049171200  NOTICE: service.libraryautoupdate: Path smb://mediapc/movies/rips/ does not exist
06:29:06 T:139838049171200  NOTICE: Thread Jobworker start, auto delete: true
06:30:40 T:139839038023488  NOTICE: Previous line repeats 2 times.
06:30:40 T:139839038023488  NOTICE: Samba is idle. Closing the remaining connections

The error from the log:
Quote:06:28:59 T:139838049171200 NOTICE: service.libraryautoupdate: Path smb://mediapc/movies/rips/ does not exist

My sources: (I addded the 2 paths as file sources to see if it would help. It did not)
Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Videos</name>
            <path pathversion="1">/storage/videos/</path>
        </source>
        <source>
            <name>Movies - Rips</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/movies/rips/</path>
        </source>
        <source>
            <name>tvshows</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/tvshows/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">/storage/music/</path>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
        <source>
            <name>Pictures</name>
            <path pathversion="1">/storage/pictures/</path>
        </source>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>tvshows</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/tvshows/</path>
        </source>
        <source>
            <name>Movies - Rips</name>
            <path pathversion="1">smb://htpc:htpc@mediapc/movies/rips/</path>
        </source>
    </files>
</sources>

My mediasources.xml
Code:
<mediasources>
    <network>
        <location id="0">smb://htpc:htpc@mediapc/tvshows</location>
        <location id="1">smb://htpc:htpc@mediapc/movies/rips</location>
    </network>
</mediasources>

Thanks for this script. It seems to be working ok on my other device, but I only have a singular source there, not both.
I'm slightly concerned about all the "ERROR: SMBDirectory->GetDirectory: Unable to open directory" messages that are appearing while the video scanner is running. These are being generated by the xbmc library scanner.

Do these directories exist? If they do and xbmc can't see them during a scan, I'm pretty sure the file exists check before cleaning will fail. On this PC are you sure DNS is setup correctly if you are using the mediapc name as the file path? Have you tried using an IP address instead? Lastly, does your share require the username:password? I'll have to do some checking but I'm wondering if the JSON call to getSources doesn't return that information. I don't see it in the log (unless you've stripped it out) and the log file should output the share string exactly as it was given.
(2013-03-14, 16:09)robweber Wrote: [ -> ]I'm slightly concerned about all the "ERROR: SMBDirectory->GetDirectory: Unable to open directory" messages that are appearing while the video scanner is running. These are being generated by the xbmc library scanner.

Do these directories exist? If they do and xbmc can't see them during a scan, I'm pretty sure the file exists check before cleaning will fail. On this PC are you sure DNS is setup correctly if you are using the mediapc name as the file path? Have you tried using an IP address instead? Lastly, does your share require the username:password? I'll have to do some checking but I'm wondering if the JSON call to getSources doesn't return that information. I don't see it in the log (unless you've stripped it out) and the log file should output the share string exactly as it was given.

Those paths no longer exist. They were deleted. (I'm a watch and delete type, so I delete the whole folder). I can switch over to an IP address, but mediapc is in the file path. The files play with no problem, but I am unable to ping them. On my RaspPi OpenElec setup, the script works fine.

Should I update the host file with the proper IP addresses?
I would try updating the host file. If you're really sure that the sources are online just uncheck the verify sources box and see what happens - just make a backup of your library first. I've seen in rare cases where the xbmcvfs module exists() function returns false even if the source is online, but it doesn't happen very often.
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