Kodi Community Forum
WIP Ruby script to organise downloads into a symlink-based structure - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: WIP Ruby script to organise downloads into a symlink-based structure (/showthread.php?tid=142257)



Ruby script to organise downloads into a symlink-based structure - elliotnunn - 2012-10-08

Hi all,

I would like to submit for your approval, this Ruby script that I have written! I use it to organise my torrent collection without significant user interaction. I wrote it to behave in these specific ways:
  • leave downloads intact for seeding, and create relative symlinks at destination
  • base the symlinked location of a download on its file listing, as recognised by some regexes
  • do not bother linking to individual files, but rather, link to an entire torrent and let XBMC do recursive scraping with the aid of extra regexes
  • keep a list of already-processed downloads in a file and skip these in "abbreviated" mode
  • when a download seems to have been deleted since last time, or the script itself has changed, delete all "orphaned" symlinks in the destination directory

I would really appreciate some feedback on this script. I'd be most grateful if someone tried it out! Does it look like a niche can be carved out for something like this or are there already enough "media managers" for XBMC?

You can find "MTO" (GPLv3 licensed) here:
http://pastebin.com/w6rtdiET