kodipity 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4525260ffc7f7f93388041eeb3b1fd9552d361c0
4
- data.tar.gz: 2ba5e1d70861cb28122a462600fac2c5883eb67d
3
+ metadata.gz: 744adb20a50285bcdc400bc491667f999c29a046
4
+ data.tar.gz: af980f7653a5b69822270111252501dd00b5f8e7
5
5
  SHA512:
6
- metadata.gz: 51a95cc2146d713720f11b8307a1800edd4ff4f854b9e4f81421bfda3fc8850b4f40bb5ce66db514c0dbbb71254e0f1ff9fb527eec36bec71571ffc8ecec9b77
7
- data.tar.gz: 391d7baec617a308cc8b1633dd61c917c5ee18de5e934a635ce3b9ff767a5bb3605bedd95da31faad152d60683cb6941161e781d08edbfd0368573fa2004abe6
6
+ metadata.gz: 22f45b42299efff030a6c8ac5602e536e60831c61104fdc58a9a772a727d79d9937a54b0dd4c98260a1b175a247f0a963cf4920aaaebcfbad69f1c075e4ab283
7
+ data.tar.gz: 36cc57cd5450731c5cb46c314b04ab9a3aa153184af71c1f43429d0ef300bbda8fa1e64313bfbe36c7cbe6ee389d7088a460cd5f44b0366e7339b12de87654c3
data/.byebug_history CHANGED
@@ -1,4 +1,12 @@
1
1
  cont
2
+ channel.include? channel_name
3
+ cont
4
+ channel.include? channel_name
5
+ cont
6
+ channel.include? channel_name
7
+ channel
8
+ channel_name
9
+ cont
2
10
  r = HTTParty.post(url, headers: headers, body: _movies)
3
11
  cont
4
12
  r = HTTParty.post(url, headers: headers, body: _movies)
@@ -12,7 +12,7 @@ module Kodipity
12
12
  def initialize(recording_id, fetch_data = false)
13
13
  @title = title
14
14
  @id = recording_id
15
- @lot = plot
15
+ @plot = plot
16
16
  @json = {jsonrpc: '2.0', id: 1, method: 'PVR.GetRecordingDetails', params: { properties: ['title','plot','plotoutline','file', 'channel','runtime', 'genre', 'playcount','starttime'] } }
17
17
  @url = 'http://rpi-osmc.lan/jsonrpc'
18
18
  # @url = 'http://127.0.0.1:8080/jsonrpc'
@@ -47,6 +47,15 @@ module Kodipity
47
47
  def initialize(name, channel_id)
48
48
  @name = name
49
49
  @channel_id = channel_id
50
+ @url = 'http://rpi-osmc.lan/jsonrpc'
51
+ @headers = {"Content-Type" => 'application/json'}
52
+ @json = {jsonrpc: '2.0', id: 1, method: 'PVR.GetRecordingDetails', params: { properties: ['title','plot','plotoutline','file', 'channel','runtime', 'genre', 'playcount','starttime'] } }
53
+ end
54
+
55
+ def play
56
+ @json[:method] = 'Player.Open'
57
+ @json[:params] = { item: { channelid: @channel_id } }
58
+ HTTParty.post @url, headers: @headers, body: @json.to_json
50
59
  end
51
60
  end
52
61
 
@@ -1,3 +1,3 @@
1
1
  module Kodipity
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/kodipity.rb CHANGED
@@ -48,7 +48,7 @@ module Kodipity
48
48
  channel_groups.each do |id|
49
49
  channel_group = {jsonrpc: '2.0', id: 1, method: 'PVR.GetChannels', params: {channelgroupid: id}, playerid: 1}
50
50
  HTTParty.post(@url, headers: @headers, body: channel_group.to_json)['result']['channels'].each do |channel|
51
- media[:channels][channel['label']] = channel['channelid']
51
+ media[:channels][channel['label']] = Kodipity::Channel.new(channel['label'], channel['channelid'])
52
52
  end
53
53
  end
54
54
  media[:channels]
@@ -109,6 +109,12 @@ module Kodipity
109
109
  recs[0]
110
110
  end
111
111
 
112
+ def play_channel(channel_name)
113
+ channels.each do |channel, channel_obj|
114
+ return channel_obj if channel.start_with? channel_name
115
+ end
116
+ end
117
+
112
118
 
113
119
 
114
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kodipity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Kirby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -98,7 +98,6 @@ files:
98
98
  - bin/console
99
99
  - bin/setup
100
100
  - kodipity.gemspec
101
- - lib/.DS_Store
102
101
  - lib/kodipity.rb
103
102
  - lib/kodipity/models.rb
104
103
  - lib/kodipity/version.rb
data/lib/.DS_Store DELETED
Binary file