Kodi Community Forum

Full Version: Scan to library without restarting?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, I'm completely new to XBMC, but I read Lifehacker's excellent article the other day and I went right out and bought a little nettop computer for the purposes of running this excellent software.

My question stems from the fact that I intend to leave the thing running basically all the time, asleep when it's not in use, and I'm wondering if there's any way to get the libraries to update without having to restart the software. I have my torrenting automated, and I'd love for new shows to appear in the library without having to restart or manually re-scan. Is there any way to do this?

Thanks,

--
Francis
there is no need to restart after you scan.

easiest way is to drop out of library mode, go to the folder that has what you want to add to the library and select 'scan for new content' then go back to library mode & as long as you're naming conventions are good, you will be fine.
Not quite what I meant. I want the folders to scan for new content without me having to trigger them manually. Either on a schedule or somehow kicked off by new content appearing in the folders. Does that make sense?

--
Francis
You can also force a library update from another program, or even another computer! For ex, my downloader runs a predefined script upon completion. Here's a bash script as an example, and though it's hardly pretty or foolproof, it works great for me:

Quote:#!/bin/sh
curl --get "http://192.168.1.121:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))"
sleep 20
curl --get "http://192.168.1.121:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(RunScript("/home/theuni/.xbmc/scripts/MyScripts/RecentlyAdded.py"))"
curl --get "http://192.168.1.121:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification("$5","$3",20000))"

That gets run after each download. In that example, 192.168.1.121 is my htpc with the webserver running.

1. it calls for a library update
2. pause while scanning
3. run the RecentlyAdded.py script, so that the recent stuff shows on the home screen
4. take arguments 3 and 5 from the downloader to popup a notification on the screen telling me it's complete.

As I said, not very scientific, but works a treat.

TheUni
Thanks for the suggestion! My problem is that I'm very much an end-user on this, and I'm not sure how to set up a script like that. I run a G4 Mac Mini as my server, which is in charge of downloading everything and filtering it into various folders by title, then XBMC running on a little Acer nettop plays it in glorious HD. How can I set the Mac Mini to tell the Acer to update the library once new content has been downloaded?

--
Francis
I found a solution that works for me. I use the OSX program Hazel to sort my downloads by show, so I set up a new rule to execute a CURL script that uses XBMC's HTTP API to refresh the library whenever a new file is added to the tree. It works well.

I'll paste the script when I get home tomorrow so others can use it if they have a similar setup.

--
Francis
Here's the script I used, it's actually very similar to the suggestions made earlier in the thread, so thank you for that.

Code:
curl "http://My.XBMC.IP.Address:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary%28video%29" > /dev/null

--
Francis