Jump to content

Script - Add channel to recording filename?


Recommended Posts

Posted

Looking for a sanity check from those in the forum far more knowledgeable than me...

It caught my attention recently that the "Post Processing" option in the LiveTV/Advanced settings has three variables it can pass to a post-processing application:  {path}, {channelname}, and {channelnumber}.  I wondered if an extremely simple bash script (my server is installed on a QNAP nas) could tack the channel name and number to the filename of any recording that finishes?

Here's what I came up with:

#!/bin/bash

var_recording_name_length=${#1}
var_recording=${1:0:$var_recording_name_length-3}
var_recording_dest=$var_recording" {"$2$3"}.ts"

mv "$1" "$var_recording_dest"

exit 0

I think it would be more robust if instead assuming the last 3 characters are ".ts" that the script might be tweaked to work with any extension.

I've tested it (briefly) on a secondary NAS and it does seem to work, but I wanted to get thoughts/corrections from others if I've over-thought or under-thought this?  Is there a setting I've missed that accomplishes the same thing?

Any input would be appreciated!!

  • 3 weeks later...
Posted

@montec07eyes in theory you could do this. You'll need to run a library scan in Emby Server afterwards for it to become aware that the file has been renamed.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...