Manual recording and Up Next

I have a scheduled task set to run at 8:00 am every weekday morning to schedule a recording at 2:00 pm for a channel (KTLA 6973) that has no guide data. The recording works fine, but when the program records it does not pop-up to the top of Up Next. It shows up somewhere in the middle of the pack. I haven't been able to figure out what property I'm failing to set or setting incorrectly.

If I begin watching the show and then stop it, it does move up to the top of Up Next.

This is the payload to create the job for today's recording:

{
  "Name": "KTLA Off the Clock",
  "Time": 1627333200,
  "Duration": 3600,
  "Channels": [
    "6973"
  ],
  "Airing": {
    "Source": "manual",
    "Channel": "6973",
    "OriginalDate": "2021-07-26",
    "Time": 1627333200,
    "Duration": 3600,
    "Title": "Off the Clock",
    "EpisodeTitle": "OTC 2021-07-26",
    "Summary": "Megan, Chris and Henry",
    "Image": "http://krusty.home/junk/otc.png",
    "SeriesID": "666666667",
    "ProgramID": "CS666666667-1627333200",
    "SeasonNumber": 2021,
    "EpisodeNumber": 207,
    "Raw": ""
  }
}

Another anomaly that I've run into while tweaking this is that the "Image" property of the "group" object for this show is the URL that I set during my first attempt to get this working. I have not been able to figure out any way to update the Image property of the group object or to get rid of the group object entirely. (I changed the bogus SeriesID that I made up to work-around that issue.)

Were you able to figure this out? And is there a tutorial somewhere that shows how to create this file and execute it? Sorry, I'm a beginner at this and just trying to record the KTLA news at specific times each day like 7am PT to 11am PT to watch the news. I also have the 6973 channel but I can't figure out how to manually assign the guide info or just have it record at a specific time each day. Thanks

I was never able to resolve the issue of the recordings not appearing at the top of "Up Next", but I do successfully record the the program every day.

I have a scheduled task (on Windows) that runs the following PowerShell script every morning to set up the recording at 2:01 pm.

$startTime = (Get-Date '14:01')
$epoch = (Get-Date '1/1/1970')
$timestamp = [long](($startTime.ToUniversalTime() - $epoch).TotalSeconds)
$duration = 3600

$d = [ordered]@{}
$d.Name = 'KTLA Off the Clock'
$d.Time = $timestamp
$d.Duration = $duration
$d.Channels = @('6973')
$d.Airing = [ordered]@{}
$d.Airing.Source = 'manual'
$d.Airing.Channel = '6973'
$d.Airing.OriginalDate = $startTime.ToString('yyyy-MM-dd')
$d.Airing.Time = $timestamp
$d.Airing.Duration = $duration
$d.Airing.Title = 'Off the Clock'
$d.Airing.EpisodeTitle = $startTime.ToString('OTC yyyy-MM-dd')
$d.Airing.Summary = 'Megan, Chris and Henry'
$d.Airing.Image = 'http://krusty.home/junk/otc.png'
$d.Airing.SeriesID = '666666667'
$d.Airing.ProgramID = 'CS666666667-' + $timestamp.ToString()
$d.Airing.SeasonNumber = $startTime.Year
$d.Airing.EpisodeNumber = $startTime.DayOfYear
$d.Airing.Raw = ''

$data = ConvertTo-Json $d

Invoke-RestMethod -Method Post -Body $data -Uri 'http://localhost:8089/dvr/jobs/new'
  • You would need to change $starttime in the first line of the script to '7:00'.
  • Change $duration to 3600 * 4.
  • Change the Image URL to some location where you have an image to associate with the recording.
  • The SeriesID and ProgramID values are just something I made up that probably won't collide with any real IDs. I'm not sure they are necessary or even useful.
  • If you are not running the script on the same machine as your Channels DVR server, you will need to change "localhost" in the Invoke-RestMethod line to the name of your DVR server.

The script is in a file named OffTheClock.ps1. The command in Task Scheduler to run it is:

powershell.exe -Command & 'C:\Users\xxxx\Documents\WindowsPowerShell\OffTheClock.ps1'

I have the script set to run at 8:00 am on weekday mornings. You would want it to run sometime after midnight and before 7:00 am.