Inotify support?

I think this could need a MASSIVE amount work, but I think it would me a major improvement for Plex users.

Currently programs like Plex Media Server are inotify-aware; this means that the server knows if (and which) a new file is uploaded in the directories it monitors.

If there is no inotify notifications, it is necessary to manually force library update after you have uploaded the new media files.

Library updates use a lot of CPU power and a lot of bandwidth; with big libraries this could even lead to 24hrs-ban for GDrive.

If rclone could inform inotify of a new file added, this would be great, because Plex would instantly be informed and it could automatically add it to the library, without having to make a heavy library update.

What do you think about it, Nick?

As always thanks for you GREAT work.

1 Like

I think it is a good idea. rclone has the file changes API now, so mount is informed of new files appearing.

However it isn’t clear to me how to use FUSE to do this - this is the best doc I’ve found which looks speculative rather than fully implemented.

Is there any other way rclone could notify Plex of additions - is there an API?

I've checked the Plex APIs I've found but there is none regarding adding content; they are mostly about playing and getting info

I've looked even into Python-PlexAPI but found nothing about adding a file to already existing library; I have just found the update() method which scans all the library.

http://python-plexapi.readthedocs.io/en/latest/introduction.html#

Thanks for looking.

Is the API just a full scan, or could it scan a subdirectory?

For what I’ve seen it’a full libray scan.

Suppose you have 3 libs: Movies, TV Series and Music, you can decide update one of them, but not a partial subdir scan.

The behaviour is the same in the PMS web interface.

It’s not clear that FUSE supports the fsnotify interface; https://github.com/libfuse/libfuse/wiki/Fsnotify-and-FUSE

That’s over a year old, so the code may have been updated… dunno!

I looked through the FUSE docs and I couldn’t see anything either…