ShowTimerRule button without prompting
#1
I've been working on a custom skin based on estuary, and in particular am looking at a few changes to the PVRGuide

As part of this I would like to know whether it's possible to have a custom button that triggers the ShowTimerRule action, and automatically clicks OK to submit the timer - i.e. Create the timer with the default values.

I am on Kodi 17.1 with pvr.hts and tvheadend.

Currently I have mapped a remote button to ShowTimerRule which works just fine, but I never change any details on the popup window, so am wondering if there's any way to silently add the timer with the default values, rather than show the intermediary popup window.

So far I haven't found any way to do this in the skin / python scripting / etc, so am running out of ideas.

I am wondering if there is some other action like AddTimerRule, which just goes ahead and adds the timer rule with default values populated?
Reply
#2
There is currently no predefined action for this. But it can be done using json rpc => PVR.AddTimer can create exactly the timer rule created by showtimerrule + immediate return, but without any user interaction involved.
Reply
#3
I've not used the JSON RPC before but after reading the docs, I think I've figured out that I can achieve this with a call such as:

http://192.168.0.6:8080/jsonrpc?request={"jsonrpc": "2.0", "id": 1, "method": "PVR.AddTimer", "params": { "broadcastid": xxxxx, "timerrule": true } }"

I've also figured out how to call this URL from my skin.

However, what I can't figure out, is how to get the {broadcastid} from the currently highlighted event in the PVRGuide.

I looked at the documentation, and thought I might need to use ListItem.DBID but that returns a blank value. I also took a punt based on identifiers I'm seeing in the kodi source code and tried ListItem.BroadcastID, ListItem.UniqueBroadcastID, but all to no avail :-(

So my question is whether it's possible to get the broadcastid for the currently selected event in the PVRGuide?
Reply
#4
Im still struggling with this. I'm now trying to achieve this with a python script.

Its easy to get my python script to call the json api PVR.AddTimer method. But still im struggling to find a way to get the broadcastid of the currently selected item in the epg.

I had some thoughts for making some initial json calls to firstly get the channelid from the current channel name. And then pulling the whole list of broadcasts for that channel, and matching on epgeventtitle, channel, episodename, and start time. However that gets tricky/potentially unreliable especially since the json api returns the starttime in gmt, whereas ListItem.starttime is in your own timezone. I also see that trying to match on channelname/epgeventtitle/episodename may present challenges where special characters are involved.

So before I go trying to re-invent the wheel, and making my script overly complex.....is there any way to obtain the broadcastid of the currently selected epg item in a python script?
Reply

Logout Mark Read Team Forum Stats Members Help
ShowTimerRule button without prompting0