Kodi Community Forum
Directory Watchdog - Background file monitor service to initiate auto update library? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9)
+--- Thread: Directory Watchdog - Background file monitor service to initiate auto update library? (/showthread.php?tid=66348)

Pages: 1 2 3 4 5 6 7 8


- takoi - 2010-08-28

i've made an addon for this, and it appears to be working quite nicely. linux platform that is. and no need to install anything extra.
but, basically what needs to be done first is to get the makefile working. so someone please help me out with this. see: http://forum.xbmc.org/showthread.php?tid=79596


- dandirk - 2010-08-29

I can understand the issues with including a monitor app, or issues with update every x timeframe...

What I would kill for would be just a update and clean library button in the Movies section options.

I use the library exclusively, I remove the videos section so I don't have access to the sources then context menu to scan content...

Maybe a good partial solution is just an easier way to kick off the library update, in other places other then the sources screen? Having these buttons in the library section makes sense to me... not in the video section which doesn't even use the libraryHuh?

I DID write a script and have it attached to my remote. Only problem is that when XBMC has an uptime of 90 days, this rarely works... maybe my scripts messed up... I could easily live with a easier way to manually kick off an update.


- jmarshall - 2010-08-29

What's wrong with your context menu? Update library has been there for about 5 years.


- dandirk - 2010-08-29

jmarshall Wrote:What's wrong with your context menu? Update library has been there for about 5 years.

I am retarded that's whats wrongShocked

I have had the same xbmc setup (fairly rock solid) for over and year. Guess what? Never once tried the context menu outside of the sources screen....

What do you know there is nothing wrong with the context menu outside of the sources screenRolleyes

Guess the problem (as usual) is between the remote and the couchBig Grin


Can you get XBMC to auto-scan you libraries for changes in real-time? - SpectreX - 2010-11-06

I know that there is an option to scan for new content at startup, but is there an option to set it to scan in real-time, basically when i add an item in the Movies folders on the HDD, and XBMC is running, it shows up immediately in the library. Also, the scan at startup option doesn`t remove invalid items from the library (if i delete an item from the folder for ex)


- htpc guy - 2010-11-06

I believe you need to clean the library if you remove something. Or just try to play the deleted item and XBMC will ask you if you want to delete it from the library. As far as I know there is no way to auto update XBMC. I think there is a dharma addon that refreshes the library after a set amount of time. That may be what you are looking for.


- robweber - 2010-11-08

SpectreX Wrote:I know that there is an option to scan for new content at startup, but is there an option to set it to scan in real-time, basically when i add an item in the Movies folders on the HDD, and XBMC is running, it shows up immediately in the library. Also, the scan at startup option doesn`t remove invalid items from the library (if i delete an item from the folder for ex)

There is no built in function to monitor the library in "real time" (add an item and have it just show up immediately). There are several attempts at third party solutions that use some sort of a directory monitor utility to kick of an XBMC script.

htpc guy is right about needing to clean the library. You can add an option to your advancedsettings.xml file to always clean the library on an update if this is something you don't manually want to do. You can find instructions on the wiki: http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E


- HenryFord - 2010-11-09

There are some nice libs in .NET which allow you to handle file-system changes... If something happens you could raise an HTTP-Request to the XBMC (like
Code:
http://host:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))
).

That would hardly be any work to do, i could build it on a weekend... Somebody interested? Wouldn't do it for me, but if someone asks, I would throw something together.

(Of course this would only work on windows though...)


- robweber - 2010-11-09

HenryFord Wrote:There are some nice libs in .NET which allow you to handle file-system changes... If something happens you could raise an HTTP-Request to the XBMC (like
Code:
http://host:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))
).

That would hardly be any work to do, i could build it on a weekend... Somebody interested? Wouldn't do it for me, but if someone asks, I would throw something together.

(Of course this would only work on windows though...)

If you are interested in a windows only solution you can also check out EventGhost - there is a directory watcher plugin in there as well that you could use to launch a script with the XBMC commands in it.


- HenryFord - 2010-11-10

robweber Wrote:If you are interested in a windows only solution you can also check out EventGhost - there is a directory watcher plugin in there as well that you could use to launch a script with the XBMC commands in it.
Nah, I use a linux-server to download and move my files properly, but that script is very unique...I don't think it would work on any other box...


- awikatchikaen - 2010-11-16

htpc guy Wrote:I believe you need to clean the library if you remove something. Or just try to play the deleted item and XBMC will ask you if you want to delete it from the library. As far as I know there is no way to auto update XBMC. I think there is a dharma addon that refreshes the library after a set amount of time. That may be what you are looking for.

I have the same problem than spectreX
The problem with Cleaning the library is that it's totally erase videos informations. And for some videos i have write manually the title. Doing that each time i delete a file on my server is boring.

It's surprising that a mediaCenter doesn't perform this synchronisation automatically...


- Robotica - 2010-11-16

MythTV has a good solution: Event driven notification system to trigger user-specified commands when certain events occur. Those events could be on databse level but also file system level (or time triggered).
http://svn.mythtv.org/trac/changeset/23012


- robweber - 2010-11-16

awikatchikaen Wrote:I have the same problem than spectreX
The problem with Cleaning the library is that it's totally erase videos informations. And for some videos i have write manually the title. Doing that each time i delete a file on my server is boring.

It's surprising that a mediaCenter doesn't perform this synchronisation automatically...

Here is the description of what 'cleaning the library' should do straight from the XBMC wiki (http://wiki.xbmc.org/index.php?title=Videos_Settings)

Quote:This function will perform a number of 'cleanup' tasks on your video database and can be run if you have moved, deleted or renamed files.
Removes any videos with invalid paths and all information tied to these files.
Removes all removable media (example: DVD) without checking for existance + all information tied to these files.
Tip: XBMC puts a video in its database if you change any OSD setting while watching, resume points are also stored there.

So cleaning the library should not erase any video information, unless that video is an moved, deleted, or renamed file. In which case it should be cleaned since the DB entry for it will not play the file anyway. Any existing videos you have will retain all of their info.

Also, one of the reasons I've heard for XBMC not doing this with every update automatically is because of removable media and networked files. If your network connection is down, or you unplug an external hard drive suddenly all of those files are no longer accessible. A 'clean library' command would see these as invalid files and clean them all out of the library. When setting the advanced settings property to always clean the library you have to be sure that your files are always accessible unless you delete them.


- robweber - 2010-11-16

Robotica Wrote:MythTV has a good solution: Event driven notification system to trigger user-specified commands when certain events occur. Those events could be on databse level but also file system level (or time triggered).
http://svn.mythtv.org/trac/changeset/23012

I'm just going to guess here, but I don't think this could work as part of the XBMC core if that is what you are suggesting. MythTV knows that it's file system will be on a linux distro so they can use some specific file level monitoring to see what events are happening.

As has been stated the main problem with an XBMC based "directory watchdog" is that XBMC could be on a variety of platforms and implementing a cross platform directory watcher would be very difficult.

Could someone with a little more understanding of the issue than me elaborate on if this is a potential solution or not?


- Robotica - 2010-11-19

You are right about the cross platform solution. What I ment is to handle a file-write as an event. And then think about the solution I described above.

Extra examples: finished download triggers library update, incoming call triggers pause, 07:00 in the morning triggers scrapers, etc.