kodi_client 0.4.1 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/README.md +3 -1
- data/kodi_client.gemspec +2 -2
- data/lib/kodi_client/global_types/favourites_types.rb +69 -0
- data/lib/kodi_client/global_types/input_types.rb +216 -0
- data/lib/kodi_client/method/favourites.rb +41 -0
- data/lib/kodi_client/method/input.rb +112 -0
- data/lib/kodi_client.rb +8 -2
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 860eb2c3848cb508f5faaad0bf3716e330d1cb1113ebdfd6d847ccd33302d360
|
4
|
+
data.tar.gz: d51f977964b4a89698985c7cfb5f78f83b83a1c00502d436eee6b84550177f28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55f60b1ad247d88fcb77ae527a3b47a43521853d8f3d06f6fbe29db07ec465fb91c29a6146ec20414dadb0c00191172e974fae29291d63d1cbabd50e2105666d
|
7
|
+
data.tar.gz: dad48a6e2c40302af39190e88a531d268f7b20f08cdac4322f73406c78d5b1a02df351faa260afab5094edb1aa1f301cce4be6c2c2c2c707c32e7c59c15cbf5a
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,9 @@ RubyKodiClient is a work-in-progress client for [Kodi JSON API v12](https://kodi
|
|
5
5
|
Currently implemented are the following Methods:
|
6
6
|
* Addons
|
7
7
|
* Application
|
8
|
+
* Favourites
|
8
9
|
* GUI
|
10
|
+
* Input
|
9
11
|
* Player
|
10
12
|
|
11
13
|
## Installation
|
@@ -19,7 +21,7 @@ gem build kodi-client.gemspec
|
|
19
21
|
```
|
20
22
|
and then execute
|
21
23
|
```shell
|
22
|
-
gem build kodi-client-
|
24
|
+
gem build kodi-client-x.x.x.gemspec
|
23
25
|
```
|
24
26
|
|
25
27
|
## Enable Kodi Remote Control
|
data/kodi_client.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'kodi_client'
|
5
|
-
spec.version = '0.4.
|
5
|
+
spec.version = '0.4.5'
|
6
6
|
spec.authors = ['Christian Feier']
|
7
7
|
spec.email = ['christian.feier@gmail.com']
|
8
8
|
|
9
9
|
spec.summary = 'A work-in-progress client for Kodi JSON API v2.'
|
10
|
-
spec.description = 'A client for the Kodi JSON API v12, currently implemented methods are addons, application, gui and player (more will be added with the time). For more information how to use it and how to activate Remote Control in Kodi, please check the github page https://github.com/cfe86/RubyKodiClient'
|
10
|
+
spec.description = 'A client for the Kodi JSON API v12, currently implemented methods are addons, application, Favourites, gui, Input and player (more will be added with the time). For more information how to use it and how to activate Remote Control in Kodi, please check the github page https://github.com/cfe86/RubyKodiClient'
|
11
11
|
spec.homepage = 'https://github.com/cfe86/RubyKodiClient'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = '>= 2.5.0'
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/util/comparable'
|
4
|
+
require 'kodi_client/util/iterable'
|
5
|
+
require 'kodi_client/global_types/list_types'
|
6
|
+
|
7
|
+
module KodiClient
|
8
|
+
module Types
|
9
|
+
module Favourites
|
10
|
+
|
11
|
+
# Favourite.Type https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Type
|
12
|
+
module Type
|
13
|
+
extend Iterable
|
14
|
+
|
15
|
+
MEDIA = 'media'
|
16
|
+
WINDOW = 'window'
|
17
|
+
SCRIPT = 'script'
|
18
|
+
ANDROID_APP = 'androidapp'
|
19
|
+
UNKNOWN = 'unknown'
|
20
|
+
end
|
21
|
+
|
22
|
+
# Favourite.Fields.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Fields.Favourite
|
23
|
+
module FieldsFavourite
|
24
|
+
extend Iterable
|
25
|
+
|
26
|
+
WINDOW = 'window'
|
27
|
+
WINDOW_PARAMETER = 'windowparameter'
|
28
|
+
THUMBNAIL = 'thumbnail'
|
29
|
+
PATH = 'path'
|
30
|
+
end
|
31
|
+
|
32
|
+
# Favourite.Details.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Details.Favourite
|
33
|
+
class Favourite
|
34
|
+
include Comparable
|
35
|
+
|
36
|
+
attr_reader :path, :thumbnail, :title, :type, :window, :window_parameter
|
37
|
+
|
38
|
+
def initialize(hash)
|
39
|
+
@path = hash['path']
|
40
|
+
@thumbnail = hash['thumbnail']
|
41
|
+
@title = hash['title']
|
42
|
+
@type = hash['type']
|
43
|
+
@window = hash['window']
|
44
|
+
@window_parameter = hash['windowparameter']
|
45
|
+
end
|
46
|
+
|
47
|
+
def ==(other)
|
48
|
+
compare(self, other)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# return type for Favourites.GetFavourites
|
53
|
+
class GetFavouriteReturned
|
54
|
+
include Comparable
|
55
|
+
|
56
|
+
attr_reader :favourites, :limits
|
57
|
+
|
58
|
+
def initialize(hash)
|
59
|
+
@favourites = hash['favourites'].map { |it| Favourite.new(it) }
|
60
|
+
@limits = Types::List::ListLimitsReturned.new(hash['limits'])
|
61
|
+
end
|
62
|
+
|
63
|
+
def ==(other)
|
64
|
+
compare(self, other)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/util/iterable'
|
4
|
+
|
5
|
+
module KodiClient
|
6
|
+
module Types
|
7
|
+
module Input
|
8
|
+
|
9
|
+
# Input.Action https://kodi.wiki/view/JSON-RPC_API/v12#Input.Action
|
10
|
+
module InputAction
|
11
|
+
include Iterable
|
12
|
+
|
13
|
+
ANALOGFASTFORWARD = 'analogfastforward'
|
14
|
+
ANALOGMOVE = 'analogmove'
|
15
|
+
ANALOGMOVEX = 'analogmovex'
|
16
|
+
ANALOGMOVEY = 'analogmovey'
|
17
|
+
ANALOGREWIND = 'analogrewind'
|
18
|
+
ANALOGSEEKBACK = 'analogseekback'
|
19
|
+
ANALOGSEEKFORWARD = 'analogseekforward'
|
20
|
+
ASPECTRATIO = 'aspectratio'
|
21
|
+
AUDIODELAY = 'audiodelay'
|
22
|
+
AUDIODELAYMINUS = 'audiodelayminus'
|
23
|
+
AUDIODELAYPLUS = 'audiodelayplus'
|
24
|
+
AUDIONEXTLANGUAGE = 'audionextlanguage'
|
25
|
+
AUDIOTOGGLEDIGITAL = 'audiotoggledigital'
|
26
|
+
BACK = 'back'
|
27
|
+
BACKSPACE = 'backspace'
|
28
|
+
BIGSTEPBACK = 'bigstepback'
|
29
|
+
BIGSTEPFORWARD = 'bigstepforward'
|
30
|
+
BLUE = 'blue'
|
31
|
+
CHANNELDOWN = 'channeldown'
|
32
|
+
CHANNELUP = 'channelup'
|
33
|
+
CHAPTERORBIGSTEPBACK = 'chapterorbigstepback'
|
34
|
+
CHAPTERORBIGSTEPFORWARD = 'chapterorbigstepforward'
|
35
|
+
CLOSE = 'close'
|
36
|
+
CODECINFO = 'codecinfo'
|
37
|
+
CONTEXTMENU = 'contextmenu'
|
38
|
+
COPY = 'copy'
|
39
|
+
CREATEBOOKMARK = 'createbookmark'
|
40
|
+
CREATEEPISODEBOOKMARK = 'createepisodebookmark'
|
41
|
+
CURSORLEFT = 'cursorleft'
|
42
|
+
CURSORRIGHT = 'cursorright'
|
43
|
+
CYCLESUBTITLE = 'cyclesubtitle'
|
44
|
+
DECREASEPAR = 'decreasepar'
|
45
|
+
DECREASERATING = 'decreaserating'
|
46
|
+
DECREASEVISRATING = 'decreasevisrating'
|
47
|
+
DELETE = 'delete'
|
48
|
+
DOUBLECLICK = 'doubleclick'
|
49
|
+
DOWN = 'down'
|
50
|
+
ENTER = 'enter'
|
51
|
+
ERROR = 'error'
|
52
|
+
FASTFORWARD = 'fastforward'
|
53
|
+
FILTER = 'filter'
|
54
|
+
FILTERCLEAR = 'filterclear'
|
55
|
+
FILTERSMS2 = 'filtersms2'
|
56
|
+
FILTERSMS3 = 'filtersms3'
|
57
|
+
FILTERSMS4 = 'filtersms4'
|
58
|
+
FILTERSMS5 = 'filtersms5'
|
59
|
+
FILTERSMS6 = 'filtersms6'
|
60
|
+
FILTERSMS7 = 'filtersms7'
|
61
|
+
FILTERSMS8 = 'filtersms8'
|
62
|
+
FILTERSMS9 = 'filtersms9'
|
63
|
+
FIRSTPAGE = 'firstpage'
|
64
|
+
FULLSCREEN = 'fullscreen'
|
65
|
+
GREEN = 'green'
|
66
|
+
GUIPROFILE = 'guiprofile'
|
67
|
+
HIGHLIGHT = 'highlight'
|
68
|
+
INCREASEPAR = 'increasepar'
|
69
|
+
INCREASERATING = 'increaserating'
|
70
|
+
INCREASEVISRATING = 'increasevisrating'
|
71
|
+
INFO = 'info'
|
72
|
+
JUMPSMS2 = 'jumpsms2'
|
73
|
+
JUMPSMS3 = 'jumpsms3'
|
74
|
+
JUMPSMS4 = 'jumpsms4'
|
75
|
+
JUMPSMS5 = 'jumpsms5'
|
76
|
+
JUMPSMS6 = 'jumpsms6'
|
77
|
+
JUMPSMS7 = 'jumpsms7'
|
78
|
+
JUMPSMS8 = 'jumpsms8'
|
79
|
+
JUMPSMS9 = 'jumpsms9'
|
80
|
+
LASTPAGE = 'lastpage'
|
81
|
+
LEFT = 'left'
|
82
|
+
LEFTCLICK = 'leftclick'
|
83
|
+
LOCKPRESET = 'lockpreset'
|
84
|
+
LONGCLICK = 'longclick'
|
85
|
+
LONGPRESS = 'longpress'
|
86
|
+
MENU = 'menu'
|
87
|
+
MIDDLECLICK = 'middleclick'
|
88
|
+
MOUSEDRAG = 'mousedrag'
|
89
|
+
MOUSEMOVE = 'mousemove'
|
90
|
+
MOVE = 'move'
|
91
|
+
MOVEITEMDOWN = 'moveitemdown'
|
92
|
+
MOVEITEMUP = 'moveitemup'
|
93
|
+
MUTE = 'mute'
|
94
|
+
NEXTCALIBRATION = 'nextcalibration'
|
95
|
+
NEXTCHANNELGROUP = 'nextchannelgroup'
|
96
|
+
NEXTLETTER = 'nextletter'
|
97
|
+
NEXTPICTURE = 'nextpicture'
|
98
|
+
NEXTPRESET = 'nextpreset'
|
99
|
+
NEXTRESOLUTION = 'nextresolution'
|
100
|
+
NEXTSCENE = 'nextscene'
|
101
|
+
NEXTSTEREOMODE = 'nextstereomode'
|
102
|
+
NEXTSUBTITLE = 'nextsubtitle'
|
103
|
+
NOOP = 'noop'
|
104
|
+
NUMBER0 = 'number0'
|
105
|
+
NUMBER1 = 'number1'
|
106
|
+
NUMBER2 = 'number2'
|
107
|
+
NUMBER3 = 'number3'
|
108
|
+
NUMBER4 = 'number4'
|
109
|
+
NUMBER5 = 'number5'
|
110
|
+
NUMBER6 = 'number6'
|
111
|
+
NUMBER7 = 'number7'
|
112
|
+
NUMBER8 = 'number8'
|
113
|
+
NUMBER9 = 'number9'
|
114
|
+
OSD = 'osd'
|
115
|
+
PAGEDOWN = 'pagedown'
|
116
|
+
PAGEUP = 'pageup'
|
117
|
+
PANGESTURE = 'pangesture'
|
118
|
+
PARENTDIR = 'parentdir'
|
119
|
+
PARENTFOLDER = 'parentfolder'
|
120
|
+
PAUSE = 'pause'
|
121
|
+
PLAY = 'play'
|
122
|
+
PLAYERDEBUG = 'playerdebug'
|
123
|
+
PLAYERPROCESSINFO = 'playerprocessinfo'
|
124
|
+
PLAYLIST = 'playlist'
|
125
|
+
PLAYPAUSE = 'playpause'
|
126
|
+
PLAYPVR = 'playpvr'
|
127
|
+
PLAYPVRRADIO = 'playpvrradio'
|
128
|
+
PLAYPVRTV = 'playpvrtv'
|
129
|
+
PREVIOUSCHANNELGROUP = 'previouschannelgroup'
|
130
|
+
PREVIOUSMENU = 'previousmenu'
|
131
|
+
PREVIOUSPICTURE = 'previouspicture'
|
132
|
+
PREVIOUSPRESET = 'previouspreset'
|
133
|
+
PREVIOUSSCENE = 'previousscene'
|
134
|
+
PREVIOUSSTEREOMODE = 'previousstereomode'
|
135
|
+
PREVLETTER = 'prevletter'
|
136
|
+
QUEUE = 'queue'
|
137
|
+
RANDOMPRESET = 'randompreset'
|
138
|
+
RECORD = 'record'
|
139
|
+
RED = 'red'
|
140
|
+
RELOADKEYMAPS = 'reloadkeymaps'
|
141
|
+
RENAME = 'rename'
|
142
|
+
RESETCALIBRATION = 'resetcalibration'
|
143
|
+
REWIND = 'rewind'
|
144
|
+
RIGHT = 'right'
|
145
|
+
RIGHTCLICK = 'rightclick'
|
146
|
+
ROTATE = 'rotate'
|
147
|
+
ROTATECCW = 'rotateccw'
|
148
|
+
ROTATEGESTURE = 'rotategesture'
|
149
|
+
SCANITEM = 'scanitem'
|
150
|
+
SCREENSHOT = 'screenshot'
|
151
|
+
SCROLLDOWN = 'scrolldown'
|
152
|
+
SCROLLUP = 'scrollup'
|
153
|
+
SELECT = 'select'
|
154
|
+
SETRATING = 'setrating'
|
155
|
+
SETTINGSLEVELCHANGE = 'settingslevelchange'
|
156
|
+
SETTINGSRESET = 'settingsreset'
|
157
|
+
SHIFT = 'shift'
|
158
|
+
SHOWPRESET = 'showpreset'
|
159
|
+
SHOWSUBTITLES = 'showsubtitles'
|
160
|
+
SHOWTIME = 'showtime'
|
161
|
+
SHOWTIMERRULE = 'showtimerrule'
|
162
|
+
SHOWVIDEOMENU = 'showvideomenu'
|
163
|
+
SKIPNEXT = 'skipnext'
|
164
|
+
SKIPPREVIOUS = 'skipprevious'
|
165
|
+
SMALLSTEPBACK = 'smallstepback'
|
166
|
+
STEPBACK = 'stepback'
|
167
|
+
STEPFORWARD = 'stepforward'
|
168
|
+
STEREOMODE = 'stereomode'
|
169
|
+
STEREOMODETOMONO = 'stereomodetomono'
|
170
|
+
STOP = 'stop'
|
171
|
+
SUBTITLEALIGN = 'subtitlealign'
|
172
|
+
SUBTITLEDELAY = 'subtitledelay'
|
173
|
+
SUBTITLEDELAYMINUS = 'subtitledelayminus'
|
174
|
+
SUBTITLEDELAYPLUS = 'subtitledelayplus'
|
175
|
+
SUBTITLESHIFTDOWN = 'subtitleshiftdown'
|
176
|
+
SUBTITLESHIFTUP = 'subtitleshiftup'
|
177
|
+
SWIPEDOWN = 'swipedown'
|
178
|
+
SWIPELEFT = 'swipeleft'
|
179
|
+
SWIPERIGHT = 'swiperight'
|
180
|
+
SWIPEUP = 'swipeup'
|
181
|
+
SWITCHPLAYER = 'switchplayer'
|
182
|
+
SYMBOLS = 'symbols'
|
183
|
+
TAP = 'tap'
|
184
|
+
TOGGLECOMMSKIP = 'togglecommskip'
|
185
|
+
TOGGLEFULLSCREEN = 'togglefullscreen'
|
186
|
+
TOGGLESTEREOMODE = 'togglestereomode'
|
187
|
+
TOGGLEWATCHED = 'togglewatched'
|
188
|
+
UP = 'up'
|
189
|
+
VERTICALSHIFTDOWN = 'verticalshiftdown'
|
190
|
+
VERTICALSHIFTUP = 'verticalshiftup'
|
191
|
+
VOLAMPDOWN = 'volampdown'
|
192
|
+
VOLAMPUP = 'volampup'
|
193
|
+
VOLUMEAMPLIFICATION = 'volumeamplification'
|
194
|
+
VOLUMEDOWN = 'volumedown'
|
195
|
+
VOLUMEUP = 'volumeup'
|
196
|
+
WHEELDOWN = 'wheeldown'
|
197
|
+
WHEELUP = 'wheelup'
|
198
|
+
YELLOW = 'yellow'
|
199
|
+
ZOOMGESTURE = 'zoomgesture'
|
200
|
+
ZOOMIN = 'zoomin'
|
201
|
+
ZOOMLEVEL1 = 'zoomlevel1'
|
202
|
+
ZOOMLEVEL2 = 'zoomlevel2'
|
203
|
+
ZOOMLEVEL3 = 'zoomlevel3'
|
204
|
+
ZOOMLEVEL4 = 'zoomlevel4'
|
205
|
+
ZOOMLEVEL5 = 'zoomlevel5'
|
206
|
+
ZOOMLEVEL6 = 'zoomlevel6'
|
207
|
+
ZOOMLEVEL7 = 'zoomlevel7'
|
208
|
+
ZOOMLEVEL8 = 'zoomlevel8'
|
209
|
+
ZOOMLEVEL9 = 'zoomlevel9'
|
210
|
+
ZOOMNORMAL = 'zoomnormal'
|
211
|
+
ZOOMOUT = 'zoomout'
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/kodi_module'
|
4
|
+
require 'kodi_client/global_types/favourites_types'
|
5
|
+
|
6
|
+
module KodiClient
|
7
|
+
module Modules
|
8
|
+
# contains all Kodi Application methods
|
9
|
+
class Favourites < KodiModule
|
10
|
+
|
11
|
+
ADD_FAVOURITE = 'Favourites.AddFavourite'
|
12
|
+
GET_FAVOURITES = 'Favourites.GetFavourites'
|
13
|
+
|
14
|
+
def add_favourite(title, type = Types::Favourites::Type::UNKNOWN, path = nil, window = nil,
|
15
|
+
window_parameter = nil, thumbnail = nil, kodi_id = 1)
|
16
|
+
params = { 'title' => title, 'type' => type }
|
17
|
+
params['path'] = path unless path.nil?
|
18
|
+
params['window'] = window unless window.nil?
|
19
|
+
params['windowparameter'] = window_parameter unless window_parameter.nil?
|
20
|
+
params['thumbnail'] = thumbnail unless thumbnail.nil?
|
21
|
+
request = KodiRequest.new(kodi_id, ADD_FAVOURITE, params)
|
22
|
+
json = invoke_api(request)
|
23
|
+
KodiResponse.new(json)
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_favourites(properties = Types::Favourites::FieldsFavourite.all_properties, type = nil, kodi_id = 1)
|
27
|
+
params = { 'properties' => properties }
|
28
|
+
params['type'] = type unless type.nil?
|
29
|
+
request = KodiRequest.new(kodi_id, GET_FAVOURITES, params)
|
30
|
+
json = invoke_api(request)
|
31
|
+
result = json['result'].nil? ? nil : Types::Favourites::GetFavouriteReturned.new(json['result'])
|
32
|
+
json['result'] = result
|
33
|
+
KodiResponse.new(json)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# 'path' => path,
|
40
|
+
# 'window' => window, 'windowparameter' => windowparameter,
|
41
|
+
# 'thumbnail' => thumbnail
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/global_types/gui_types'
|
4
|
+
require 'kodi_client/kodi_module'
|
5
|
+
require 'kodi_client/global_types/input_types'
|
6
|
+
|
7
|
+
module KodiClient
|
8
|
+
module Modules
|
9
|
+
# contains all Kodi Input methods
|
10
|
+
class Input < KodiModule
|
11
|
+
|
12
|
+
BACK = 'Input.Back'
|
13
|
+
CONTEXT_MENU = 'Input.ContextMenu'
|
14
|
+
DOWN = 'Input.Down'
|
15
|
+
EXECUTE_ACTION = 'Input.ExecuteAction'
|
16
|
+
HOME = 'Input.Home'
|
17
|
+
INFO = 'Input.Info'
|
18
|
+
LEFT = 'Input.Left'
|
19
|
+
RIGHT = 'Input.Right'
|
20
|
+
SELECT = 'Input.Select'
|
21
|
+
SEND_TEXT = 'Input.SendText'
|
22
|
+
SHOW_CODEC = 'Input.ShowCodec'
|
23
|
+
SHOW_OSD = 'Input.ShowOSD'
|
24
|
+
SHOW_PLAYER_PROCESS_INFO = 'Input.ShowPlayerProcessInfo'
|
25
|
+
UP = 'Input.Up'
|
26
|
+
|
27
|
+
def back(kodi_id = 1)
|
28
|
+
request = KodiRequest.new(kodi_id, BACK, {})
|
29
|
+
json = invoke_api(request)
|
30
|
+
KodiResponse.new(json)
|
31
|
+
end
|
32
|
+
|
33
|
+
def context_menu(kodi_id = 1)
|
34
|
+
request = KodiRequest.new(kodi_id, CONTEXT_MENU, {})
|
35
|
+
json = invoke_api(request)
|
36
|
+
KodiResponse.new(json)
|
37
|
+
end
|
38
|
+
|
39
|
+
def down(kodi_id = 1)
|
40
|
+
request = KodiRequest.new(kodi_id, DOWN, {})
|
41
|
+
json = invoke_api(request)
|
42
|
+
KodiResponse.new(json)
|
43
|
+
end
|
44
|
+
|
45
|
+
def execute_action(action = Types::Input::InputAction::BACK, kodi_id = 1)
|
46
|
+
request = KodiRequest.new(kodi_id, EXECUTE_ACTION, { 'action' => action })
|
47
|
+
json = invoke_api(request)
|
48
|
+
KodiResponse.new(json)
|
49
|
+
end
|
50
|
+
|
51
|
+
def home(kodi_id = 1)
|
52
|
+
request = KodiRequest.new(kodi_id, HOME, {})
|
53
|
+
json = invoke_api(request)
|
54
|
+
KodiResponse.new(json)
|
55
|
+
end
|
56
|
+
|
57
|
+
def info(kodi_id = 1)
|
58
|
+
request = KodiRequest.new(kodi_id, INFO, {})
|
59
|
+
json = invoke_api(request)
|
60
|
+
KodiResponse.new(json)
|
61
|
+
end
|
62
|
+
|
63
|
+
def left(kodi_id = 1)
|
64
|
+
request = KodiRequest.new(kodi_id, LEFT, {})
|
65
|
+
json = invoke_api(request)
|
66
|
+
KodiResponse.new(json)
|
67
|
+
end
|
68
|
+
|
69
|
+
def right(kodi_id = 1)
|
70
|
+
request = KodiRequest.new(kodi_id, RIGHT, {})
|
71
|
+
json = invoke_api(request)
|
72
|
+
KodiResponse.new(json)
|
73
|
+
end
|
74
|
+
|
75
|
+
def select(kodi_id = 1)
|
76
|
+
request = KodiRequest.new(kodi_id, SELECT, {})
|
77
|
+
json = invoke_api(request)
|
78
|
+
KodiResponse.new(json)
|
79
|
+
end
|
80
|
+
|
81
|
+
def send_text(text, done = true, kodi_id = 1)
|
82
|
+
request = KodiRequest.new(kodi_id, SEND_TEXT, { 'text' => text, 'done' => done})
|
83
|
+
json = invoke_api(request)
|
84
|
+
KodiResponse.new(json)
|
85
|
+
end
|
86
|
+
|
87
|
+
def show_codec(kodi_id = 1)
|
88
|
+
request = KodiRequest.new(kodi_id, SHOW_CODEC, {})
|
89
|
+
json = invoke_api(request)
|
90
|
+
KodiResponse.new(json)
|
91
|
+
end
|
92
|
+
|
93
|
+
def show_osd(kodi_id = 1)
|
94
|
+
request = KodiRequest.new(kodi_id, SHOW_OSD, {})
|
95
|
+
json = invoke_api(request)
|
96
|
+
KodiResponse.new(json)
|
97
|
+
end
|
98
|
+
|
99
|
+
def show_player_process_info(kodi_id = 1)
|
100
|
+
request = KodiRequest.new(kodi_id, SHOW_PLAYER_PROCESS_INFO, {})
|
101
|
+
json = invoke_api(request)
|
102
|
+
KodiResponse.new(json)
|
103
|
+
end
|
104
|
+
|
105
|
+
def up(kodi_id = 1)
|
106
|
+
request = KodiRequest.new(kodi_id, UP, {})
|
107
|
+
json = invoke_api(request)
|
108
|
+
KodiResponse.new(json)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
data/lib/kodi_client.rb
CHANGED
@@ -6,7 +6,9 @@ require 'json'
|
|
6
6
|
require 'kodi_client/Chainable'
|
7
7
|
require 'kodi_client/method/addons'
|
8
8
|
require 'kodi_client/method/application'
|
9
|
+
require 'kodi_client/method/favourites'
|
9
10
|
require 'kodi_client/method/gui'
|
11
|
+
require 'kodi_client/method/input'
|
10
12
|
require 'kodi_client/method/player'
|
11
13
|
|
12
14
|
|
@@ -18,12 +20,14 @@ module KodiClient
|
|
18
20
|
class Client
|
19
21
|
include Chainable
|
20
22
|
|
21
|
-
attr_reader :addons, :application, :gui, :player
|
23
|
+
attr_reader :addons, :application, :gui, :player, :input, :favourites
|
22
24
|
|
23
25
|
def initialize
|
24
26
|
@addons = KodiClient::Modules::Addons.new
|
25
27
|
@application = KodiClient::Modules::Application.new
|
28
|
+
@favourites = KodiClient::Modules::Favourites.new
|
26
29
|
@gui = KodiClient::Modules::GUI.new
|
30
|
+
@input = KodiClient::Modules::Input.new
|
27
31
|
@player = KodiClient::Modules::Player.new
|
28
32
|
end
|
29
33
|
|
@@ -31,7 +35,9 @@ module KodiClient
|
|
31
35
|
@addons.apply_options(options)
|
32
36
|
@application.apply_options(options)
|
33
37
|
@gui.apply_options(options)
|
38
|
+
@input.apply_options(options)
|
34
39
|
@player.apply_options(options)
|
40
|
+
@favourites.apply_options(options)
|
35
41
|
end
|
36
42
|
end
|
37
|
-
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kodi_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Feier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -25,9 +25,9 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 5.0.4
|
27
27
|
description: A client for the Kodi JSON API v12, currently implemented methods are
|
28
|
-
addons, application, gui and player (more will be added with
|
29
|
-
information how to use it and how to activate Remote Control
|
30
|
-
the github page https://github.com/cfe86/RubyKodiClient
|
28
|
+
addons, application, Favourites, gui, Input and player (more will be added with
|
29
|
+
the time). For more information how to use it and how to activate Remote Control
|
30
|
+
in Kodi, please check the github page https://github.com/cfe86/RubyKodiClient
|
31
31
|
email:
|
32
32
|
- christian.feier@gmail.com
|
33
33
|
executables: []
|
@@ -46,8 +46,10 @@ files:
|
|
46
46
|
- lib/kodi_client/global_types/addon_types.rb
|
47
47
|
- lib/kodi_client/global_types/application_types.rb
|
48
48
|
- lib/kodi_client/global_types/audio_types.rb
|
49
|
+
- lib/kodi_client/global_types/favourites_types.rb
|
49
50
|
- lib/kodi_client/global_types/global_types.rb
|
50
51
|
- lib/kodi_client/global_types/gui_types.rb
|
52
|
+
- lib/kodi_client/global_types/input_types.rb
|
51
53
|
- lib/kodi_client/global_types/item_types.rb
|
52
54
|
- lib/kodi_client/global_types/list_types.rb
|
53
55
|
- lib/kodi_client/global_types/media_types.rb
|
@@ -57,7 +59,9 @@ files:
|
|
57
59
|
- lib/kodi_client/kodi_module.rb
|
58
60
|
- lib/kodi_client/method/addons.rb
|
59
61
|
- lib/kodi_client/method/application.rb
|
62
|
+
- lib/kodi_client/method/favourites.rb
|
60
63
|
- lib/kodi_client/method/gui.rb
|
64
|
+
- lib/kodi_client/method/input.rb
|
61
65
|
- lib/kodi_client/method/player.rb
|
62
66
|
- lib/kodi_client/options.rb
|
63
67
|
- lib/kodi_client/util/comparable.rb
|