View Full Version : Scheduled Library Updates (GUI settings to schedule regular new content scans)?
agathorn
2008-03-02, 03:48
My parents are ALWAYS forgetting to update their video library, which is bad because I have an automated system of RSS feeds and torrents which deposits new shows for them daily.
My Mom made a suggestion to me that makes perfect sense -- a setting you can turn on so that every night at a specified time, XBMC would update the library.
Yes I know you can set it to do this when its first turned on, but they don't usually turn it off. So that requires thought..Right back to them forgetting to do it :p
A setting would be a set it and forget it thing that would just take care of itself.
I have a couple ideas rolling around in the emptyness of my head whereby I think I can make this work, sort of, in the skin XML, but this is a feature I think would be good to have.
Nick8888
2008-03-02, 03:59
Unless they leave it on 24/7 there is a setting to update on startup which you might find usefull.
there is also this feature request http://sourceforge.net/tracker/index.php?func=detail&aid=1880286&group_id=87054&atid=581841
You might also find these built in features useful
XBMC.updatelibrary(database) Takes either "video" or "music" as a parameter to begin updating the corresponding database.
XBMC.AlarmClock(name,command,time) Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the built-in command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice.
But I agree, ability to set it at a specific time may be useful.
EvilDude
2008-03-02, 04:13
If the xbox is on 24/7, why not write a script that is started using autoexec.py. You could either go the alarm way, or just make it update every x seconds, using the time.sleep function.
could basically be:
while 1:
XBMC.updateLibrary("video")
time.sleep(21600)
That would update the script every 6 hours (60*60*6)
agathorn
2008-03-02, 13:15
Unless they leave it on 24/7 there is a setting to update on startup which you might find usefull.
there is also this feature request http://sourceforge.net/tracker/index.php?func=detail&aid=1880286&group_id=87054&atid=581841
You might also find these built in features useful
XBMC.updatelibrary(database) Takes either "video" or "music" as a parameter to begin updating the corresponding database.
XBMC.AlarmClock(name,command,time) Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it'll execute the built-in command (the parameter command) if it is specified, otherwise it'll pop up an alarm notice.
But I agree, ability to set it at a specific time may be useful.
As I said it IS kept on most of the time, so the update on startup isn't useful. I'm aware of those functions, which is why I said I am pretty sure I can hack somethign together to do the job.
My point stands though that hacks aside, this is a feature that really should be there for the average user.
agathorn
2008-03-02, 13:54
If the xbox is on 24/7, why not write a script that is started using autoexec.py. You could either go the alarm way, or just make it update every x seconds, using the time.sleep function.
could basically be:
while 1:
XBMC.updateLibrary("video")
time.sleep(21600)
That would update the script every 6 hours (60*60*6)
I didn't know about the autoexec.py, that's definitely useful.
I still stand by the feature request though for the average user :)
Unless you manage to track down the person that did the on boot update patch and convince him to code this, I wouldn't hold my breath.
Any idea how this would be implemented on linux? I haven't found the python lib to import.
import xbmc unless my memory is all wrong. the py obviously has to run in our interpreter.
if you want to run it outside xbmc, you need to rely on the http server, in which case its just a matter of using urllib
this shouldnt be difficult to implement. xbmc knows the current time via ntp. and is really nothing more than a huge loop so an interval based timer is already possible. (some functions already take advantage of this such as the screensaver.)
the simple radio button "update database on startup" could be replaced with an "update database automatically" option which is a list that contains "never", "on startup", "at a specified time", and "at a fixed time interval". then some additional settings fields are visible if either "at a specified time", or "at a fixed interval" are selected so that they can be set.
Please Trac (http://xbmc.org/trac/) a feature request.
This is something that might be implemented for the next release.
The_Dogg
2008-09-19, 16:13
I think this is a good idea, I was planning on using the update library on startup but my xbox is on 24/7 so a scheduled update would be a very good addition to xbmc.
Rand Al Thor
2008-09-19, 16:21
Please Trac (http://xbmc.org/trac/) a feature request.
This is something that might be implemented for the next release.
Done ;)
http://xbmc.org/trac/ticket/4919
I would definitely make use of a feature like this. Cheers.
InDashMP3
2008-09-19, 18:19
Hopefully not off topic, but could there be a script to "monitor" your sources for content changes and update in the background?
Is there a setting somewhere to enable automatic updating of the library in the background? In the video settings tab I only have Update Library on Startup, but I generally just leave my apple tv on, so startup never happens, so I have to manually update the library...
althekiller
2009-01-02, 20:16
You could write a python script that sleeps for 24hrs or w/e then runs update again. The background scanner needs some work before it can be enabled again, otherwise you'll be rebooting far more often ;)
rwparris2
2009-01-02, 21:04
You could write a python script that sleeps for 24hrs or w/e then runs update again. The background scanner needs some work before it can be enabled again, otherwise you'll be rebooting far more often ;)
I already wrote one, check my sig. It will do at specific time periods (say every 12 hrs) or at a specific time (I leave mine set to 1 hr before I get off of work, so when I get home my Library is nice and up-to-date without me having to do anything). You can specify music, videos, or both.
The reason I haven't added it to the addons svn is I haven't tested it on anything other than windows and you have change all the settings by editing the default.py file, and it uses a loop that might cause xbmc to hang on shutdown...
nmrs2 if you try it let me know how it works out for you... I'm especially interested if you can gracefully exit xbmc with the script running.
nekrosoft13
2009-01-06, 14:42
Would it be possible to add a feature into library view that would auto update the library when changes are found?
for example WMP11 library, at certain time it goes out and does a quick look at the folders to see if anything have been added, is something like that possible in XBMC?
http://xbmc.org/forum/showthread.php?t=43026
nekrosoft13
2009-01-06, 15:48
thanks sho, never visit apple forums would have never see it ;)
That's the reason we search ;)
Can I just add a 'me too' to this feature request?
I've recently tried Media Browser (http://www.mediabrowser.tv/) for Vista Media Center. It has its own set of issues but one thing I really liked was that scraping shows was done completely automatically. As soon as you browsed to a file which it hadn't scraped it would attempt to scrape it. Until it was successfully scraped it just showed the filename.
Like the original poster, I download shows for my wife and she can never find them because she either forgets or can't be bothered (it takes 5 mins) to do an update.
Does the code have the ability to scrape a single filename?
in current svn you have the ability to include / exclude paths from update.
http://xbmc.org/trac/changeset/16862
did you check out the script referenced on the last page of this thread?
Fabninja
2009-01-12, 02:38
I can't seem to find an answer to this anywhere. Is it possible for XBMC to automatically add new episodes while it is running? I am trying to switch from MediaPortal to XBMC permanently, but this is one of the few issues I can't live without. I use uTorrent to automatically grab my shows when they are released, and MediaPortal will detect them when they are finished downloading. I can't find in the options anywhere how to turn on that feature in XBMC. I know that it will auto-update on startup, but I don't want to have to startup/shutdown just to get my new shows.
You can get it to update at start up (Settings > Video > Library) or just bring up the Context Menu and select 'Update Library'.
SlaveUnit
2009-01-12, 17:58
If you want auto update while its running...then no its not possible. You have the tell it manually to scan and find the new shows.
rwparris2
2009-01-12, 18:10
I wrote a script that can do this on a set schedule (it won't auto do it when downloads finish, though). You have manually edit the settings in the default.py file. Look in my signature for a link.
also to mention the obvious; you know there's an update library builtin command? if utorrent can run a script on finish just submit that via http api
rwparris2
2009-01-12, 18:38
also to mention the obvious; you know there's an update library builtin command? if utorrent can run a script on finish just submit that via http api
It isn't practical because you have to add it per torrent (at least last time I looked).
Fabninja
2009-01-13, 08:16
Thanks for the replies. I guess I'm just used to MediaPortal doing it automatically. Now that I know there is an update function in the context menu it's not such a big issue.
Here is the feature request:
http://xbmc.org/trac/ticket/4919
I was wondering... I also want to update the library automatically every hour our so... My computer is on 24/7, but I use Windows Media Center to record and watch tv as well...
The problem is that Windows Media center doesnt work very well if XBMC is on all the time coz XBMC takes a lot of CPU power just when in idle, not mentioning the XBMC cant be minimized, so theres some GL problems when booth run at the same time...
The best solution would be just running python scripts outside XBMC UI, so one could just use windows schedule to trigger the execution of a python script that uses xbmc module and updates the library...
But I read here that you cant use xbmc module outside XBMC environment... which is a pity... So, I was wondering... is there any way to run XBMC in "command line mode" so I could run a python script that uses the xbmc module? what I mean with command line mode is launch XBMC without the UI, with just the python environment so we can run scripts offline... something like, instead of run a python script with the usual command line like:
python "updateLibrary.py"
which I know doesnt work, instead we could do:
xbmc -python "updateLibrary.py"
and XBMC would load the whole python environment only, run the script and quit...
I think this would open a whole other world of possibilities beside update the library...
off course we would have to deal with 2 XBMC running at the same time, if one is running a script in command line mode and the user starts XBMC UI... that could be a problem... but then we can find ways to deal with it...
how hard would it be to implement such a feature? what you guy think about it?
by the way... awesome work... I just love the library!!!! I just wish that XBMC could handle live tv/record tv as well and I would just abandon Vista MCE... :P
-H
coz XBMC takes a lot of CPU power just when in idle,Have you tried playing with Vsynch in settings? (ie enable it only for playback).
MPauley73
2009-01-18, 05:24
2 problems:
Crashes at the update time.
Text on screen saying alarm has been started.
application.cpp
if (g_guiSettings.GetBool("videolibrary.intervalupdate"))
{
g_alarmClock.start("udpateintervalvideo", 60, "xbmc.intervalupdate('video')");
}
guisettings.cpp
AddBool(9, "videolibrary.intervalupdate", 22021, false);
util.cpp:
else if (execute.Equals("intervalupdate"))
{
if (parameter.Equals("video"))
{
CLog::Log(LOGNOTICE, "Updating video library at interval");
CGUIDialogVideoScan *scanner = (CGUIDialogVideoScan *)m_gWindowManager.GetWindow(WINDOW_DIALOG_VIDEO_S CAN);
SScraperInfo info;
VIDEO::SScanSettings settings;
if (scanner)
{
if (scanner->IsScanning())
scanner->StopScanning();
else
CGUIWindowVideoBase::OnScan("",info,settings);
}
if( g_alarmClock.isRunning() )
g_alarmClock.stop("udpateintervalvideo");
g_alarmClock.start("udpateintervalvideo",60, "xbmc.intervalupdate('video')");
}
}
For example, let's say I just copied a bunch of new movies over to my HTPC.
How do I get XBMC to automatically update it's video library with my new movies?
I know of the option "Update library on startup" but I keep XBMC running 24/7 so I'm wondering if another (automatic) way exists...
Moved and last poster, please look for the python script in this thread.
Hey there is an amazing free app called DIRMON that does monitor any folders you want and will execute commands or programs based on changes in a specified folder like a new download finishing. It can then either do the http command to xbmc or I have it first run the command line of tvrename and then run an autoit script to have media companion update library data and then send the xbmc update library command.
DIRMON
http://www.dragonglobal.biz/dirmon.html
Autoit script
http://www.mediafire.com/?zjywnx0izgn
tvrename
http://tvrename.com/
If you use EventGhost to relay the IR commands from your remote to XBMC you can configure a timer that issues the update command to XBMC. That's how I have it mine.
BUT, I do agree that this feature should be built in for the average user.
supernoman
2009-06-30, 21:28
Is this possible? I know there is a setting to scan new content at startup but sometimes I add quite a bit of content before restarts and conversely, I don't always want it to scan new content at every start.
Thanks.
there's a python script around for scheduling.
or just write an external tool and submit using the event server and/or the http api.
rwparris2
2009-06-30, 22:15
http://code.google.com/p/rwparris2-xbmc-plugins/downloads/detail?name=TimedLibraryUpdater.rar&can=2&q=
I have not used this in a while... please tell me if it is not working. You may need to modify the .py file, so don't forget to read the readme.
natethomas
2009-06-30, 22:54
http://xbmc.org/forum/showthread.php?t=31645
Here is the current discussion on the topic.
if your running on a linux machine its easy enough to setup a cron job to do this.
supernoman
2009-07-01, 01:52
Thanks for the suggestions. I'll give the python script a try.
BTW, I'm looking for a solution in XBMC for Windows.
automated
2009-07-01, 07:33
If you use EventGhost to relay the IR commands from your remote to XBMC you can configure a timer that issues the update command to XBMC. That's how I have it mine.
BUT, I do agree that this feature should be built in for the average user.
That sounds awesome, can you show us how you do that?
No need for python
Enable the web interface on xbmc and then add a cron job with this command:
0 * * * * curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)" > /dev/null
This will update the library every minute.
I believe Event Ghost will have support for XBMC by default. So just install that on your HTPC that has XBMC running.
The screen is split in two. On the left is a log showing all the events/actions as they come in and on the right is the configuration. Understanding the logs and configuration is important because while at first it's a little weird, you'll eventually understand it. Basically configuring Event Ghost is all about connecting events to actions. The events are shown in the log with lightning bolt icons. So if you cause an event to be triggered via remote you can then connect it to an action by dragging it from the log to an action in the configuration side.
Follow these instructions, exclude the quotes from the values.
In the configuration pane on the right, just right click on System (it's towards the bottom) and select Add Plugin.
It will then ask you to select the plugin to add. Scroll to the bottom, under Other and select Timer
Name it "Library Update"
Set Loops to "1" and Interval to "1" second.
Set Start to "at given time (HH:MM:SS)"
Set the time you want it to run (04:00:00 for 4am)
Set Event name to "Lib.Update"
Now click the Test button so that the event is triggered and shows up in the log
Click the OK button to save and close the dialog window.
Now drag the event that you see in the log (has clock icon and is labeled Timer: Start timer "Library Update")over to the right configuration pane under XBMC\Update Video Library
That's it.
With Event Ghost you can also bind a button from the remote to trigger the library update. To do that, you'd press the button on the remote that you want to use, then in the Event Ghost log you'll see the event for that button (will show at bottom of log with a lightning bolt icon). When you see it, just drag it to the configuration pane and drop it under XBMC\Update Video Library. I use a Logitech Harmony One, so I have a touch screen button on the remote linked to the video update.
Do a search here and you'll find lots of info on how Event Ghost is being used.
http://xbmc.org/forum/showthread.php?t=38579&highlight=EventGhost
I just want to make it clear, that these are just alternatives to getting updates automated. I still strongly believe that automated library scans should be part of the core functionality of XBMC. Just look at Boxee, if anything that is one feature I like where it just goes off and updates the library automatically. I'd still like some configuration options though so I can decide how it should happen (on an interval, specific time, etc...)