n00b question: Auto Update Library
#1
I am running XBMC on a Win7 box. I have a couple drive shares, which I copy new TV Shows/Movies into from my primary computer.

I'd love to have a way, either script or a keystroke, which I could force a library update on the video/audio library.

I've never used scripts here before, so I'm new to that. I did read through the wikis and such, but I'm not exactly sure where to find and search for a script. The link in the wiki goes to an empty page.
Reply
#2
Please search for UpdateLibrary + httapi. There're quite some threads about it.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Hello,
You could use Eventghost and map library update to a key that you do not use. Or you could setup Eventghost to do a directory watch for new files on whatever directory you are adding files to, then EG can also issue the command to update library without any interaction from you. This is what I do as part of my automated NZB downloads.

You can take a look at this thread to get some ideas:

http://forum.xbmc.org/showthread.php?tid...=Belvedere

If you need any help, let us know.

Mark
Reply
#4
Excellent, thank you. I am completely new to the xbmc/linux front.
Right now, I'm running XBMC on Win7.

Can I set up an SSH/Telnet session into XBMC, or do I have to be running an XBMC/Linux install to do that?

I was thinking of using my media script from my other computer to send a ssh command to kick off a library update. (once I figured out how)
Reply
#5
The forum has a search you only have to use the keywords given above to find stuff Shocked

If you want to update the library from your remote you can map a key with the command UpdateLibrary(video) or UpdateLibrary(music)

If you want to auto update both create the following two files and put them in /XBMC/scripts it will update every 45 minutes you can change this just edit the 45 lol

autoexec.py

Code:
import xbmc, xbmcgui

xbmc.executebuiltin('XBMC.AlarmClock( VideoLibraryUpdater, XBMC.RunScript(special://home/scripts/VideoLibraryUpdater.py),45,true)')

VideoLibraryUpdater.py

Code:
import xbmc, xbmcgui
xbmc.executebuiltin('XBMC.UpdateLibrary(video)')
xbmc.executebuiltin('XBMC.UpdateLibrary(music)')
xbmc.executebuiltin('XBMC.AlarmClock( VideoLibraryUpdater, XBMC.RunScript(special://home/scripts/VideoLibraryUpdater.py),45,true)')

The above is for 9.11 if you want to use them in the latest Dharma builds do exactly the same but change the path in both files from

special://home/scripts

to

special://xbmc/scripts

Theres an addon version on here as well which I'll let you search for
Reply
#6
Thank you. I actually did see the post that mentioned that, but it was a big vague. I'm not that familiar with everything, so I'm still learning and reading.
Reply
#7
I tried creating a keyboard.xml file in C:\Users\<username>\AppData\Roaming\XBMC\userdata\keymaps\

Quote:<keyboard>
<k>UpdateLibrary(video)</k>
</keyboard>

Didn't work.
Reply
#8
sufreak Wrote:I tried creating a keyboard.xml file in C:\Users\<username>\AppData\Roaming\XBMC\userdata\keymaps\

Didn't work.

If that's the full contents of the file, rather than just an excert, then your keyboard.xml is incomplete. The file should be:

Code:
<keymap>
  <global>
    <keyboard>
      <k>UpdateLibrary(video)</k>
    </keyboard>
  </global>
</keymap>

If you look in C:\Users\<username>\AppData\Roaming\XBMC you should find the file xbmc.log. Open this in Notepad and scan through to see if it reports errors reading your keyboard.xml.

JR
Reply
#9
Just updated it, but have to go to work, so I'll test it when I get back.
Reply
#10
Taking a different perspective all together, are you sure you want/need this functionality? You can set XBMC to automatically scan the Video and Music libraries for new content whenever XBMC starts (or wakes).

Look for an option called 'Update library on startup' in the GUI if you don't want to tinker with scripts and don't need a dedicated keyboard shortcut. Personally, I set my XBMC to update the library whenever it's started up, so it can find anything I've recently added to my NAS share. Works a treat.
Reply
#11
My system is always on. Its based on Win7 at the moment, but if I move it to a Live install, (installed on the drive), I'll start looking at the sleep options.
Reply

Logout Mark Read Team Forum Stats Members Help
n00b question: Auto Update Library0