Does anyone know how to capture the programme description and save it to a file with the same name as the recording and in the same folder. I record radio dramas and listen to them when I am out walking the dog and I would like to capture the programme description so I can get some information about the item I am listening to.
Basically you would use a postrecording script in tvheadend to do that.
Quickly googled and here seems to be a possible solution
Just also for your information the normal recording file already includes the metadata so basically it is more of your player being able to read that metadata (e.g. VLC would be able to)/
I have come back to this again. I have created a script which just writes some fixed text to a file. I have run it /home/osmc/test.sh and it is writing the text to the file
I have added the above path to my recording profile and I have starting recording a programme and then aborted it so that the post script is then run but I am not getting the resultant file.
I am guessing that there is some permissions issue going on so which user runs TVHeadend and where is the best place to put the script so the write permissions are there to run it. .
I need to be able to write a file to the directory where the recording is so how do I get a new file that permission.
As you can guess I new to code writing in Linux so please be gentle
Generally there shouldn’t be a permission issue in OSMC as tvheadend is also run as user osmc. So if you manually run the script from command line successful it should also work from tvheadend. Did you made the script executable?
To check the permission/owner for the destination directory run ls -lah /target/folder
I did a quick try:
nano /home/osmc/tv_script
Adding this
#!/bin/sh
echo $2 > /home/osmc/Movies/$1.nfo
And then in the postrecording /home/osmc/tv_script %b %d
This successfully creates a file in /home/osmc/Movies with the original_filename.nfo and the description as the contents.
Thank you so much @fzinken that fixed it. I was missing the first line of the script I think which was stopping it from working. Not sure why it wrote to the file when I ran it manually.