OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

I would say make the change permamnent.
I can't see it taking more than 20 seconds.
The thing that takes the longest is regenerating the video index, but the curl command returns as soon as that starts and doesn't wait for it to complete, as evidenced by the DVR log.

2023/11/04 21:28:15.724242 [IDX] Generating video index for file-2517: TV/Planet Earth III/Planet Earth III S01E01 Coasts 2023-11-04-1700.mpg
2023/11/04 21:28:32.765977 [IDX] Finished video index generation for file-2517 in 17s

Using the time command you can see how long each curl command took.

~$ time curl -XPOST "http://192.168.1.4:8089/dvr/files/2517/comskip/edit?source=local" --data-raw "[]"
{"ID":"2517","JobID":"1699142400-172","RuleID":"172","GroupID":"25873335","Path":"TV/Planet Earth III/Planet Earth III S01E01 Coasts 2023-11-04-1700.mpg","CreatedAt":1699142400,"FileSize":1651563832,"Duration":2980.410767,"Completed":true,"Processed":true,"Airing":{"Source":"tms","Channel":"6087","OriginalDate":"2023-10-22","Time":1699142400,"Duration":4260,"Title":"Planet Earth III","EpisodeTitle":"Coasts","Summary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","FullSummary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","Image":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","Categories":["Episode","Series"],"Genres":["Nature","Documentary"],"Tags":["Series Premiere","New","HD","Stereo","CC"],"SeriesID":"25873335","ProgramID":"EP049004200001","SeasonNumber":1,"EpisodeNumber":1,"Cast":["David Attenborough"],"ReleaseYear":2023,"Raw":{"startTime":"2023-11-05T00:00Z","endTime":"2023-11-05T01:11Z","duration":71,"channels":["6087"],"stationId":"64492","qualifiers":["CC","HD 1080i","HDTV","New","Series Premiere"],"program":{"tmsId":"EP049004200001","rootId":"25873369","seriesId":"25873335","entityType":"Episode","subType":"Series","title":"Planet Earth III","titleLang":"en-GB","episodeTitle":"Coasts","episodeNum":1,"seasonNum":1,"releaseYear":2023,"releaseDate":"2023-10-22","origAirDate":"2023-10-22","descriptionLang":"en","shortDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","longDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","topCast":null,"genres":["Nature","Documentary"],"preferredImage":{"uri":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","height":"540","width":"720","primary":"true","category":"Banner-L1","text":"yes","tier":"Series"}}}},"ChannelNumber":"6087","DeviceID":"TVE-Comcast_SSO","UpdatedAt":1699209829870,"Version":6,"JobTime":1699142400,"JobDuration":4380,"HighestPTS":394808760,"BufferStats":{"BufferPct":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":0,"BadCount":2185},"BufferDrop":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":2185,"BadCount":0}},"CommercialsAligned":true,"CommercialsEdited":true,"CommercialDetectSource":"local","PlaybackTime":181,"PlayedAt":1699142825594}
real    0m0.529s
user    0m0.010s
sys     0m0.005s
~$ time curl -XPUT "http://192.168.1.4:8089/dvr/files/2517/reprocess"
{"ID":"2517","JobID":"1699142400-172","RuleID":"172","GroupID":"25873335","Path":"TV/Planet Earth III/Planet Earth III S01E01 Coasts 2023-11-04-1700.mpg","CreatedAt":1699142400,"FileSize":1651563832,"Duration":2980.410767,"Completed":true,"Processed":true,"Airing":{"Source":"tms","Channel":"6087","OriginalDate":"2023-10-22","Time":1699142400,"Duration":4260,"Title":"Planet Earth III","EpisodeTitle":"Coasts","Summary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","FullSummary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","Image":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","Categories":["Episode","Series"],"Genres":["Nature","Documentary"],"Tags":["Series Premiere","New","HD","Stereo","CC"],"SeriesID":"25873335","ProgramID":"EP049004200001","SeasonNumber":1,"EpisodeNumber":1,"Cast":["David Attenborough"],"ReleaseYear":2023,"Raw":{"startTime":"2023-11-05T00:00Z","endTime":"2023-11-05T01:11Z","duration":71,"channels":["6087"],"stationId":"64492","qualifiers":["CC","HD 1080i","HDTV","New","Series Premiere"],"program":{"tmsId":"EP049004200001","rootId":"25873369","seriesId":"25873335","entityType":"Episode","subType":"Series","title":"Planet Earth III","titleLang":"en-GB","episodeTitle":"Coasts","episodeNum":1,"seasonNum":1,"releaseYear":2023,"releaseDate":"2023-10-22","origAirDate":"2023-10-22","descriptionLang":"en","shortDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","longDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","topCast":null,"genres":["Nature","Documentary"],"preferredImage":{"uri":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","height":"540","width":"720","primary":"true","category":"Banner-L1","text":"yes","tier":"Series"}}}},"ChannelNumber":"6087","DeviceID":"TVE-Comcast_SSO","UpdatedAt":1699209830566,"Version":6,"JobTime":1699142400,"JobDuration":4380,"HighestPTS":394808760,"BufferStats":{"BufferPct":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":0,"BadCount":2185},"BufferDrop":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":2185,"BadCount":0}},"CommercialsAligned":true,"CommercialsEdited":true,"CommercialDetectSource":"local","PlaybackTime":181,"PlayedAt":1699142825594}
real    0m0.658s
user    0m0.012s
sys     0m0.004s
~$ time curl -XPUT "http://192.168.1.4:8089/dvr/files/2517/m3u8"
{"ID":"2517","JobID":"1699142400-172","RuleID":"172","GroupID":"25873335","Path":"TV/Planet Earth III/Planet Earth III S01E01 Coasts 2023-11-04-1700.mpg","CreatedAt":1699142400,"FileSize":1651563832,"Duration":2980.410767,"Completed":true,"Processed":true,"Airing":{"Source":"tms","Channel":"6087","OriginalDate":"2023-10-22","Time":1699142400,"Duration":4260,"Title":"Planet Earth III","EpisodeTitle":"Coasts","Summary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","FullSummary":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","Image":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","Categories":["Episode","Series"],"Genres":["Nature","Documentary"],"Tags":["Series Premiere","New","HD","Stereo","CC"],"SeriesID":"25873335","ProgramID":"EP049004200001","SeasonNumber":1,"EpisodeNumber":1,"Cast":["David Attenborough"],"ReleaseYear":2023,"Raw":{"startTime":"2023-11-05T00:00Z","endTime":"2023-11-05T01:11Z","duration":71,"channels":["6087"],"stationId":"64492","qualifiers":["CC","HD 1080i","HDTV","New","Series Premiere"],"program":{"tmsId":"EP049004200001","rootId":"25873369","seriesId":"25873335","entityType":"Episode","subType":"Series","title":"Planet Earth III","titleLang":"en-GB","episodeTitle":"Coasts","episodeNum":1,"seasonNum":1,"releaseYear":2023,"releaseDate":"2023-10-22","origAirDate":"2023-10-22","descriptionLang":"en","shortDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts.","longDescription":"Sir David Attenborough explores the dangerous frontiers created by the world's coasts, where animals fight for survival amid constant change; there are some unexpected residents on Namibia's Skeleton Coast.","topCast":null,"genres":["Nature","Documentary"],"preferredImage":{"uri":"https://tmsimg.fancybits.co/assets/p25873335_b_h9_aa.jpg?w=720\u0026h=540","height":"540","width":"720","primary":"true","category":"Banner-L1","text":"yes","tier":"Series"}}}},"ChannelNumber":"6087","DeviceID":"TVE-Comcast_SSO","UpdatedAt":1699209830566,"Version":6,"JobTime":1699142400,"JobDuration":4380,"HighestPTS":394808760,"BufferStats":{"BufferPct":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":0,"BadCount":2185},"BufferDrop":{"Initial":0,"Last":0,"Min":0,"Max":0,"Sum":0,"GoodCount":2185,"BadCount":0}},"CommercialsAligned":true,"CommercialsEdited":true,"CommercialDetectSource":"local","PlaybackTime":181,"PlayedAt":1699142825594}
real    0m0.019s
user    0m0.011s
sys     0m0.004s

And time marknocommercials.sh should show how long the shell script took to execute

Makes sense. 20 seconds it is. I don't think there's much downside to allowing plenty of margin in this case.

RE: Add manual recording.

Is there any way to tag these as Movie so they get added as such instead of TV?

Never tried before, but just made one.
I think the key is using Airing.MovieID and no Airing.SeriesID but will have to test more to be sure.
This worked as an experiment

{
  "Name": "Elf (2003)",
  "Time": 1699233480,
  "Duration": 60,
  "Channels": ["6034"],
  "Airing": {
    "Source": "manual",
    "Channel": "6034",
    "OriginalDate": "2003-11-07",
    "Time": 1699233480,
    "Duration": 60,
    "Title": "Elf (2003)",
    "Summary": "A man (Will Ferrell) leaves Santa's workshop to search for his family.",
    "FullSummary": "Buddy (Will Ferrell) was accidentally transported to the North Pole as a toddler and raised to adulthood among Santa's elves. Unable to shake the feeling that he doesn't fit in, the adult Buddy travels to New York, in full elf uniform, in search of his real father. As it happens, this is Walter Hobbs (James Caan), a cynical businessman. After a DNA test proves this, Walter reluctantly attempts to start a relationship with the childlike Buddy with increasingly chaotic results.",
    "Image": "https://tmsimg.fancybits.co/assets/p32828_v_v12_at.jpg?w=480&h=720",
    "Categories": ["Movie","Feature Film"],
    "Genres": ["Children","Holiday","Comedy","Fantasy"],
    "Tags": ["CC","DVS","HD 1080i","HDTV"],
    "MovieID": "manual/6034",
    "Directors": ["Jon Favreau"],
    "Cast": ["Will Ferrell","James Caan","Bob Newhart"],
    "QualityRating": 3,
    "ReleaseYear": 2003,
    "ContentRating": "PG"
  }
}


1 Like

Just have to provide Airing.Categories: ["Movie"]

{
  "Name": "Elf (2003)  Movie Categories at 1752",
  "Time": 1699235520,
  "Duration": 60,
  "Channels": ["6034"],
  "Airing": {
    "Source": "manual",
    "Channel": "6034",
    "Time": 1699235520,
    "Duration": 60,
    "Title": "Elf (2003)  Movie Categories at 1752",
    "Categories": ["Movie"]
  }
}

I don't see a Categories option in OliveTin.

OliveTin for Channels would have to be modified.

1 Like

OliveTin updated to support manual recording of Movies. It's now required to select the recording "type" in the bottom field -- TV Series or Movie:

Pull the updated bnhf/olivetin, :latest or :test tag -- they're both the same at present.

1 Like

Thank you sir!

Latest list of OliveTin-for-Channels features posted here:

Also, I'm thinking about adding an action button to reboot HDHomeRun tuners from a dropdown list. Does that have appeal?

For the "Ping Channels DVR Server" Action, I think I'm going to change it from a ping of the host to a curl of the main Channels DVR webpage.

This seems preferable as it confirms Channels DVR itself is running, rather than simply that the host computer is responding. So unless there's anyone that has a specific use-case for the ping approach, we'll go from a core test of this:

pingDVR=$(ping -q -c 1 -W 2 $channelsHost)

to this:

curlDVR=$(curl --fail --output /dev/null --max-time 5 http://$dvr)

As before, multiple DVRs are supported, as is Tailscale. Same healthchecks.io tie-in, so you'll know immediately (based on your test interval) if the curl fails via e-mail or whatever other integrations you've configured.

1 Like

@bnhf I've been using olive tin for awhile and have not had issues. But now I cannot get generate Twit data or fix thumbnails to work. I tried stopping with an interval 0. Then I try to start with an interval and a healthchecks URL. I get the "success" notification and stdout says exit code zero but the icon never turns green and it seems to not be running. Any ideas?

First thing I'd suggest is to pull the most recent version of :latest -- which I pushed 4 days ago. Make sure you allow yamls and scripts to update (UPDATE_YAMLS=true and UPDATE_SCRIPTS=true)

I just tried TWiT.tv myself, and it's working here. The resulting TWiT.tv guide data file now goes into a folder named host-port_data, now that multiple DVRs are supported.

I forgot to mention I have been pulling "latest" and I do have UPDATE_YAMLS=true and UPDATE_SCRIPTS=true.

Can you post the output from stderr after you try to run the Action? That should give me an idea of what's going on.

Here is stderr:

+ dvr=ical_2_xmltv
++ echo ical_2_xmltv
++ awk -F: '{print $1}'
+ channelsHost=ical_2_xmltv
++ awk -F: '{print $2}'
++ echo ical_2_xmltv
+ channelsPort=
+ backgroundScript=1h
+ firstChar=1
+ runInterval=https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ healthchecksIO=
+ [[ '' == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ awk '{print $2}'
++ grep '[1]h.* ical_2_xmltv'
++ ps -ef
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='ical_2_xmltv https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b '
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/ical_2_xmltv-_1h_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b between runs for ical_2_xmltv'
+ grep -q '(.*) #1h' /config/config.yaml
+ nohup /config/1h.sh ical_2_xmltv https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#1h title/s/#/(18Nov23_05:25) #/' /config/config.yaml
+ sed -i '/#1h icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#1h interval default/s/default: .* #/default: https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b #/' /config/config.yaml
sed: -e expression #1, char 55: unknown option to `s'
+ [[ -n '' ]]
+ echo 'ical_2_xmltv 1h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b '
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ serverHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ serverPort=8089
++ ps -ef
++ grep '[1]h.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=
+ [[ -n '' ]]
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for 1h with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/ical_2_xmltv-_1h_latest.log ']'
+ cat /config/ical_2_xmltv-_1h_latest.log

Looks like I didn't push the latest scripts I'm using through to the repo. I'll fix that now and let you know when you can try it again. Shouldn't be long...

Give it a try now if you would please... :latest and :test have both been updated, and are the same currently.

EDIT: Hold tight there's still an issue. Not sure how this happened. :frowning:

1 Like

@cyoungers

Could you give it a go now please?

The Delete Recording Log Files Action needs some documentation (it uses the same launch script as the two scripts we've been addressing), specifically on how to set up the volume mounts for multiple DVRs -- but otherwise I think we should be back on track.

1 Like