[RELEASE] Library watchdog

  Thread Rating:
  • 4 Votes - 4.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Hitcher Offline
Skilled Skinner
Posts: 11,027
Joined: Aug 2007
Reputation: 103
Location: Eastleigh, UK
Post: #16
(2012-05-09 17:29)takoi Wrote:  
(2012-05-09 17:20)Hitcher Wrote:  Can I ask how exactly it know when files are added or deleted?

Thanks.
Through system calls. inotify on linux, winapi on windows, otherwise it takes a snapshot of a folders 'modified' timestamp every second or so and compare.

So my hard drives will be constantly spinning?
find quote
Aenima99x Offline
Donor
Posts: 1,127
Joined: Aug 2007
Reputation: 8
Location: California
Post: #17
(2012-05-10 08:30)Hitcher Wrote:  
(2012-05-09 17:29)takoi Wrote:  
(2012-05-09 17:20)Hitcher Wrote:  Can I ask how exactly it know when files are added or deleted?

Thanks.
Through system calls. inotify on linux, winapi on windows, otherwise it takes a snapshot of a folders 'modified' timestamp every second or so and compare.

So my hard drives will be constantly spinning?
I can't speak for the windows part, but on ubuntu when using iotop and dstat to monitor the activity on my SSD and RAID, I don't see any activity.
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #18
(2012-05-10 16:50)Aenima99x Wrote:  
(2012-05-10 08:30)Hitcher Wrote:  
(2012-05-09 17:29)takoi Wrote:  Through system calls. inotify on linux, winapi on windows, otherwise it takes a snapshot of a folders 'modified' timestamp every second or so and compare.

So my hard drives will be constantly spinning?
I can't speak for the windows part, but on ubuntu when using iotop and dstat to monitor the activity on my SSD and RAID, I don't see any activity.

This is correct. It's event based so it won't do anything until you write something to the disk.
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #19
(2012-05-10 00:58)tinybutstrong Wrote:  Hmm got more info this time, check log bellow:

http://pastebin.com/Cwkqp8QL

Fixed. Should be in repo soon
find quote
tinybutstrong Offline
Fan
Posts: 331
Joined: Sep 2010
Reputation: 0
Post: #20
(2012-05-10 19:51)takoi Wrote:  Fixed. Should be in repo soon

Now XBMC is crashing on exit, log:

http://pastebin.com/QQsCftQc

I wish to have Rotten Tomatoes (user+critics) + IMDB both ratings display in skin.
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #21
(2012-05-10 20:23)tinybutstrong Wrote:  
(2012-05-10 19:51)takoi Wrote:  Fixed. Should be in repo soon

Now XBMC is crashing on exit, log:

http://pastebin.com/QQsCftQc

Just some deamon threads crashing, Im aware of it. But it shouldn't be a problem. Xbmc should exit cleanly.
(This post was last modified: 2012-05-10 20:56 by takoi.)
find quote
tinybutstrong Offline
Fan
Posts: 331
Joined: Sep 2010
Reputation: 0
Post: #22
Quick question, what is the difference between method syscall and polling?

I wish to have Rotten Tomatoes (user+critics) + IMDB both ratings display in skin.
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #23
(2012-05-10 21:59)tinybutstrong Wrote:  Quick question, what is the difference between method syscall and polling?

I explained the methods used above. Basically, syscall is fast and will use no resources when idle. Polling will constantly check for changes and may hog the disk quite a bit for large directories (e.g 1TB). If you have os mounted network shares you want to watch, you must use polling. Otherwise, you should use syscall. For future reference: the "only watch root directory" option will increase the performance of polling a lot, if you can live with this limitation.
find quote
consin Offline
Junior Member
Posts: 2
Joined: May 2012
Reputation: 0
Post: #24
I just discovered the script and was excited to test it.
Unfortunately XBMC crashes on exit. Any Idea?

Log: http://pastebin.com/m5N1FzVt
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #25
(2012-05-12 13:24)consin Wrote:  I just discovered the script and was excited to test it.
Unfortunately XBMC crashes on exit. Any Idea?

Log: http://pastebin.com/m5N1FzVt

Yes, unforgivable bug, i know. I've already fixed this, but Im still waiting for it to be pulled into repo. Either just disable the addon and wait a little bit longer, or download zip and install manually.
find quote
consin Offline
Junior Member
Posts: 2
Joined: May 2012
Reputation: 0
Post: #26
Thanks, the new version solves it.
Keep up the good work! Smile
find quote
argh! Offline
Fan
Posts: 354
Joined: Jun 2011
Reputation: 0
Post: #27
What a nice adn handy add-on.

Installed it, looked at my library and POOF, my two new episodes were there, and i hadn't even noticed any CPU/HDD activity, or XBMC slow-down.


FYI - Using Win7 x64, Eden, 5400rpm drives

Nice work, man. Thank you!

EDIT: okay this is odd. Upon first installing and enabling, it found some new shows, and continued to do so without notice, and all was pretty much instant. However on XBMC restart, the "scanning for New Content" bar starts all on its' own, and after stopping it manually, it just starts itself up again. Over and over until i disabole your Add-on.
(This post was last modified: 2012-05-14 19:50 by argh!.)
find quote
FantaXP7 Offline
Junior Member
Posts: 20
Joined: Mar 2009
Reputation: 0
Post: #28
Question, this might be stupid but will this see that there is a new file(s), scrape info/metadata for the file(s), or will it simply prompt and entire library refresh?

I am hoping to find a solution that will do the former rather than the latter.

Thanks
find quote
takoi Offline
Team-Kodi Member
Posts: 787
Joined: Oct 2009
Reputation: 12
Location: Norway
Post: #29
(2012-05-18 19:36)FantaXP7 Wrote:  Question, this might be stupid but will this see that there is a new file(s), scrape info/metadata for the file(s), or will it simply prompt and entire library refresh?

I am hoping to find a solution that will do the former rather than the latter.

Thanks

It will tell xbmc to just scan the entire library. It's because xbmc only allow scanning in a narrower scope, which adds even more technical difficulties. Why? Is global scan a problem? Is it too slow?
find quote
FantaXP7 Offline
Junior Member
Posts: 20
Joined: Mar 2009
Reputation: 0
Post: #30
Just curious as I want to limit the scanning as I have media on a server and to cut down network traffic. Also for many files that have no changes, scanning through them seems redundant. Perhaps little to no issues with this in reality, I just thought it would be ideal to have the new items forced on.

Still a good solution thank you.
find quote
Post Reply