INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Television and MCWS  (Read 2072 times)

t8193770

  • Recent member
  • *
  • Posts: 19
Television and MCWS
« on: February 24, 2023, 07:03:38 am »

I have been using Media Center for my movies, TV shows and music for a while now but I have been using Mediaportal for my TV guide and recordings. I have written a remote control in windows which controls everything and this has worked well but I would like to also to use Media Center 30 for my TV guide and recordings.

I have a couple problems with this.

The first is with the guide, on retrieving the guide with 'GetGuidePrograms' the channels are distinguished by a Channel key but I can't see any way to associate it with the channel name, on the computer I can but not with MCWS. I don't want to have fixed variables as that would mean redoing them every re tune of the satellite card. There is a command - 'GetOrderedListOfTVChannels' but this just lists the channel keys and no channel name.
Does anyone know if I can associate the channel key with the channel name?

The second problem I have is with setting and cancelling recordings.
With 'SetRecording' and 'CancelRecording', ProgKey is mentioned but I can't see where the ProgKey comes from, it is not in the guide.
If trying to set a recording with time and channel, I presume 'Date Recorded' is the start time as it is the only possibility but is in the format "44981.5416666666642413" in the guide, how can this be translated to a format which can be used with MCWS?
Logged

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #1 on: February 25, 2023, 02:12:12 pm »

I have been experimenting with setting a recording with no success.
I have been using the command:-
http://192.168.1.2:52199/MCWS/v1/Television/SetRecording?RuleName=Test&RecType=2&Channels=359875&ProgName=Not%20Going%20Out&StartTime=25022003-22%3A30&DaysOfWeek=7&Duration=30

I have tried many formats of the date but will normally fail because the date is set at 29/12/1899 sometime the 30th (didn't know they had television in the 19th century). The channel, time and duration are set properly just not the date.

When displaying the docs, the information for 'StartTime' does not give any info on what the date format should be.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Television and MCWS
« Reply #2 on: February 25, 2023, 05:06:35 pm »

TV channels and TV guide programs are "files".  You can use GetInfo to get their field values if you know their keys.

I suppose GetGuidePrograms could have returned ProgramKey in addition to other info that it returns.  But you don't have to have a program key in order to record a program. 

SetRecording requires ProgKey only if RecType is 1.

StartTime format: use the value returned by GetGuidePrograms, i.e.

Code: [Select]
<Date Recorded>44982.7083333333357587</Date Recorded>
MC should also be able to parse other time formats.  For example, try "2023-02-28 18:30:00".
Logged
Yaobing Deng, JRiver Media Center

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #3 on: February 26, 2023, 04:52:14 am »

Yes, I should have thought about looking at the files, I will try that next week.

As far as the SetRecording goes, I have just been trying with RecType = 2. I have used the format taken from the guide with no joy, I have tried many different date formats including the one you mentioned e.g. 28-02-2023, 28/02/2023, 28 02 2023, 28022023,  2023-02-28, 2023/02/28, 28-Feb-2023, Feb-28-2023, 28-February-2023 etc

The Recording rule will be correct except for the date which will always be set to either 29/12/1899 or 30/12/1899
Logged

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #4 on: February 27, 2023, 05:53:49 am »

I have been experimenting with RecType=1 and ProgKey.
In the TVGuide.xml file I have tried entering the ProgKey manually.
An example of an entry is:-

Code: [Select]
  <programme start="20230304213000 +0000" stop="20230304220000 +0000" channel="6311">
    <title>Not Going Out</title>
    <desc>7/7. Sitcom. Encouraged by Anna, Lucy considers whether a breast augmentation is for her. Contains adult humour. [S] [HD]</desc>
    <category>Entertainment - Comedy</category>
    <video>
      <aspect>16:9</aspect>
      <quality>HDTV</quality>
    </video>
    <audio>
      <stereo>stereo</stereo>
    </audio>
    <subtitles type="teletext" />
    <episode-num system="xmltv_ns"> . 6 . 0/1</episode-num>
  </programme>

So I have tried entering
<programme id="1234" start="20230304213000 +0000" stop="20230304220000 +0000" channel="6311">
<programme programid="1234" start="20230304213000 +0000" stop="20230304220000 +0000" channel="6311">
<programme progkey="1234" start="20230304213000 +0000" stop="20230304220000 +0000" channel="6311">
<progkey>1234</progkey>
<id>1234</id>
<progamid>1234</progamid>
etc.
and used http://192.168.1.2:52199/MCWS/v1/Television/SetRecording?RuleName=Test&RecType=1&ProgKey=1234
But unfortunately nothing has worked
My problem is I don't know what MC is expecting in the TVGuide.xml for the ProgKey or for the date format when using RecType=2
Logged

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #5 on: February 27, 2023, 08:31:54 am »

Sorry, I'm not sure what happened to my previous post, it doesn't seem to like the xml.

I have managed to get an association between the Channel Key and the Channel Names.

http://192.168.1.2:52199/MCWS/v1/Television/GetOrderedListOfTVChannels
will give a list of all Channel Keys, then :-
http://192.168.1.2:52199/MCWS/v1/File/GetInfo?File=359853     (359853 being the Channel Key)
will give a detailed output for the Channel Key which includes the Channel Name.

Now all I need is to be able to set and cancel a recording with MCWS.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Television and MCWS
« Reply #6 on: February 27, 2023, 08:53:09 am »

Use the code block option to post XML (I edited it for you to illustrate)
Logged

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #7 on: February 27, 2023, 09:00:56 am »

Thanks for that, I will know better for next time.

As far as the date format for 'SetRecording' is concerned, I have discovered that 30th Dec 1899 is Epoch time, hence the "44981.5416666666642413" in the guide but I have tried it in days, hours, minutes but no joy yet.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Television and MCWS
« Reply #8 on: February 27, 2023, 03:49:26 pm »

I think there is a bug in SetRecording.  In the case of recording by time, i.e. RecType=2, we likely have mistakenly used only the time portion of the date time info you passed in, leaving the year, month, and day, empty.  That probably explains why you get the wrong date.

I will take a closer look tomorrow.

Program key is not a value taken from the XML guide file.  It is internal, just like channel key.  When you call GetGuidePrograms, the ProgKey should have been returned along with other info but was not.  I will change that too.
Logged
Yaobing Deng, JRiver Media Center

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #9 on: February 28, 2023, 05:22:18 am »

Many thanks, I thought I was using the wrong separator in the date or I was doing something stupid (which is not uncommon)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Television and MCWS
« Reply #10 on: March 01, 2023, 09:39:53 am »

In MC30.0.69

13. Fixed: MCWS function SetRecording did not parse the start time parameter correctly.

and in an upcoming build:

Changed: MCWS function GetGuidePrograms will return the program database key as an attribute.
Logged
Yaobing Deng, JRiver Media Center

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #11 on: March 01, 2023, 09:55:03 am »

That's great news.

Many thanks for your help, greatly appreciated.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Television and MCWS
« Reply #12 on: March 01, 2023, 02:09:22 pm »

You are welcome.
Logged
Yaobing Deng, JRiver Media Center

t8193770

  • Recent member
  • *
  • Posts: 19
Re: Television and MCWS
« Reply #13 on: March 05, 2023, 02:38:22 pm »

Just to confirm, both SetRecording with ProgKey and setting with StartTime are both working in 30.0.73 and am also able to cancel the recording.

Again, many thanks for all your help.
Logged
Pages: [1]   Go Up