Script to automatically symlink to PLEX-friendly filenames with FileBot in Linux

I am a relatively new user to Plex.  I found FileBot early on and I have used it extensively to create a directory structure of PLEX-friendly symlinks.

 

I don't like renaming my original source files as I use that data to help me classify my media.

 

I have written a Perl script based on Linux::Inotify2.  It is based on a public domain script I found.  It watches for changes in a directory (and all subdirectories) and runs FileBot to create the appropriate links.  I believe that I have worked out almost all of the bugs.  I haven't run into any problems in over a month now.

 

If the source files are renamed or moved, the changes are made to the target symlinks.  If you set Plex to watch the symlink directory, Plex will also automatically update itself.

 

My PMS is on a Linux machine.  Perhaps this script could be adopted for another OS, perhaps not.

 

https://github.com/truckershitch/plex-media-renamer

 

I hope that someone else finds this useful.  It saves me a lot of time.

 

Thanks!

Holy crap wish i would have found this a few hours ago; I just wrote an extremely rudamentary yet pretty effective little function for making plex function properly...

http://pastebin.com/wV9Nw2Br

only thing I can boast about is mine is shorter i am pretty sure there's is more effective.

Version 2.0

I refactored the code a bit with the help of another snippet I found on the web. I’ve been running this new version for a couple of months now without any real issues. Sometimes if a directory is moved into the root of the watched path, it is not seen, but this has only happened to me once. The new code is on the GitHub link I provided in the first post.

If anyone has any problems running this, please let me know here or on GitHub. I think it’s pretty clean, though. You certainly should not lose anything as the renaming work is done with the links, NOT the files themselves.

I use a lot of free software so this is my small way of giving back. Please enjoy it.