Page 1 of 1

Should I bother posting a script that is mostly java?

Posted: 20 Aug 2014, 00:00
by akevit
The only functionalities I used from the groovy scripting language were renaming and extracting files, otherwise it was java.

Anyways what it does is it takes a folder (I:\HD Movies) which contains folders (I:\HD Movies\MovieABC) that contain .rar archives (or any archive per the list) and extracts the contents of the archive to a temp folder, renames the movie file, then transfers the file back to the root folder (I:\HD Movies) and deletes the previous folder (I:\HD Movies\MoviesABC). Currently it just processes everything that's in the archive container as it is easy enough to manually clean out the few other files that are in the archive, but for the most part the archive just contains the video file.

I have a lot of stuff that was packed in rar format since I could remain seeding it and XBMC could play it, but now that I'm moving to Plex I needed to get rid of this style of formatting.

So not sure if there are rules against the style of code for the script I have, but if requested I can post it with a bit more explanation, comments, and do a little refractoring so it's easier to read.

Link: http://pastebin.com/Cg56cuaE

There are is one main hardcoded variable which is the variable to the temp folder, I can easily make that a command line argument. Also I don't fully understand how to properly code with groovy scripts since I had issues with declaring local variables which is why there's some redundancy.

Re: Should I bother posting a script that is mostly java?

Posted: 20 Aug 2014, 03:39
by rednoah
Sure, you can also post it on pastebin or as Gist.

But it seems to be very specialized so you'll need a good documentation on usage otherwise people won't know how to use it.

I'd make my own thread for that.