class Kodipity::Channel

Attributes

channel_id[RW]
name[RW]

Public Class Methods

new(name, channel_id) click to toggle source
# File lib/kodipity/models.rb, line 51
def initialize(name, channel_id)
        @name = name
        @channel_id = channel_id
        @url = 'http://rpi-osmc.lan/jsonrpc'
        @headers = {"Content-Type" => 'application/json'}
        @json = {jsonrpc: '2.0', id: 1, method: 'PVR.GetRecordingDetails', params: { properties: ['title','plot','plotoutline','file', 'channel','runtime', 'genre', 'playcount','starttime'] } }
end

Public Instance Methods

play() click to toggle source
# File lib/kodipity/models.rb, line 59
def play
        @json[:method] = 'Player.Open'
        @json[:params] = { item: { channelid: @channel_id } }
        HTTParty.post @url, headers: @headers, body: @json.to_json
end