kodi_client 0.5.5 → 0.6.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 +4 -4
- data/README.md +2 -1
- data/kodi_client.gemspec +3 -3
- data/lib/kodi_client/Chainable.rb +3 -1
- data/lib/kodi_client/global_types/addon_types.rb +50 -52
- data/lib/kodi_client/global_types/application_types.rb +21 -23
- data/lib/kodi_client/global_types/audio_types.rb +179 -29
- data/lib/kodi_client/global_types/favourites_types.rb +14 -17
- data/lib/kodi_client/global_types/files_types.rb +68 -0
- data/lib/kodi_client/global_types/global_types.rb +18 -24
- data/lib/kodi_client/global_types/gui_types.rb +15 -16
- data/lib/kodi_client/global_types/item_types.rb +10 -2
- data/lib/kodi_client/global_types/list_types.rb +326 -98
- data/lib/kodi_client/global_types/media_types.rb +21 -13
- data/lib/kodi_client/global_types/player_type.rb +110 -110
- data/lib/kodi_client/global_types/profiles_types.rb +14 -14
- data/lib/kodi_client/global_types/system_types.rb +7 -9
- data/lib/kodi_client/global_types/video_types.rb +80 -43
- data/lib/kodi_client/method/addons.rb +7 -19
- data/lib/kodi_client/method/application.rb +1 -1
- data/lib/kodi_client/method/audio_library.rb +49 -0
- data/lib/kodi_client/method/favourites.rb +1 -1
- data/lib/kodi_client/method/files.rb +89 -0
- 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 +106 -0
- data/lib/kodi_client.rb +10 -22
- metadata +9 -5
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'kodi_client/util/comparable'
|
4
4
|
require 'kodi_client/util/iterable'
|
5
|
+
require 'kodi_client/util/creatable'
|
5
6
|
|
6
7
|
module KodiClient
|
7
8
|
module Types
|
@@ -9,7 +10,7 @@ module KodiClient
|
|
9
10
|
|
10
11
|
# Global.Toggle https://kodi.wiki/view/JSON-RPC_API/v12#Global.Toggle
|
11
12
|
module Toggle
|
12
|
-
|
13
|
+
extend Iterable
|
13
14
|
|
14
15
|
TOGGLE = 'toggle'
|
15
16
|
TRUE = true
|
@@ -55,48 +56,41 @@ module KodiClient
|
|
55
56
|
# id/label type
|
56
57
|
class IdLabel
|
57
58
|
include Comparable
|
58
|
-
|
59
|
+
extend Creatable
|
59
60
|
|
60
|
-
|
61
|
-
@id = hash['id']
|
62
|
-
@label = hash['label']
|
63
|
-
end
|
61
|
+
attr_reader :id, :label
|
64
62
|
|
65
|
-
def
|
66
|
-
|
63
|
+
def initialize(id, label)
|
64
|
+
@id = id
|
65
|
+
@label = label
|
67
66
|
end
|
68
67
|
end
|
69
68
|
|
70
69
|
# id/name type
|
71
70
|
class IdName
|
72
71
|
include Comparable
|
73
|
-
|
72
|
+
extend Creatable
|
74
73
|
|
75
|
-
|
76
|
-
@id = hash['id']
|
77
|
-
@name = hash['name']
|
78
|
-
end
|
74
|
+
attr_reader :id, :name
|
79
75
|
|
80
|
-
def
|
81
|
-
|
76
|
+
def initialize(id, name)
|
77
|
+
@id = id
|
78
|
+
@name = name
|
82
79
|
end
|
83
80
|
end
|
84
81
|
|
85
82
|
# Global.Time https://kodi.wiki/view/JSON-RPC_API/v12#Global.Time
|
86
83
|
class GlobalTime
|
87
84
|
include Comparable
|
85
|
+
extend Creatable
|
88
86
|
|
89
87
|
attr_reader :hours, :minutes, :seconds, :milliseconds
|
90
88
|
|
91
|
-
def initialize(
|
92
|
-
@hours =
|
93
|
-
@minutes =
|
94
|
-
@seconds =
|
95
|
-
@milliseconds =
|
96
|
-
end
|
97
|
-
|
98
|
-
def ==(other)
|
99
|
-
compare(self, other)
|
89
|
+
def initialize(hours, minutes, seconds, milliseconds)
|
90
|
+
@hours = hours
|
91
|
+
@minutes = minutes
|
92
|
+
@seconds = seconds
|
93
|
+
@milliseconds = milliseconds
|
100
94
|
end
|
101
95
|
end
|
102
96
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'kodi_client/global_types/global_types'
|
4
4
|
require 'kodi_client/util/comparable'
|
5
5
|
require 'kodi_client/util/iterable'
|
6
|
+
require 'kodi_client/util/creatable'
|
6
7
|
|
7
8
|
module KodiClient
|
8
9
|
module Types
|
@@ -10,6 +11,7 @@ module KodiClient
|
|
10
11
|
|
11
12
|
# GUI.Window https://kodi.wiki/view/JSON-RPC_API/v12#GUI.Window
|
12
13
|
module GUIWindow
|
14
|
+
extend Iterable
|
13
15
|
|
14
16
|
ACCESSPOINTS = 'accesspoints'
|
15
17
|
ADDON = 'addon'
|
@@ -139,6 +141,7 @@ module KodiClient
|
|
139
141
|
class StereoscopyMode
|
140
142
|
include Comparable
|
141
143
|
include Iterable
|
144
|
+
extend Creatable
|
142
145
|
|
143
146
|
attr_reader :label, :mode
|
144
147
|
|
@@ -152,32 +155,28 @@ module KodiClient
|
|
152
155
|
ANAGLYPH_YELLOW_BLUE = 'anaglyph_yellow_blue'
|
153
156
|
MONSCOPIC = 'monoscopic'
|
154
157
|
|
155
|
-
def initialize(
|
156
|
-
@label =
|
157
|
-
@mode =
|
158
|
-
end
|
159
|
-
|
160
|
-
def ==(other)
|
161
|
-
compare(self, other)
|
158
|
+
def initialize(label, mode)
|
159
|
+
@label = label
|
160
|
+
@mode = mode
|
162
161
|
end
|
163
162
|
end
|
164
163
|
|
165
164
|
# GUI.Property.Value https://kodi.wiki/view/JSON-RPC_API/v12#GUI.Property.Value
|
166
165
|
class PropertyValue
|
167
166
|
include Comparable
|
167
|
+
extend Creatable
|
168
168
|
|
169
169
|
attr_reader :current_control, :current_window, :fullscreen, :skin, :stereoscopic_mode
|
170
170
|
|
171
|
-
|
172
|
-
|
173
|
-
@current_window = Global::IdLabel.new(hash['currentwindow'])
|
174
|
-
@fullscreen = hash['fullscreen']
|
175
|
-
@skin = Global::IdName.new(hash['skin'])
|
176
|
-
@stereoscopic_mode = StereoscopyMode.new(hash['stereoscopicmode'])
|
177
|
-
end
|
171
|
+
type_mapping ['currentcontrol', Global::IdLabel], ['currentwindow', Global::IdLabel],
|
172
|
+
['skin', Global::IdName], ['stereoscopicmode', StereoscopyMode]
|
178
173
|
|
179
|
-
def
|
180
|
-
|
174
|
+
def initialize(current_control, current_window, fullscreen, skin, stereoscopic_mode)
|
175
|
+
@current_control = current_control
|
176
|
+
@current_window = current_window
|
177
|
+
@fullscreen = fullscreen
|
178
|
+
@skin = skin
|
179
|
+
@stereoscopic_mode = stereoscopic_mode
|
181
180
|
end
|
182
181
|
end
|
183
182
|
end
|
@@ -9,8 +9,16 @@ module KodiClient
|
|
9
9
|
|
10
10
|
attr_reader :label
|
11
11
|
|
12
|
-
def
|
13
|
-
|
12
|
+
def item_details_base_mappings
|
13
|
+
{}
|
14
|
+
end
|
15
|
+
|
16
|
+
def item_details_base_by_hash(hash)
|
17
|
+
item_details_base(*Creatable.hash_to_arr(hash, %w[label], item_details_base_mappings))
|
18
|
+
end
|
19
|
+
|
20
|
+
def item_details_base(label)
|
21
|
+
@label = label
|
14
22
|
end
|
15
23
|
end
|
16
24
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'kodi_client/util/comparable'
|
4
|
+
require 'kodi_client/util/creatable'
|
5
|
+
require 'kodi_client/util/iterable'
|
4
6
|
require 'kodi_client/global_types/video_types'
|
5
7
|
require 'kodi_client/global_types/audio_types'
|
6
8
|
|
@@ -18,26 +20,21 @@ module KodiClient
|
|
18
20
|
@list_start = list_start
|
19
21
|
@list_end = list_end
|
20
22
|
end
|
21
|
-
|
22
|
-
def ==(other)
|
23
|
-
compare(self, other)
|
24
|
-
end
|
25
23
|
end
|
26
24
|
|
27
25
|
# List.LimitsReturned https://kodi.wiki/view/JSON-RPC_API/v12#List.LimitsReturned
|
28
26
|
class ListLimitsReturned
|
29
27
|
include Comparable
|
28
|
+
extend Creatable
|
30
29
|
|
31
30
|
attr_reader :list_start, :list_end, :total
|
32
31
|
|
33
|
-
|
34
|
-
@list_start = hash['start']
|
35
|
-
@list_end = hash['end']
|
36
|
-
@total = hash['total']
|
37
|
-
end
|
32
|
+
fields_to_map %w[start end total]
|
38
33
|
|
39
|
-
def
|
40
|
-
|
34
|
+
def initialize(list_start, list_end, total)
|
35
|
+
@list_start = list_start
|
36
|
+
@list_end = list_end
|
37
|
+
@total = total
|
41
38
|
end
|
42
39
|
end
|
43
40
|
|
@@ -56,16 +53,12 @@ module KodiClient
|
|
56
53
|
attr_reader :ignore_article, :method, :order, :use_artist_sort_name
|
57
54
|
|
58
55
|
def initialize(ignore_article = false, method = ListSortMethod::NONE,
|
59
|
-
|
56
|
+
sort_order = SortOrder::ASCENDING, use_artist_sort_name = false)
|
60
57
|
@ignore_article = ignore_article
|
61
58
|
@method = method
|
62
|
-
@order =
|
59
|
+
@order = sort_order
|
63
60
|
@use_artist_sort_name = use_artist_sort_name
|
64
61
|
end
|
65
|
-
|
66
|
-
def ==(other)
|
67
|
-
compare(self, other)
|
68
|
-
end
|
69
62
|
end
|
70
63
|
|
71
64
|
# List.Fields.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.All
|
@@ -157,6 +150,95 @@ module KodiClient
|
|
157
150
|
YEAR = 'year'
|
158
151
|
end
|
159
152
|
|
153
|
+
# List.Fields.Files https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.Files
|
154
|
+
module ListFieldFiles
|
155
|
+
extend Iterable
|
156
|
+
|
157
|
+
ALBUM = 'album'
|
158
|
+
ALBUMARTIST = 'albumartist'
|
159
|
+
ALBUMARTISTID = 'albumartistid'
|
160
|
+
ALBUMID = 'albumid'
|
161
|
+
ALBUMLABEL = 'albumlabel'
|
162
|
+
ART = 'art'
|
163
|
+
ARTIST = 'artist'
|
164
|
+
ARTISTID = 'artistid'
|
165
|
+
CAST = 'cast'
|
166
|
+
COMMENT = 'comment'
|
167
|
+
COUNTRY = 'country'
|
168
|
+
DATEADDED = 'dateadded'
|
169
|
+
DESCRIPTION = 'description'
|
170
|
+
DIRECTOR = 'director'
|
171
|
+
DISC = 'disc'
|
172
|
+
DISPLAYARTIST = 'displayartist'
|
173
|
+
DURATION = 'duration'
|
174
|
+
EPISODE = 'episode'
|
175
|
+
EPISODEGUIDE = 'episodeguide'
|
176
|
+
FANART = 'fanart'
|
177
|
+
FILE = 'file'
|
178
|
+
FIRSTAIRED = 'firstaired'
|
179
|
+
GENRE = 'genre'
|
180
|
+
GENREID = 'genreid'
|
181
|
+
IMDBNUMBER = 'imdbnumber'
|
182
|
+
LASTMODIFIED = 'lastmodified'
|
183
|
+
LASTPLAYED = 'lastplayed'
|
184
|
+
LYRICS = 'lyrics'
|
185
|
+
MIMETYPE = 'mimetype'
|
186
|
+
MOOD = 'mood'
|
187
|
+
MPAA = 'mpaa'
|
188
|
+
MUSICBRAINZALBUMARTISTID = 'musicbrainzalbumartistid'
|
189
|
+
MUSICBRAINZALBUMID = 'musicbrainzalbumid'
|
190
|
+
MUSICBRAINZARTISTID = 'musicbrainzartistid'
|
191
|
+
MUSICBRAINZTRACKID = 'musicbrainztrackid'
|
192
|
+
ORIGINALTITLE = 'originaltitle'
|
193
|
+
PLAYCOUNT = 'playcount'
|
194
|
+
PLOT = 'plot'
|
195
|
+
PLOTOUTLINE = 'plotoutline'
|
196
|
+
PREMIERED = 'premiered'
|
197
|
+
PRODUCTIONCODE = 'productioncode'
|
198
|
+
RATING = 'rating'
|
199
|
+
RESUME = 'resume'
|
200
|
+
RUNTIME = 'runtime'
|
201
|
+
SEASON = 'season'
|
202
|
+
SET = 'set'
|
203
|
+
SETID = 'setid'
|
204
|
+
SHOWLINK = 'showlink'
|
205
|
+
SHOWTITLE = 'showtitle'
|
206
|
+
SIZE = 'size'
|
207
|
+
SORTTITLE = 'sorttitle'
|
208
|
+
SPECIALSORTEPISODE = 'specialsortepisode'
|
209
|
+
SPECIALSORTSEASON = 'specialsortseason'
|
210
|
+
STREAMDETAILS = 'streamdetails'
|
211
|
+
STUDIO = 'studio'
|
212
|
+
STYLE = 'style'
|
213
|
+
TAG = 'tag'
|
214
|
+
TAGLINE = 'tagline'
|
215
|
+
THEME = 'theme'
|
216
|
+
THUMBNAIL = 'thumbnail'
|
217
|
+
TITLE = 'title'
|
218
|
+
TOP250 = 'top250'
|
219
|
+
TRACK = 'track'
|
220
|
+
TRAILER = 'trailer'
|
221
|
+
TVSHOWID = 'tvshowid'
|
222
|
+
UNIQUEID = 'uniqueid'
|
223
|
+
VOTES = 'votes'
|
224
|
+
WATCHEDEPISODES = 'watchedepisodes'
|
225
|
+
WRITER = 'writer'
|
226
|
+
YEAR = 'year'
|
227
|
+
end
|
228
|
+
|
229
|
+
# File/Label tuple
|
230
|
+
class FileLabel
|
231
|
+
include Comparable
|
232
|
+
extend Creatable
|
233
|
+
|
234
|
+
attr_reader :file, :label
|
235
|
+
|
236
|
+
def initialize(file, label)
|
237
|
+
@file = file
|
238
|
+
@label = label
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
160
242
|
# List.Item.Base https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.Base
|
161
243
|
module ListItemBase
|
162
244
|
include Video::VideoDetailsFile
|
@@ -172,75 +254,119 @@ module KodiClient
|
|
172
254
|
:special_sort_season, :studio, :style, :tag, :tag_line, :theme, :top250, :total_discs, :track,
|
173
255
|
:trailer, :tv_show_id, :type, :unique_id, :votes, :watched_episodes, :writer
|
174
256
|
|
175
|
-
def
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
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
|
-
@
|
230
|
-
@
|
231
|
-
@
|
232
|
-
@
|
233
|
-
@
|
234
|
-
@
|
235
|
-
@
|
236
|
-
@
|
237
|
-
@
|
238
|
-
@
|
239
|
-
@
|
240
|
-
@
|
241
|
-
@
|
242
|
-
|
243
|
-
|
257
|
+
def list_item_base_mappings
|
258
|
+
mappings = {
|
259
|
+
'cast' => Creatable::CreateMap.new(Video::VideoCast, true),
|
260
|
+
'contributors' => Creatable::CreateMap.new(Audio::AudioContributor, true),
|
261
|
+
'resume' => Creatable::CreateMap.new(Video::VideoResume),
|
262
|
+
'streamdetails' => Creatable::CreateMap.new(Video::Streams),
|
263
|
+
'art' => Creatable::CreateMap.new(Media::MediaArtwork)
|
264
|
+
}
|
265
|
+
mappings.merge(video_details_file_mappings).merge(audio_details_media_mappings)
|
266
|
+
end
|
267
|
+
|
268
|
+
def list_item_base_by_hash(hash)
|
269
|
+
return nil if hash.nil?
|
270
|
+
|
271
|
+
list_item_base(*Creatable.hash_to_arr(
|
272
|
+
hash, %w[album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
273
|
+
bpm cast channels comment compilation contributors country description disc
|
274
|
+
disc_title display_composer display_conductor display_lyricist display_orchestra
|
275
|
+
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
276
|
+
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
277
|
+
original_title plot_outline premiered production_code release_date release_type
|
278
|
+
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
279
|
+
special_sort_season studio style tag tag_line theme top250 total_discs track
|
280
|
+
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
281
|
+
runtime stream_details date_added file last_played plot title art play_count
|
282
|
+
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
283
|
+
rating sort_artist user_rating year genre], list_item_base_mappings
|
284
|
+
))
|
285
|
+
end
|
286
|
+
|
287
|
+
def list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
288
|
+
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
289
|
+
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
290
|
+
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
291
|
+
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
292
|
+
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
293
|
+
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
294
|
+
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
295
|
+
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
296
|
+
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
297
|
+
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
298
|
+
rating, sort_artist, user_rating, year, genre)
|
299
|
+
@album = album
|
300
|
+
@album_artist = album_artist
|
301
|
+
@album_artist_id = album_artist_id
|
302
|
+
@album_id = album_id
|
303
|
+
@album_release_type = album_release_type
|
304
|
+
@album_status = album_status
|
305
|
+
@bit_rate = bit_rate
|
306
|
+
@bpm = bpm
|
307
|
+
@cast = cast
|
308
|
+
@channels = channels
|
309
|
+
@comment = comment
|
310
|
+
@compilation = compilation
|
311
|
+
@contributors = contributors
|
312
|
+
@country = country
|
313
|
+
@description = description
|
314
|
+
@disc = disc
|
315
|
+
@disc_title = disc_title
|
316
|
+
@display_composer = display_composer
|
317
|
+
@display_conductor = display_conductor
|
318
|
+
@display_lyricist = display_lyricist
|
319
|
+
@display_orchestra = display_orchestra
|
320
|
+
@duration = duration
|
321
|
+
@dyn_path = dyn_path
|
322
|
+
@episode = episode
|
323
|
+
@episode_guide = episode_guide
|
324
|
+
@first_aired = first_aired
|
325
|
+
@id = id
|
326
|
+
@imdb_number = imdb_number
|
327
|
+
@is_box_set = is_box_set
|
328
|
+
@lyrics = lyrics
|
329
|
+
@media_path = media_path
|
330
|
+
@mood = mood
|
331
|
+
@mpaa = mpaa
|
332
|
+
@musicbrainz_artist_id = musicbrainz_artist_id
|
333
|
+
@musicbrainz_track_id = musicbrainz_track_id
|
334
|
+
@original_date = original_date
|
335
|
+
@original_title = original_title
|
336
|
+
@plot_outline = plot_outline
|
337
|
+
@premiered = premiered
|
338
|
+
@production_code = production_code
|
339
|
+
@release_date = release_date
|
340
|
+
@release_type = release_type
|
341
|
+
@sample_rate = sample_rate
|
342
|
+
@season = season
|
343
|
+
@set = set
|
344
|
+
@set_id = set_id
|
345
|
+
@show_link = show_link
|
346
|
+
@show_title = show_title
|
347
|
+
@sort_title = sort_title
|
348
|
+
@special_sort_episode = special_sort_episode
|
349
|
+
@special_sort_season = special_sort_season
|
350
|
+
@studio = studio
|
351
|
+
@style = style
|
352
|
+
@tag = tag
|
353
|
+
@tag_line = tag_line
|
354
|
+
@theme = theme
|
355
|
+
@top250 = top250
|
356
|
+
@total_discs = total_discs
|
357
|
+
@track = track
|
358
|
+
@trailer = trailer
|
359
|
+
@tv_show_id = tv_show_id
|
360
|
+
@type = type
|
361
|
+
@unique_id = unique_id
|
362
|
+
@votes = votes
|
363
|
+
@watched_episodes = watched_episodes
|
364
|
+
@writer = writer
|
365
|
+
video_details_file(director, resume, runtime, stream_details, date_added, file, last_played, plot, title,
|
366
|
+
art, play_count, fan_art, thumbnail, label)
|
367
|
+
audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date, rating,
|
368
|
+
release_date, sort_artist, title, user_rating, votes, year, art, date_added, genre,
|
369
|
+
fan_art, thumbnail, label)
|
244
370
|
end
|
245
371
|
end
|
246
372
|
|
@@ -248,24 +374,126 @@ module KodiClient
|
|
248
374
|
class ListItemAll
|
249
375
|
include ListItemBase
|
250
376
|
include Comparable
|
377
|
+
extend Creatable
|
378
|
+
extend ListItemBase
|
251
379
|
|
252
380
|
attr_reader :channel, :channel_number, :channel_type, :end_time, :hidden, :locked, :start_time,
|
253
381
|
:sub_channel_number
|
254
382
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
383
|
+
fields_to_map %w[channel channel_number channel_type end_time hidden locked start_time sub_channel_number
|
384
|
+
album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
385
|
+
bpm cast channels comment compilation contributors country description disc
|
386
|
+
disc_title display_composer display_conductor display_lyricist display_orchestra
|
387
|
+
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
388
|
+
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
389
|
+
original_title plot_outline premiered production_code release_date release_type
|
390
|
+
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
391
|
+
special_sort_season studio style tag tag_line theme top250 total_discs track
|
392
|
+
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
393
|
+
runtime stream_details date_added file last_played plot title art play_count
|
394
|
+
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
395
|
+
rating sort_artist user_rating year genre]
|
396
|
+
|
397
|
+
def self.lazy_type_mapping
|
398
|
+
list_item_base_mappings
|
399
|
+
end
|
400
|
+
|
401
|
+
def initialize(channel, channel_number, channel_type, end_time, hidden, locked, start_time, sub_channel_number,
|
402
|
+
album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
403
|
+
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
404
|
+
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
405
|
+
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
406
|
+
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
407
|
+
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
408
|
+
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
409
|
+
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
410
|
+
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
411
|
+
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
412
|
+
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
413
|
+
rating, sort_artist, user_rating, year, genre)
|
414
|
+
@channel = channel
|
415
|
+
@channel_number = channel_number
|
416
|
+
@channel_type = channel_type
|
417
|
+
@end_time = end_time
|
418
|
+
@hidden = hidden
|
419
|
+
@locked = locked
|
420
|
+
@start_time = start_time
|
421
|
+
@sub_channel_number = sub_channel_number
|
422
|
+
type = type.nil? ? 'unknown' : type
|
423
|
+
|
424
|
+
list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
425
|
+
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
426
|
+
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
427
|
+
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
428
|
+
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
429
|
+
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
430
|
+
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
431
|
+
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
432
|
+
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
433
|
+
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
434
|
+
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
435
|
+
rating, sort_artist, user_rating, year, genre)
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
# List.Item.File https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.File
|
440
|
+
class ListItemFile
|
441
|
+
include ListItemBase
|
442
|
+
include Comparable
|
443
|
+
extend Creatable
|
444
|
+
extend ListItemBase
|
445
|
+
|
446
|
+
attr_reader :file, :file_type, :last_modified, :mime_type, :size
|
447
|
+
|
448
|
+
fields_to_map %w[file_type last_modified mime_type size
|
449
|
+
album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
450
|
+
bpm cast channels comment compilation contributors country description disc
|
451
|
+
disc_title display_composer display_conductor display_lyricist display_orchestra
|
452
|
+
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
453
|
+
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
454
|
+
original_title plot_outline premiered production_code release_date release_type
|
455
|
+
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
456
|
+
special_sort_season studio style tag tag_line theme top250 total_discs track
|
457
|
+
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
458
|
+
runtime stream_details date_added file last_played plot title art play_count
|
459
|
+
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
460
|
+
rating sort_artist user_rating year genre]
|
461
|
+
|
462
|
+
def self.lazy_type_mapping
|
463
|
+
list_item_base_mappings
|
265
464
|
end
|
266
465
|
|
267
|
-
def
|
268
|
-
|
466
|
+
def initialize(file_type, last_modified, mime_type, size,
|
467
|
+
album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
468
|
+
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
469
|
+
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
470
|
+
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
471
|
+
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
472
|
+
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
473
|
+
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
474
|
+
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
475
|
+
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
476
|
+
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
477
|
+
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
478
|
+
rating, sort_artist, user_rating, year, genre)
|
479
|
+
@file = file
|
480
|
+
@file_type = file_type
|
481
|
+
@last_modified = last_modified
|
482
|
+
@mime_type = mime_type
|
483
|
+
@size = size
|
484
|
+
type = type.nil? ? 'unknown' : type
|
485
|
+
list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
486
|
+
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
487
|
+
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
488
|
+
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
489
|
+
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
490
|
+
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
491
|
+
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
492
|
+
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
493
|
+
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
494
|
+
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
495
|
+
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
496
|
+
rating, sort_artist, user_rating, year, genre)
|
269
497
|
end
|
270
498
|
end
|
271
499
|
|