I’ve looked at a few of the scripts, but I’d like to handle things a little different. I’d like to simply append the current recording file location to a “queue” for later processing (via crontab), but it appears that the filename passed is in a temporary location ($1) and not in it’s final destination.
Example:
/home/plex/TV/.grab/4dcf5c9c1c58e3658bc546afb90eda33ac8c5429/Grey’s Anatomy (2005) - S14E01 - Break Down the House; Get Off on the Pain.ts
Of course, it will be won’t be in this temporary location when I have the queue processed. I don’t suppose there are other parameters passed that would give me this information (final destination of recording)?
TIA,
Frank
Your script would have to figure out where the file is stored: /home/Plex/TV/Grey’s Anayomy (2005)/ Season 14/Grey’s Anatomy (2005) - S14E01 - Break Down the House; Get Off on the Pain.ts. /home/Plex/TV would always be where TV shows are stored, would then need to pull out the show name, and determine the Season based on S14.
The other thing you could do would be to copy the recording to a temporary folder for processing by your script. Your script would then need to move the converted file to the correct storage location and remove the original.
It becomes a bit problematic. Take the above for example. .grab can be used as a terminator for the “base” directory, then the last ‘/’ as a delimiter between the directory and the file name.
So far, so good…then the problem comes, determining the next level directory. Using the file name and ‘-’ as a separator, we get the possible directory name as “Grey’s Anatomy (2015)”. Well, the year and enclosing parenthesis would be discarded, then there are the invalid (as determined plex) would have to be discarded. In this case the apostrophe (’).
This would be so much easier if the destination directory was determined and passed as a second parameter.
My 2 cents worth,
Frank