kodi_client 0.5.6 → 0.5.7
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 +4 -4
- data/kodi_client.gemspec +1 -1
- data/lib/kodi_client/Chainable.rb +3 -1
- data/lib/kodi_client/global_types/addon_types.rb +60 -48
- data/lib/kodi_client/global_types/application_types.rb +19 -16
- data/lib/kodi_client/global_types/audio_types.rb +41 -29
- data/lib/kodi_client/global_types/favourites_types.rb +17 -16
- data/lib/kodi_client/global_types/global_types.rb +18 -24
- data/lib/kodi_client/global_types/gui_types.rb +21 -15
- data/lib/kodi_client/global_types/item_types.rb +6 -2
- data/lib/kodi_client/global_types/list_types.rb +188 -95
- data/lib/kodi_client/global_types/media_types.rb +16 -11
- data/lib/kodi_client/global_types/player_type.rb +126 -107
- data/lib/kodi_client/global_types/profiles_types.rb +23 -13
- data/lib/kodi_client/global_types/system_types.rb +6 -9
- data/lib/kodi_client/global_types/video_types.rb +66 -41
- data/lib/kodi_client/method/addons.rb +2 -3
- data/lib/kodi_client/method/application.rb +1 -1
- data/lib/kodi_client/method/favourites.rb +1 -1
- data/lib/kodi_client/method/gui.rb +2 -2
- data/lib/kodi_client/method/player.rb +6 -6
- data/lib/kodi_client/method/profiles.rb +2 -2
- data/lib/kodi_client/method/system.rb +1 -1
- data/lib/kodi_client/util/comparable.rb +4 -1
- data/lib/kodi_client/util/creatable.rb +52 -0
- data/lib/kodi_client.rb +5 -9
- metadata +3 -2
@@ -20,6 +20,7 @@ module KodiClient
|
|
20
20
|
# Player.ViewMode https://kodi.wiki/view/JSON-RPC_API/v12#Player.ViewMode
|
21
21
|
module ViewMode
|
22
22
|
extend Iterable
|
23
|
+
|
23
24
|
NORMAL = 'normal'
|
24
25
|
ZOOM = 'zoom'
|
25
26
|
STRETCH_4x3 = 'strech4x3'
|
@@ -34,6 +35,7 @@ module KodiClient
|
|
34
35
|
# player types
|
35
36
|
module PlayerVisibilityType
|
36
37
|
extend Iterable
|
38
|
+
|
37
39
|
INTERNAL = 'internal'
|
38
40
|
EXTERNAL = 'external'
|
39
41
|
REMOTE = 'remote'
|
@@ -80,87 +82,75 @@ module KodiClient
|
|
80
82
|
# player id and type
|
81
83
|
class Player
|
82
84
|
include Comparable
|
85
|
+
extend Creatable
|
83
86
|
|
84
87
|
attr_reader :player_id, :player_type, :type, :name, :plays_audio, :plays_video
|
85
88
|
|
86
|
-
def initialize(
|
87
|
-
@player_id =
|
88
|
-
@player_type =
|
89
|
-
@type =
|
90
|
-
@name =
|
91
|
-
@plays_audio =
|
92
|
-
@plays_video =
|
93
|
-
end
|
94
|
-
|
95
|
-
def ==(other)
|
96
|
-
compare(self, other)
|
89
|
+
def initialize(player_id, player_type, type, name, plays_audio, plays_video)
|
90
|
+
@player_id = player_id
|
91
|
+
@player_type = player_type
|
92
|
+
@type = type
|
93
|
+
@name = name
|
94
|
+
@plays_audio = plays_audio
|
95
|
+
@plays_video = plays_video
|
97
96
|
end
|
98
97
|
end
|
99
98
|
|
100
99
|
# Player Subtitle https://kodi.wiki/view/JSON-RPC_API/v12#Player.Subtitle
|
101
100
|
class Subtitle
|
102
101
|
include Comparable
|
102
|
+
extend Creatable
|
103
103
|
|
104
104
|
attr_reader :index, :is_default, :is_forced, :is_impaired, :language, :name
|
105
105
|
|
106
|
-
def initialize(
|
107
|
-
@index =
|
108
|
-
@is_default =
|
109
|
-
@is_forced =
|
110
|
-
@is_impaired =
|
111
|
-
@language =
|
112
|
-
@name =
|
113
|
-
end
|
114
|
-
|
115
|
-
def ==(other)
|
116
|
-
compare(self, other)
|
106
|
+
def initialize(index, is_default, is_forced, is_impaired, language, name)
|
107
|
+
@index = index
|
108
|
+
@is_default = is_default
|
109
|
+
@is_forced = is_forced
|
110
|
+
@is_impaired = is_impaired
|
111
|
+
@language = language
|
112
|
+
@name = name
|
117
113
|
end
|
118
114
|
end
|
119
115
|
|
120
116
|
# Player.Audio.Stream https://kodi.wiki/view/JSON-RPC_API/v12#Player.Audio.Stream
|
121
117
|
class AudioStream
|
122
118
|
include Comparable
|
119
|
+
extend Creatable
|
123
120
|
|
124
121
|
attr_reader :bitrate, :channels, :codec, :index, :is_default, :is_forced, :is_original, :language,
|
125
122
|
:name, :sample_rate
|
126
123
|
|
127
|
-
def initialize(
|
128
|
-
@bitrate =
|
129
|
-
@channels =
|
130
|
-
@codec =
|
131
|
-
@index =
|
132
|
-
@is_default =
|
133
|
-
@is_forced =
|
134
|
-
@is_original =
|
135
|
-
@language =
|
136
|
-
@name =
|
137
|
-
@sample_rate =
|
138
|
-
end
|
139
|
-
|
140
|
-
def ==(other)
|
141
|
-
compare(self, other)
|
124
|
+
def initialize(bitrate, channels, codec, index, is_default, is_forced, is_original, language, name, sample_rate)
|
125
|
+
@bitrate = bitrate
|
126
|
+
@channels = channels
|
127
|
+
@codec = codec
|
128
|
+
@index = index
|
129
|
+
@is_default = is_default
|
130
|
+
@is_forced = is_forced
|
131
|
+
@is_original = is_original
|
132
|
+
@language = language
|
133
|
+
@name = name
|
134
|
+
@sample_rate = sample_rate
|
142
135
|
end
|
143
136
|
end
|
144
137
|
|
145
138
|
# Player.Video.Stream https://kodi.wiki/view/JSON-RPC_API/v12#Player.Video.Stream
|
146
139
|
class VideoStream
|
147
140
|
include Comparable
|
141
|
+
extend Creatable
|
148
142
|
|
149
143
|
attr_reader :codec, :height, :index, :language, :name, :width, :duration, :aspect
|
150
144
|
|
151
|
-
def initialize(
|
152
|
-
@codec =
|
153
|
-
@height =
|
154
|
-
@index =
|
155
|
-
@language =
|
156
|
-
@name =
|
157
|
-
@width =
|
158
|
-
@duration =
|
159
|
-
@aspect =
|
160
|
-
end
|
161
|
-
|
162
|
-
def ==(other)
|
163
|
-
compare(self, other)
|
145
|
+
def initialize(codec, height, index, language, name, width, duration, aspect)
|
146
|
+
@codec = codec
|
147
|
+
@height = height
|
148
|
+
@index = index
|
149
|
+
@language = language
|
150
|
+
@name = name
|
151
|
+
@width = width
|
152
|
+
@duration = duration
|
153
|
+
@aspect = aspect
|
164
154
|
end
|
165
155
|
end
|
166
156
|
|
@@ -198,76 +188,99 @@ module KodiClient
|
|
198
188
|
# Player.Property.Value https://kodi.wiki/view/JSON-RPC_API/v12#Player.Property.Name
|
199
189
|
class PropertyValue
|
200
190
|
include Comparable
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
191
|
+
extend Creatable
|
192
|
+
|
193
|
+
attr_reader :audio_streams, :cache_percentage, :can_change_speed, :can_move, :can_repeat, :can_rotate,
|
194
|
+
:can_seek, :can_shuffle, :can_zoom, :current_audio_stream, :current_subtitle, :current_video_stream,
|
195
|
+
:live, :party_mode, :percentage, :playlist_id, :position, :repeat, :shuffled, :speed,
|
196
|
+
:subtitle_enabled, :subtitles, :time, :total_time, :type, :video_streams
|
197
|
+
|
198
|
+
def self.create(hash)
|
199
|
+
return nil if hash.nil?
|
200
|
+
|
201
|
+
audio_streams = AudioStream.create_list(hash['audiostreams'])
|
202
|
+
current_audio_stream = AudioStream.create(hash['currentaudiostream'])
|
203
|
+
current_subtitle = Subtitle.create(hash['currentsubtitle'])
|
204
|
+
current_video_stream = VideoStream.create(hash['currentvideostream'])
|
205
|
+
subtitles = Subtitle.create_list(hash['subtitles'])
|
206
|
+
time = Types::Global::GlobalTime.create(hash['time'])
|
207
|
+
total_time = Types::Global::GlobalTime.create(hash['totaltime'])
|
208
|
+
video_streams = VideoStream.create_list(hash['videostreams'])
|
209
|
+
|
210
|
+
hash['type'] = PlayerType::VIDEO if hash['type'].nil?
|
211
|
+
hash['playlistid'] = -1 if hash['playlistid'].nil?
|
212
|
+
hash['position'] = -1 if hash['position'].nil?
|
213
|
+
hash['repeat'] = PlayerRepeat::OFF if hash['repeat'].nil?
|
214
|
+
|
215
|
+
new(audio_streams, *Creatable.hash_to_arr(hash, %w[cache_percentage can_change_speed can_move
|
216
|
+
can_repeat can_rotate can_seek can_shuffle can_zoom]),
|
217
|
+
current_audio_stream, current_subtitle, current_video_stream,
|
218
|
+
*Creatable.hash_to_arr(hash, %w[live party_mode percentage playlist_id position repeat
|
219
|
+
shuffled speed subtitle_enabled]), subtitles, time, total_time,
|
220
|
+
hash['type'], video_streams)
|
230
221
|
end
|
231
222
|
|
232
|
-
def
|
233
|
-
|
223
|
+
def initialize(audio_streams, cache_percentage, can_change_speed, can_move, can_repeat, can_rotate, can_seek,
|
224
|
+
can_shuffle, can_zoom, current_audio_stream, current_subtitle, current_video_stream, live,
|
225
|
+
party_mode, percentage, playlist_id, position, repeat, shuffled, speed,
|
226
|
+
subtitle_enabled, subtitles, time, total_time, type, video_streams)
|
227
|
+
@audio_streams = audio_streams
|
228
|
+
@cache_percentage = cache_percentage
|
229
|
+
@can_change_speed = can_change_speed
|
230
|
+
@can_move = can_move
|
231
|
+
@can_repeat = can_repeat
|
232
|
+
@can_rotate = can_rotate
|
233
|
+
@can_seek = can_seek
|
234
|
+
@can_shuffle = can_shuffle
|
235
|
+
@can_zoom = can_zoom
|
236
|
+
@current_audio_stream = current_audio_stream
|
237
|
+
@current_subtitle = current_subtitle
|
238
|
+
@current_video_stream = current_video_stream
|
239
|
+
@live = live
|
240
|
+
@party_mode = party_mode
|
241
|
+
@percentage = percentage
|
242
|
+
@playlist_id = playlist_id
|
243
|
+
@position = position
|
244
|
+
@repeat = repeat
|
245
|
+
@shuffled = shuffled
|
246
|
+
@speed = speed
|
247
|
+
@subtitle_enabled = subtitle_enabled
|
248
|
+
@subtitles = subtitles
|
249
|
+
@time = time
|
250
|
+
@total_time = total_time
|
251
|
+
@type = type
|
252
|
+
@video_streams = video_streams
|
234
253
|
end
|
235
254
|
end
|
236
255
|
|
237
256
|
# return value for Player.GetViewMode
|
238
257
|
class PlayerViewMode
|
239
258
|
include Comparable
|
259
|
+
extend Creatable
|
240
260
|
|
241
261
|
attr_reader :nonlinear_stretch, :pixel_ratio, :vertical_shift, :view_mode, :zoom
|
242
262
|
|
243
|
-
def initialize(
|
244
|
-
@nonlinear_stretch =
|
245
|
-
@pixel_ratio =
|
246
|
-
@vertical_shift =
|
247
|
-
@view_mode =
|
248
|
-
@zoom =
|
249
|
-
end
|
250
|
-
|
251
|
-
def ==(other)
|
252
|
-
compare(self, other)
|
263
|
+
def initialize(nonlinear_stretch, pixel_ratio, vertical_shift, view_mode, zoom)
|
264
|
+
@nonlinear_stretch = nonlinear_stretch
|
265
|
+
@pixel_ratio = pixel_ratio
|
266
|
+
@vertical_shift = vertical_shift
|
267
|
+
@view_mode = view_mode
|
268
|
+
@zoom = zoom
|
253
269
|
end
|
254
270
|
end
|
255
271
|
|
256
272
|
# Player.Position.Time https://kodi.wiki/view/JSON-RPC_API/v12#Player.Position.Time
|
257
273
|
class PlayerPositionTime
|
258
274
|
include Comparable
|
275
|
+
extend Creatable
|
259
276
|
|
260
277
|
attr_reader :hours, :minutes, :seconds, :milliseconds
|
261
278
|
|
262
|
-
def initialize(
|
263
|
-
@hours =
|
264
|
-
@minutes =
|
265
|
-
@seconds =
|
266
|
-
@milliseconds =
|
267
|
-
end
|
268
|
-
|
269
|
-
def ==(other)
|
270
|
-
compare(self, other)
|
279
|
+
def initialize(hours, minutes, seconds, milliseconds)
|
280
|
+
@hours = hours
|
281
|
+
@minutes = minutes
|
282
|
+
@seconds = seconds
|
283
|
+
@milliseconds = milliseconds
|
271
284
|
end
|
272
285
|
end
|
273
286
|
|
@@ -282,17 +295,23 @@ module KodiClient
|
|
282
295
|
end
|
283
296
|
|
284
297
|
# return value of Player.Seek
|
285
|
-
class
|
298
|
+
class SeekReturned
|
286
299
|
include Comparable
|
300
|
+
extend Creatable
|
301
|
+
|
302
|
+
def self.create(hash)
|
303
|
+
return nil if hash.nil?
|
304
|
+
|
305
|
+
time = Types::Global::GlobalTime.create(hash['time'])
|
306
|
+
total_time = Types::Global::GlobalTime.create(hash['totaltime'])
|
287
307
|
|
288
|
-
|
289
|
-
@percentage = hash['percentage']
|
290
|
-
@time = Types::Global::GlobalTime.new(hash['time'])
|
291
|
-
@total_time = Types::Global::GlobalTime.new(hash['totaltime'])
|
308
|
+
new(hash['percentage'], time, total_time)
|
292
309
|
end
|
293
310
|
|
294
|
-
def
|
295
|
-
|
311
|
+
def initialize(percentage, time, total_time)
|
312
|
+
@percentage = percentage
|
313
|
+
@time = time
|
314
|
+
@total_time = total_time
|
296
315
|
end
|
297
316
|
end
|
298
317
|
end
|
@@ -20,13 +20,20 @@ module KodiClient
|
|
20
20
|
class DetailsProfile
|
21
21
|
include Comparable
|
22
22
|
include Items::ItemDetailsBase
|
23
|
+
extend Creatable
|
23
24
|
|
24
25
|
attr_reader :lock_mode, :thumbnail
|
25
26
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def self.create(hash)
|
28
|
+
return nil if hash.nil?
|
29
|
+
|
30
|
+
new(*Creatable.hash_to_arr(hash, %w[lock_mode thumbnail label]))
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(lock_mode, thumbnail, label)
|
34
|
+
@lock_mode = lock_mode
|
35
|
+
@thumbnail = thumbnail
|
36
|
+
item_details_base(label)
|
30
37
|
end
|
31
38
|
|
32
39
|
def ==(other)
|
@@ -37,22 +44,29 @@ module KodiClient
|
|
37
44
|
# return type for Profiles.GetProfiles
|
38
45
|
class GetProfilesReturned
|
39
46
|
include Comparable
|
47
|
+
extend Creatable
|
40
48
|
|
41
49
|
attr_reader :limits, :profiles
|
42
50
|
|
43
|
-
def
|
44
|
-
|
45
|
-
|
51
|
+
def self.create(hash)
|
52
|
+
return nil if hash.nil?
|
53
|
+
|
54
|
+
limits = Types::List::ListLimitsReturned.create(hash['limits'])
|
55
|
+
profiles = Types::Profiles::DetailsProfile.create_list(hash['profiles'])
|
56
|
+
|
57
|
+
new(limits, profiles)
|
46
58
|
end
|
47
59
|
|
48
|
-
def
|
49
|
-
|
60
|
+
def initialize(limits, profiles)
|
61
|
+
@limits = limits
|
62
|
+
@profiles = profiles
|
50
63
|
end
|
51
64
|
end
|
52
65
|
|
53
66
|
# Profiles.Password https://kodi.wiki/view/JSON-RPC_API/v12#Profiles.Password
|
54
67
|
class ProfilePassword
|
55
68
|
include Comparable
|
69
|
+
extend Creatable
|
56
70
|
|
57
71
|
attr_reader :value, :encryption
|
58
72
|
|
@@ -60,10 +74,6 @@ module KodiClient
|
|
60
74
|
@value = value
|
61
75
|
@encryption = encryption
|
62
76
|
end
|
63
|
-
|
64
|
-
def ==(other)
|
65
|
-
compare(self, other)
|
66
|
-
end
|
67
77
|
end
|
68
78
|
end
|
69
79
|
end
|
@@ -20,18 +20,15 @@ module KodiClient
|
|
20
20
|
# System.Property.Value https://kodi.wiki/view/JSON-RPC_API/v12#System.Property.Value
|
21
21
|
class PropertyValue
|
22
22
|
include Comparable
|
23
|
+
extend Creatable
|
23
24
|
|
24
25
|
attr_reader :can_hibernate, :can_reboot, :can_shutdown, :can_suspend
|
25
26
|
|
26
|
-
def initialize(
|
27
|
-
@can_hibernate =
|
28
|
-
@can_reboot =
|
29
|
-
@can_shutdown =
|
30
|
-
@can_suspend =
|
31
|
-
end
|
32
|
-
|
33
|
-
def ==(other)
|
34
|
-
compare(self, other)
|
27
|
+
def initialize(can_hibernate, can_reboot, can_shutdown, can_suspend)
|
28
|
+
@can_hibernate = can_hibernate
|
29
|
+
@can_reboot = can_reboot
|
30
|
+
@can_shutdown = can_shutdown
|
31
|
+
@can_suspend = can_suspend
|
35
32
|
end
|
36
33
|
end
|
37
34
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'kodi_client/global_types/media_types'
|
4
4
|
require 'kodi_client/global_types/player_type'
|
5
5
|
require 'kodi_client/util/comparable'
|
6
|
+
require 'kodi_client/util/creatable'
|
6
7
|
|
7
8
|
module KodiClient
|
8
9
|
module Types
|
@@ -14,28 +15,30 @@ module KodiClient
|
|
14
15
|
|
15
16
|
attr_reader :art, :play_count
|
16
17
|
|
17
|
-
def
|
18
|
-
@art = Types::Media::MediaArtwork.
|
19
|
-
|
20
|
-
|
18
|
+
def video_details_base_by_hash(hash)
|
19
|
+
@art = Types::Media::MediaArtwork.create(hash['art'])
|
20
|
+
video_details_base(art, ['playcount'], *Creatable.hash_to_arr(hash, %w[fan_art thumbnail label]))
|
21
|
+
end
|
22
|
+
|
23
|
+
def video_details_base(art, play_count, fan_art, thumbnail, label)
|
24
|
+
@art = art
|
25
|
+
@play_count = play_count
|
26
|
+
media_details_base(fan_art, thumbnail, label)
|
21
27
|
end
|
22
28
|
end
|
23
29
|
|
24
30
|
# Video.Cast https://kodi.wiki/view/JSON-RPC_API/v12#Video.Cast
|
25
31
|
class VideoCast
|
26
32
|
include Comparable
|
33
|
+
extend Creatable
|
27
34
|
|
28
35
|
attr_reader :name, :order, :role, :thumbnail
|
29
36
|
|
30
|
-
def initialize(
|
31
|
-
@name =
|
32
|
-
@order =
|
33
|
-
@role =
|
34
|
-
@thumbnail =
|
35
|
-
end
|
36
|
-
|
37
|
-
def ==(other)
|
38
|
-
compare(self, other)
|
37
|
+
def initialize(name, order, role, thumbnail)
|
38
|
+
@name = name
|
39
|
+
@order = order
|
40
|
+
@role = role
|
41
|
+
@thumbnail = thumbnail
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
@@ -45,9 +48,14 @@ module KodiClient
|
|
45
48
|
|
46
49
|
attr_reader :title
|
47
50
|
|
48
|
-
def
|
49
|
-
|
50
|
-
|
51
|
+
def video_details_media_by_hash(hash)
|
52
|
+
art = Types::Media::MediaArtwork.create(hash['art'])
|
53
|
+
video_details_media(hash['title'], art, *Creatable.hash_to_arr(hash, %w[play_count fan_art thumbnail label]))
|
54
|
+
end
|
55
|
+
|
56
|
+
def video_details_media(title, art, play_count, fan_art, thumbnail, label)
|
57
|
+
@title = title
|
58
|
+
video_details_base(art, play_count, fan_art, thumbnail, label)
|
51
59
|
end
|
52
60
|
end
|
53
61
|
|
@@ -57,12 +65,18 @@ module KodiClient
|
|
57
65
|
|
58
66
|
attr_reader :date_added, :file, :last_played, :plot
|
59
67
|
|
60
|
-
def
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
68
|
+
def video_details_item_by_hash(hash)
|
69
|
+
art = Types::Media::MediaArtwork.create(hash['art'])
|
70
|
+
video_details_item(*Creatable.hash_to_arr(hash, %w[date_added file last_played plot title]), art,
|
71
|
+
*Creatable.hash_to_arr(hash, %w[play_count fan_art thumbnail label]))
|
72
|
+
end
|
73
|
+
|
74
|
+
def video_details_item(date_added, file, last_played, plot, title, art, play_count, fan_art, thumbnail, label)
|
75
|
+
@date_added = date_added
|
76
|
+
@file = file
|
77
|
+
@last_played = last_played
|
78
|
+
@plot = plot
|
79
|
+
video_details_media(title, art, play_count, fan_art, thumbnail, label)
|
66
80
|
end
|
67
81
|
end
|
68
82
|
|
@@ -72,45 +86,56 @@ module KodiClient
|
|
72
86
|
|
73
87
|
attr_reader :director, :resume, :runtime, :stream_details
|
74
88
|
|
75
|
-
def
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
89
|
+
def video_details_file_by_hash(hash)
|
90
|
+
resume = VideoResume.create(hash['resume'])
|
91
|
+
stream_details = Streams.create(hash['streamdetails'])
|
92
|
+
art = Types::Media::MediaArtwork.create(hash['art'])
|
93
|
+
video_details_file(hash['director'], resume, hash['runtime'], stream_details,
|
94
|
+
*Creatable.hash_to_arr(hash, %w[date_added file last_played plot title]), art,
|
95
|
+
*Creatable.hash_to_arr(hash, %w[play_count fan_art thumbnail label]))
|
96
|
+
end
|
97
|
+
|
98
|
+
def video_details_file(director, resume, runtime, stream_details, date_added, file, last_played, plot, title,
|
99
|
+
art, play_count, fan_art, thumbnail, label)
|
100
|
+
@director = director
|
101
|
+
@resume = resume
|
102
|
+
@runtime = runtime
|
103
|
+
@stream_details = stream_details
|
104
|
+
video_details_item(date_added, file, last_played, plot, title, art, play_count, fan_art, thumbnail, label)
|
81
105
|
end
|
82
106
|
end
|
83
107
|
|
84
108
|
# Video.Resume https://kodi.wiki/view/JSON-RPC_API/v12#Video.Resume
|
85
109
|
class VideoResume
|
86
110
|
include Comparable
|
111
|
+
extend Creatable
|
87
112
|
|
88
113
|
attr_reader :position, :total
|
89
114
|
|
90
|
-
def initialize(
|
91
|
-
@position =
|
92
|
-
@total =
|
93
|
-
end
|
94
|
-
|
95
|
-
def ==(other)
|
96
|
-
compare(self, other)
|
115
|
+
def initialize(position, total)
|
116
|
+
@position = position
|
117
|
+
@total = total
|
97
118
|
end
|
98
119
|
end
|
99
120
|
|
100
121
|
# Video.Streams https://kodi.wiki/view/JSON-RPC_API/v12#Video.Streams
|
101
122
|
class Streams
|
102
123
|
include Comparable
|
124
|
+
extend Creatable
|
103
125
|
|
104
126
|
attr_reader :audio, :subtitle, :video
|
105
127
|
|
106
|
-
def
|
107
|
-
|
108
|
-
|
109
|
-
|
128
|
+
def self.create(hash)
|
129
|
+
audio = Types::Player::AudioStream.create_list(hash['audio'])
|
130
|
+
subtitle = Types::Player::Subtitle.create_list(hash['subtitle'])
|
131
|
+
video = Types::Player::VideoStream.create_list(hash['video'])
|
132
|
+
new(audio, subtitle, video)
|
110
133
|
end
|
111
134
|
|
112
|
-
def
|
113
|
-
|
135
|
+
def initialize(audio, subtitle, video)
|
136
|
+
@audio = audio
|
137
|
+
@subtitle = subtitle
|
138
|
+
@video = video
|
114
139
|
end
|
115
140
|
end
|
116
141
|
end
|
@@ -28,8 +28,7 @@ module KodiClient
|
|
28
28
|
'installed' => installed.nil? || !installed ? 'all' : 'installed'
|
29
29
|
})
|
30
30
|
json = invoke_api(request)
|
31
|
-
|
32
|
-
result = json['result'].nil? ? nil : Types::Addons::Addons.new(json['result'])
|
31
|
+
result = Types::Addons::Addons.create(json['result'])
|
33
32
|
json['result'] = result
|
34
33
|
KodiResponse.new(json)
|
35
34
|
end
|
@@ -42,7 +41,7 @@ module KodiClient
|
|
42
41
|
})
|
43
42
|
json = invoke_api(request)
|
44
43
|
|
45
|
-
result =
|
44
|
+
result = Types::Addons::Addon.create(json['result'])
|
46
45
|
json['result'] = result
|
47
46
|
KodiResponse.new(json)
|
48
47
|
end
|
@@ -28,7 +28,7 @@ module KodiClient
|
|
28
28
|
def get_properties(properties = Types::Application::PropertyName.all_properties, kodi_id = 1)
|
29
29
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
|
30
30
|
json = invoke_api(request)
|
31
|
-
result =
|
31
|
+
result = Types::Application::PropertyValue.create(json['result'])
|
32
32
|
json['result'] = result
|
33
33
|
KodiResponse.new(json)
|
34
34
|
end
|
@@ -28,7 +28,7 @@ module KodiClient
|
|
28
28
|
params['type'] = type unless type.nil?
|
29
29
|
request = KodiRequest.new(kodi_id, GET_FAVOURITES, params)
|
30
30
|
json = invoke_api(request)
|
31
|
-
result =
|
31
|
+
result = Types::Favourites::GetFavouriteReturned.create(json['result'])
|
32
32
|
json['result'] = result
|
33
33
|
KodiResponse.new(json)
|
34
34
|
end
|
@@ -24,7 +24,7 @@ module KodiClient
|
|
24
24
|
def get_properties(properties = Types::GUI::PropertyName.all_properties, kodi_id = 1)
|
25
25
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
|
26
26
|
json = invoke_api(request)
|
27
|
-
result =
|
27
|
+
result = KodiClient::Types::GUI::PropertyValue.create(json['result'])
|
28
28
|
json['result'] = result
|
29
29
|
KodiResponse.new(json)
|
30
30
|
end
|
@@ -32,7 +32,7 @@ module KodiClient
|
|
32
32
|
def get_stereoscopic_modes(kodi_id = 1)
|
33
33
|
request = KodiRequest.new(kodi_id, GET_STEREOSCOPIC_MODES, {})
|
34
34
|
json = invoke_api(request)
|
35
|
-
result =
|
35
|
+
result = Types::GUI::StereoscopyMode.create_list(json['result']['stereoscopicmodes'])
|
36
36
|
json['result'] = result
|
37
37
|
KodiResponse.new(json)
|
38
38
|
end
|