kodi_client 0.6.3 → 0.6.4
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/.rubocop.yml +2 -0
- data/kodi_client.gemspec +1 -1
- data/lib/kodi_client/extensions/chainable.rb +71 -0
- data/lib/kodi_client/extensions/comparable.rb +29 -0
- data/lib/kodi_client/extensions/creatable.rb +137 -0
- data/lib/kodi_client/extensions/iterable.rb +14 -0
- data/lib/kodi_client/kodi_error.rb +14 -0
- data/lib/kodi_client/kodi_method.rb +34 -0
- data/lib/kodi_client/{options.rb → kodi_options.rb} +1 -1
- data/lib/kodi_client/kodi_request.rb +16 -0
- data/lib/kodi_client/kodi_response.rb +21 -0
- data/lib/kodi_client/{method → methods}/addons.rb +4 -4
- data/lib/kodi_client/{method → methods}/application.rb +2 -2
- data/lib/kodi_client/{method → methods}/audio_library.rb +2 -2
- data/lib/kodi_client/{method → methods}/favourites.rb +2 -2
- data/lib/kodi_client/{method → methods}/files.rb +2 -2
- data/lib/kodi_client/{method → methods}/gui.rb +2 -2
- data/lib/kodi_client/{method → methods}/input.rb +2 -2
- data/lib/kodi_client/{method → methods}/player.rb +2 -2
- data/lib/kodi_client/{method → methods}/profiles.rb +2 -2
- data/lib/kodi_client/{method → methods}/system.rb +2 -2
- data/lib/kodi_client/types/addons/addon_content_type.rb +18 -0
- data/lib/kodi_client/types/addons/addon_dependency_type.rb +21 -0
- data/lib/kodi_client/types/addons/addon_details_type.rb +44 -0
- data/lib/kodi_client/types/addons/addon_extra_info_type.rb +20 -0
- data/lib/kodi_client/types/addons/addon_fields_type.rb +28 -0
- data/lib/kodi_client/types/addons/addon_types_type.rb +48 -0
- data/lib/kodi_client/types/addons/get_addon_returned_type.rb +21 -0
- data/lib/kodi_client/types/addons/get_addons_returned_type.rb +22 -0
- data/lib/kodi_client/types/application/property_name_type.rb +19 -0
- data/lib/kodi_client/types/application/property_value_type.rb +24 -0
- data/lib/kodi_client/types/application/version_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_album_release_type_type.rb +15 -0
- data/lib/kodi_client/types/audio/audio_contributor_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_details_base_type.rb +31 -0
- data/lib/kodi_client/types/audio/audio_details_media_type.rb +45 -0
- data/lib/kodi_client/types/audio/audio_fields_album_type.rb +51 -0
- data/lib/kodi_client/types/audio/details_album_type.rb +58 -0
- data/lib/kodi_client/types/audio/genre_type.rb +20 -0
- data/lib/kodi_client/types/audio/get_albums_returned_type.rb +22 -0
- data/lib/kodi_client/types/favourites/details_favourite_type.rb +24 -0
- data/lib/kodi_client/types/favourites/fields_favourite_type.rb +17 -0
- data/lib/kodi_client/types/favourites/get_favourite_returned_type.rb +22 -0
- data/lib/kodi_client/types/favourites/type_type.rb +18 -0
- data/lib/kodi_client/types/files/file_label_type.rb +20 -0
- data/lib/kodi_client/types/files/get_directory_returned_type.rb +22 -0
- data/lib/kodi_client/types/files/get_sources_returned_type.rb +22 -0
- data/lib/kodi_client/types/files/media_type.rb +18 -0
- data/lib/kodi_client/types/files/prepare_download_returned_type.rb +21 -0
- data/lib/kodi_client/types/global/direction_type.rb +17 -0
- data/lib/kodi_client/types/global/global_time_type.rb +22 -0
- data/lib/kodi_client/types/global/id_label_type.rb +20 -0
- data/lib/kodi_client/types/global/id_name_type.rb +20 -0
- data/lib/kodi_client/types/global/increment_decrement_type.rb +15 -0
- data/lib/kodi_client/types/global/next_prev_type.rb +17 -0
- data/lib/kodi_client/types/global/password_encryption_type.rb +16 -0
- data/lib/kodi_client/types/global/rotate_type.rb +15 -0
- data/lib/kodi_client/types/global/toggle_type.rb +16 -0
- data/lib/kodi_client/types/gui/gui_window_type.rb +124 -0
- data/lib/kodi_client/types/gui/property_name_type.rb +18 -0
- data/lib/kodi_client/types/gui/property_value_type.rb +26 -0
- data/lib/kodi_client/types/gui/stereoscopy_mode_type.rb +31 -0
- data/lib/kodi_client/types/input/input_action_type.rb +212 -0
- data/lib/kodi_client/types/{item_types.rb → items/item_details_base_type.rb} +1 -3
- data/lib/kodi_client/types/list/list_field_files_type.rb +83 -0
- data/lib/kodi_client/types/list/list_fields_all_type.rb +96 -0
- data/lib/kodi_client/types/list/list_item_all_type.rb +73 -0
- data/lib/kodi_client/types/list/list_item_base_type.rb +138 -0
- data/lib/kodi_client/types/list/list_item_file_type.rb +68 -0
- data/lib/kodi_client/types/list/list_limits_returned_type.rb +23 -0
- data/lib/kodi_client/types/list/list_limits_type.rb +19 -0
- data/lib/kodi_client/types/list/list_sort_method_type.rb +54 -0
- data/lib/kodi_client/types/list/list_sort_type.rb +22 -0
- data/lib/kodi_client/types/list/sort_order_type.rb +15 -0
- data/lib/kodi_client/types/media/media_artwork_type.rb +22 -0
- data/lib/kodi_client/types/media/media_details_base_type.rb +28 -0
- data/lib/kodi_client/types/media/media_type_type.rb +16 -0
- data/lib/kodi_client/types/player/audio_stream_type.rb +29 -0
- data/lib/kodi_client/types/player/player_position_time_type.rb +22 -0
- data/lib/kodi_client/types/player/player_repeat_type.rb +17 -0
- data/lib/kodi_client/types/player/player_speed_type.rb +26 -0
- data/lib/kodi_client/types/player/player_type.rb +24 -0
- data/lib/kodi_client/types/player/player_type_type.rb +16 -0
- data/lib/kodi_client/types/player/player_view_mode_type.rb +23 -0
- data/lib/kodi_client/types/player/player_visibility_type.rb +16 -0
- data/lib/kodi_client/types/player/property_name_type.rb +38 -0
- data/lib/kodi_client/types/player/property_value_type.rb +60 -0
- data/lib/kodi_client/types/player/seek_jump_type.rb +17 -0
- data/lib/kodi_client/types/player/seek_returned_type.rb +23 -0
- data/lib/kodi_client/types/player/subtitle_type.rb +24 -0
- data/lib/kodi_client/types/player/video_stream_type.rb +26 -0
- data/lib/kodi_client/types/player/view_mode_type.rb +22 -0
- data/lib/kodi_client/types/player/zoom_type.rb +15 -0
- data/lib/kodi_client/types/profiles/details_profile_type.rb +24 -0
- data/lib/kodi_client/types/profiles/fields_profile_type.rb +15 -0
- data/lib/kodi_client/types/profiles/get_profiles_returned_type.rb +22 -0
- data/lib/kodi_client/types/profiles/profile_password_type.rb +20 -0
- data/lib/kodi_client/types/{pvr_type.rb → pvr/channel_type_type.rb} +2 -4
- data/lib/kodi_client/types/system/property_name_type.rb +17 -0
- data/lib/kodi_client/types/{system_types.rb → system/property_value_type.rb} +2 -13
- data/lib/kodi_client/types/video/stream_details_type.rb +24 -0
- data/lib/kodi_client/types/video/video_cast_type.rb +22 -0
- data/lib/kodi_client/types/video/video_details_base_type.rb +29 -0
- data/lib/kodi_client/types/video/video_details_file_type.rb +37 -0
- data/lib/kodi_client/types/video/video_details_item_type.rb +32 -0
- data/lib/kodi_client/types/video/video_details_media_type.rb +28 -0
- data/lib/kodi_client/types/video/video_resume_type.rb +20 -0
- data/lib/kodi_client.rb +137 -49
- metadata +107 -34
- data/lib/kodi_client/Chainable.rb +0 -48
- data/lib/kodi_client/kodi_module.rb +0 -80
- data/lib/kodi_client/types/addon_types.rb +0 -177
- data/lib/kodi_client/types/application_types.rb +0 -52
- data/lib/kodi_client/types/audio_types.rb +0 -221
- data/lib/kodi_client/types/favourites_types.rb +0 -61
- data/lib/kodi_client/types/files_types.rb +0 -63
- data/lib/kodi_client/types/global_types.rb +0 -102
- data/lib/kodi_client/types/gui_types.rb +0 -179
- data/lib/kodi_client/types/input_types.rb +0 -214
- data/lib/kodi_client/types/list_types.rb +0 -542
- data/lib/kodi_client/types/media_types.rb +0 -53
- data/lib/kodi_client/types/player_type.rb +0 -294
- data/lib/kodi_client/types/profiles_types.rb +0 -65
- data/lib/kodi_client/types/video_types.rb +0 -150
- data/lib/kodi_client/util/comparable.rb +0 -20
- data/lib/kodi_client/util/creatable.rb +0 -106
- data/lib/kodi_client/util/iterable.rb +0 -11
|
@@ -1,542 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module List
|
|
6
|
-
|
|
7
|
-
# List.Limits https://kodi.wiki/view/JSON-RPC_API/v12#List.Limits
|
|
8
|
-
class ListLimits
|
|
9
|
-
include Comparable
|
|
10
|
-
|
|
11
|
-
attr_reader :list_start, :list_end
|
|
12
|
-
|
|
13
|
-
def initialize(list_start, list_end)
|
|
14
|
-
@list_start = list_start
|
|
15
|
-
@list_end = list_end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# List.LimitsReturned https://kodi.wiki/view/JSON-RPC_API/v12#List.LimitsReturned
|
|
20
|
-
class ListLimitsReturned
|
|
21
|
-
include Comparable
|
|
22
|
-
extend Creatable
|
|
23
|
-
|
|
24
|
-
attr_reader :list_start, :list_end, :total
|
|
25
|
-
|
|
26
|
-
fields_to_map %w[start end total]
|
|
27
|
-
|
|
28
|
-
def initialize(list_start, list_end, total)
|
|
29
|
-
@list_start = list_start
|
|
30
|
-
@list_end = list_end
|
|
31
|
-
@total = total
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# ascending/descending for sorting
|
|
36
|
-
module SortOrder
|
|
37
|
-
extend Iterable
|
|
38
|
-
|
|
39
|
-
ASCENDING = 'ascending'
|
|
40
|
-
DESCENDING = 'descending'
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# List.Sort https://kodi.wiki/view/JSON-RPC_API/v12#List.Sort
|
|
44
|
-
class ListSort
|
|
45
|
-
include Comparable
|
|
46
|
-
|
|
47
|
-
attr_reader :ignore_article, :method, :order, :use_artist_sort_name
|
|
48
|
-
|
|
49
|
-
def initialize(ignore_article = false, method = ListSortMethod::NONE,
|
|
50
|
-
sort_order = SortOrder::ASCENDING, use_artist_sort_name = false)
|
|
51
|
-
@ignore_article = ignore_article
|
|
52
|
-
@method = method
|
|
53
|
-
@order = sort_order
|
|
54
|
-
@use_artist_sort_name = use_artist_sort_name
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# List.Fields.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.All
|
|
59
|
-
module ListFieldsAll
|
|
60
|
-
extend Iterable
|
|
61
|
-
|
|
62
|
-
ALBUM = 'album'
|
|
63
|
-
ALBUMARTIST = 'albumartist'
|
|
64
|
-
ALBUMARTISTID = 'albumartistid'
|
|
65
|
-
ALBUMID = 'albumid'
|
|
66
|
-
ALBUMLABEL = 'albumlabel'
|
|
67
|
-
ALBUMRELEASETYPE = 'albumreleasetype'
|
|
68
|
-
ART = 'art'
|
|
69
|
-
ARTIST = 'artist'
|
|
70
|
-
ARTISTID = 'artistid'
|
|
71
|
-
CAST = 'cast'
|
|
72
|
-
CHANNEL = 'channel'
|
|
73
|
-
CHANNELNUMBER = 'channelnumber'
|
|
74
|
-
CHANNELTYPE = 'channeltype'
|
|
75
|
-
COMMENT = 'comment'
|
|
76
|
-
COMPILATION = 'compilation'
|
|
77
|
-
CONTRIBUTORS = 'contributors'
|
|
78
|
-
COUNTRY = 'country'
|
|
79
|
-
DATEADDED = 'dateadded'
|
|
80
|
-
DESCRIPTION = 'description'
|
|
81
|
-
DIRECTOR = 'director'
|
|
82
|
-
DISC = 'disc'
|
|
83
|
-
DISPLAYARTIST = 'displayartist'
|
|
84
|
-
DISPLAYCOMPOSER = 'displaycomposer'
|
|
85
|
-
DISPLAYCONDUCTOR = 'displayconductor'
|
|
86
|
-
DISPLAYLYRICIST = 'displaylyricist'
|
|
87
|
-
DISPLAYORCHESTRA = 'displayorchestra'
|
|
88
|
-
DURATION = 'duration'
|
|
89
|
-
ENDTIME = 'endtime'
|
|
90
|
-
EPISODE = 'episode'
|
|
91
|
-
EPISODEGUIDE = 'episodeguide'
|
|
92
|
-
FANART = 'fanart'
|
|
93
|
-
FILE = 'file'
|
|
94
|
-
FIRSTAIRED = 'firstaired'
|
|
95
|
-
GENRE = 'genre'
|
|
96
|
-
GENREID = 'genreid'
|
|
97
|
-
HIDDEN = 'hidden'
|
|
98
|
-
IMDBNUMBER = 'imdbnumber'
|
|
99
|
-
LASTPLAYED = 'lastplayed'
|
|
100
|
-
LOCKED = 'locked'
|
|
101
|
-
LYRICS = 'lyrics'
|
|
102
|
-
MOOD = 'mood'
|
|
103
|
-
MPAA = 'mpaa'
|
|
104
|
-
MUSICBRAINZALBUMARTISTID = 'musicbrainzalbumartistid'
|
|
105
|
-
MUSICBRAINZALBUMID = 'musicbrainzalbumid'
|
|
106
|
-
MUSICBRAINZARTISTID = 'musicbrainzartistid'
|
|
107
|
-
MUSICBRAINZTRACKID = 'musicbrainztrackid'
|
|
108
|
-
ORIGINALTITLE = 'originaltitle'
|
|
109
|
-
PLAYCOUNT = 'playcount'
|
|
110
|
-
PLOT = 'plot'
|
|
111
|
-
PLOTOUTLINE = 'plotoutline'
|
|
112
|
-
PREMIERED = 'premiered'
|
|
113
|
-
PRODUCTIONCODE = 'productioncode'
|
|
114
|
-
RATING = 'rating'
|
|
115
|
-
RELEASETYPE = 'releasetype'
|
|
116
|
-
RESUME = 'resume'
|
|
117
|
-
RUNTIME = 'runtime'
|
|
118
|
-
SEASON = 'season'
|
|
119
|
-
SET = 'set'
|
|
120
|
-
SETID = 'setid'
|
|
121
|
-
SHOWLINK = 'showlink'
|
|
122
|
-
SHOWTITLE = 'showtitle'
|
|
123
|
-
SORTTITLE = 'sorttitle'
|
|
124
|
-
SPECIALSORTEPISODE = 'specialsortepisode'
|
|
125
|
-
SPECIALSORTSEASON = 'specialsortseason'
|
|
126
|
-
STARTTIME = 'starttime'
|
|
127
|
-
STREAMDETAILS = 'streamdetails'
|
|
128
|
-
STUDIO = 'studio'
|
|
129
|
-
STYLE = 'style'
|
|
130
|
-
TAG = 'tag'
|
|
131
|
-
TAGLINE = 'tagline'
|
|
132
|
-
THEME = 'theme'
|
|
133
|
-
THUMBNAIL = 'thumbnail'
|
|
134
|
-
TITLE = 'title'
|
|
135
|
-
TOP250 = 'top250'
|
|
136
|
-
TRACK = 'track'
|
|
137
|
-
TRAILER = 'trailer'
|
|
138
|
-
TVSHOWID = 'tvshowid'
|
|
139
|
-
UNIQUEID = 'uniqueid'
|
|
140
|
-
USERRATING = 'userrating'
|
|
141
|
-
VOTES = 'votes'
|
|
142
|
-
WATCHEDEPISODES = 'watchedepisodes'
|
|
143
|
-
WRITER = 'writer'
|
|
144
|
-
YEAR = 'year'
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# List.Fields.Files https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.Files
|
|
148
|
-
module ListFieldFiles
|
|
149
|
-
extend Iterable
|
|
150
|
-
|
|
151
|
-
ALBUM = 'album'
|
|
152
|
-
ALBUMARTIST = 'albumartist'
|
|
153
|
-
ALBUMARTISTID = 'albumartistid'
|
|
154
|
-
ALBUMID = 'albumid'
|
|
155
|
-
ALBUMLABEL = 'albumlabel'
|
|
156
|
-
ART = 'art'
|
|
157
|
-
ARTIST = 'artist'
|
|
158
|
-
ARTISTID = 'artistid'
|
|
159
|
-
CAST = 'cast'
|
|
160
|
-
COMMENT = 'comment'
|
|
161
|
-
COUNTRY = 'country'
|
|
162
|
-
DATEADDED = 'dateadded'
|
|
163
|
-
DESCRIPTION = 'description'
|
|
164
|
-
DIRECTOR = 'director'
|
|
165
|
-
DISC = 'disc'
|
|
166
|
-
DISPLAYARTIST = 'displayartist'
|
|
167
|
-
DURATION = 'duration'
|
|
168
|
-
EPISODE = 'episode'
|
|
169
|
-
EPISODEGUIDE = 'episodeguide'
|
|
170
|
-
FANART = 'fanart'
|
|
171
|
-
FILE = 'file'
|
|
172
|
-
FIRSTAIRED = 'firstaired'
|
|
173
|
-
GENRE = 'genre'
|
|
174
|
-
GENREID = 'genreid'
|
|
175
|
-
IMDBNUMBER = 'imdbnumber'
|
|
176
|
-
LASTMODIFIED = 'lastmodified'
|
|
177
|
-
LASTPLAYED = 'lastplayed'
|
|
178
|
-
LYRICS = 'lyrics'
|
|
179
|
-
MIMETYPE = 'mimetype'
|
|
180
|
-
MOOD = 'mood'
|
|
181
|
-
MPAA = 'mpaa'
|
|
182
|
-
MUSICBRAINZALBUMARTISTID = 'musicbrainzalbumartistid'
|
|
183
|
-
MUSICBRAINZALBUMID = 'musicbrainzalbumid'
|
|
184
|
-
MUSICBRAINZARTISTID = 'musicbrainzartistid'
|
|
185
|
-
MUSICBRAINZTRACKID = 'musicbrainztrackid'
|
|
186
|
-
ORIGINALTITLE = 'originaltitle'
|
|
187
|
-
PLAYCOUNT = 'playcount'
|
|
188
|
-
PLOT = 'plot'
|
|
189
|
-
PLOTOUTLINE = 'plotoutline'
|
|
190
|
-
PREMIERED = 'premiered'
|
|
191
|
-
PRODUCTIONCODE = 'productioncode'
|
|
192
|
-
RATING = 'rating'
|
|
193
|
-
RESUME = 'resume'
|
|
194
|
-
RUNTIME = 'runtime'
|
|
195
|
-
SEASON = 'season'
|
|
196
|
-
SET = 'set'
|
|
197
|
-
SETID = 'setid'
|
|
198
|
-
SHOWLINK = 'showlink'
|
|
199
|
-
SHOWTITLE = 'showtitle'
|
|
200
|
-
SIZE = 'size'
|
|
201
|
-
SORTTITLE = 'sorttitle'
|
|
202
|
-
SPECIALSORTEPISODE = 'specialsortepisode'
|
|
203
|
-
SPECIALSORTSEASON = 'specialsortseason'
|
|
204
|
-
STREAMDETAILS = 'streamdetails'
|
|
205
|
-
STUDIO = 'studio'
|
|
206
|
-
STYLE = 'style'
|
|
207
|
-
TAG = 'tag'
|
|
208
|
-
TAGLINE = 'tagline'
|
|
209
|
-
THEME = 'theme'
|
|
210
|
-
THUMBNAIL = 'thumbnail'
|
|
211
|
-
TITLE = 'title'
|
|
212
|
-
TOP250 = 'top250'
|
|
213
|
-
TRACK = 'track'
|
|
214
|
-
TRAILER = 'trailer'
|
|
215
|
-
TVSHOWID = 'tvshowid'
|
|
216
|
-
UNIQUEID = 'uniqueid'
|
|
217
|
-
VOTES = 'votes'
|
|
218
|
-
WATCHEDEPISODES = 'watchedepisodes'
|
|
219
|
-
WRITER = 'writer'
|
|
220
|
-
YEAR = 'year'
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
# File/Label tuple
|
|
224
|
-
class FileLabel
|
|
225
|
-
include Comparable
|
|
226
|
-
extend Creatable
|
|
227
|
-
|
|
228
|
-
attr_reader :file, :label
|
|
229
|
-
|
|
230
|
-
def initialize(file, label)
|
|
231
|
-
@file = file
|
|
232
|
-
@label = label
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
# List.Item.Base https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.Base
|
|
237
|
-
module ListItemBase
|
|
238
|
-
include Video::VideoDetailsFile
|
|
239
|
-
include Audio::AudioDetailsMedia
|
|
240
|
-
|
|
241
|
-
attr_reader :album, :album_artist, :album_artist_id, :album_id, :album_release_type, :album_status, :bit_rate,
|
|
242
|
-
:bpm, :cast, :channels, :comment, :compilation, :contributors, :country, :description, :disc,
|
|
243
|
-
:disc_title, :display_composer, :display_conductor, :display_lyricist, :display_orchestra,
|
|
244
|
-
:duration, :dyn_path, :episode, :episode_guide, :first_aired, :id, :imdb_number, :is_box_set,
|
|
245
|
-
:lyrics, :media_path, :mood, :mpaa, :musicbrainz_artist_id, :musicbrainz_track_id, :original_date,
|
|
246
|
-
:original_title, :plot_outline, :premiered, :production_code, :release_date, :release_type,
|
|
247
|
-
:sample_rate, :season, :set, :set_id, :show_link, :show_title, :sort_title, :special_sort_episode,
|
|
248
|
-
:special_sort_season, :studio, :style, :tag, :tag_line, :theme, :top250, :total_discs, :track,
|
|
249
|
-
:trailer, :tv_show_id, :type, :unique_id, :votes, :watched_episodes, :writer
|
|
250
|
-
|
|
251
|
-
def list_item_base_mappings
|
|
252
|
-
mappings = {
|
|
253
|
-
'cast' => Creatable::CreateMap.new(Video::VideoCast, true),
|
|
254
|
-
'contributors' => Creatable::CreateMap.new(Audio::AudioContributor, true),
|
|
255
|
-
'resume' => Creatable::CreateMap.new(Video::VideoResume),
|
|
256
|
-
'streamdetails' => Creatable::CreateMap.new(Video::Streams),
|
|
257
|
-
'art' => Creatable::CreateMap.new(Media::MediaArtwork)
|
|
258
|
-
}
|
|
259
|
-
mappings.merge(video_details_file_mappings).merge(audio_details_media_mappings)
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
def list_item_base_by_hash(hash)
|
|
263
|
-
return nil if hash.nil?
|
|
264
|
-
|
|
265
|
-
list_item_base(*Creatable.hash_to_arr(
|
|
266
|
-
hash, %w[album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
|
267
|
-
bpm cast channels comment compilation contributors country description disc
|
|
268
|
-
disc_title display_composer display_conductor display_lyricist display_orchestra
|
|
269
|
-
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
|
270
|
-
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
|
271
|
-
original_title plot_outline premiered production_code release_date release_type
|
|
272
|
-
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
|
273
|
-
special_sort_season studio style tag tag_line theme top250 total_discs track
|
|
274
|
-
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
|
275
|
-
runtime stream_details date_added file last_played plot title art play_count
|
|
276
|
-
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
|
277
|
-
rating sort_artist user_rating year genre], list_item_base_mappings
|
|
278
|
-
))
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
def list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
|
282
|
-
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
|
283
|
-
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
|
284
|
-
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
|
285
|
-
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
|
286
|
-
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
|
287
|
-
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
|
288
|
-
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
|
289
|
-
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
|
290
|
-
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
|
291
|
-
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
|
292
|
-
rating, sort_artist, user_rating, year, genre)
|
|
293
|
-
@album = album
|
|
294
|
-
@album_artist = album_artist
|
|
295
|
-
@album_artist_id = album_artist_id
|
|
296
|
-
@album_id = album_id
|
|
297
|
-
@album_release_type = album_release_type
|
|
298
|
-
@album_status = album_status
|
|
299
|
-
@bit_rate = bit_rate
|
|
300
|
-
@bpm = bpm
|
|
301
|
-
@cast = cast
|
|
302
|
-
@channels = channels
|
|
303
|
-
@comment = comment
|
|
304
|
-
@compilation = compilation
|
|
305
|
-
@contributors = contributors
|
|
306
|
-
@country = country
|
|
307
|
-
@description = description
|
|
308
|
-
@disc = disc
|
|
309
|
-
@disc_title = disc_title
|
|
310
|
-
@display_composer = display_composer
|
|
311
|
-
@display_conductor = display_conductor
|
|
312
|
-
@display_lyricist = display_lyricist
|
|
313
|
-
@display_orchestra = display_orchestra
|
|
314
|
-
@duration = duration
|
|
315
|
-
@dyn_path = dyn_path
|
|
316
|
-
@episode = episode
|
|
317
|
-
@episode_guide = episode_guide
|
|
318
|
-
@first_aired = first_aired
|
|
319
|
-
@id = id
|
|
320
|
-
@imdb_number = imdb_number
|
|
321
|
-
@is_box_set = is_box_set
|
|
322
|
-
@lyrics = lyrics
|
|
323
|
-
@media_path = media_path
|
|
324
|
-
@mood = mood
|
|
325
|
-
@mpaa = mpaa
|
|
326
|
-
@musicbrainz_artist_id = musicbrainz_artist_id
|
|
327
|
-
@musicbrainz_track_id = musicbrainz_track_id
|
|
328
|
-
@original_date = original_date
|
|
329
|
-
@original_title = original_title
|
|
330
|
-
@plot_outline = plot_outline
|
|
331
|
-
@premiered = premiered
|
|
332
|
-
@production_code = production_code
|
|
333
|
-
@release_date = release_date
|
|
334
|
-
@release_type = release_type
|
|
335
|
-
@sample_rate = sample_rate
|
|
336
|
-
@season = season
|
|
337
|
-
@set = set
|
|
338
|
-
@set_id = set_id
|
|
339
|
-
@show_link = show_link
|
|
340
|
-
@show_title = show_title
|
|
341
|
-
@sort_title = sort_title
|
|
342
|
-
@special_sort_episode = special_sort_episode
|
|
343
|
-
@special_sort_season = special_sort_season
|
|
344
|
-
@studio = studio
|
|
345
|
-
@style = style
|
|
346
|
-
@tag = tag
|
|
347
|
-
@tag_line = tag_line
|
|
348
|
-
@theme = theme
|
|
349
|
-
@top250 = top250
|
|
350
|
-
@total_discs = total_discs
|
|
351
|
-
@track = track
|
|
352
|
-
@trailer = trailer
|
|
353
|
-
@tv_show_id = tv_show_id
|
|
354
|
-
@type = type
|
|
355
|
-
@unique_id = unique_id
|
|
356
|
-
@votes = votes
|
|
357
|
-
@watched_episodes = watched_episodes
|
|
358
|
-
@writer = writer
|
|
359
|
-
video_details_file(director, resume, runtime, stream_details, date_added, file, last_played, plot, title,
|
|
360
|
-
art, play_count, fan_art, thumbnail, label)
|
|
361
|
-
audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date, rating,
|
|
362
|
-
release_date, sort_artist, title, user_rating, votes, year, art, date_added, genre,
|
|
363
|
-
fan_art, thumbnail, label)
|
|
364
|
-
end
|
|
365
|
-
end
|
|
366
|
-
|
|
367
|
-
# List.Item.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.All
|
|
368
|
-
class ListItemAll
|
|
369
|
-
include ListItemBase
|
|
370
|
-
include Comparable
|
|
371
|
-
extend Creatable
|
|
372
|
-
extend ListItemBase
|
|
373
|
-
|
|
374
|
-
attr_reader :channel, :channel_number, :channel_type, :end_time, :hidden, :locked, :start_time,
|
|
375
|
-
:sub_channel_number
|
|
376
|
-
|
|
377
|
-
fields_to_map %w[channel channel_number channel_type end_time hidden locked start_time sub_channel_number
|
|
378
|
-
album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
|
379
|
-
bpm cast channels comment compilation contributors country description disc
|
|
380
|
-
disc_title display_composer display_conductor display_lyricist display_orchestra
|
|
381
|
-
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
|
382
|
-
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
|
383
|
-
original_title plot_outline premiered production_code release_date release_type
|
|
384
|
-
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
|
385
|
-
special_sort_season studio style tag tag_line theme top250 total_discs track
|
|
386
|
-
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
|
387
|
-
runtime stream_details date_added file last_played plot title art play_count
|
|
388
|
-
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
|
389
|
-
rating sort_artist user_rating year genre]
|
|
390
|
-
|
|
391
|
-
def self.lazy_type_mapping
|
|
392
|
-
list_item_base_mappings
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
def initialize(channel, channel_number, channel_type, end_time, hidden, locked, start_time, sub_channel_number,
|
|
396
|
-
album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
|
397
|
-
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
|
398
|
-
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
|
399
|
-
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
|
400
|
-
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
|
401
|
-
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
|
402
|
-
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
|
403
|
-
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
|
404
|
-
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
|
405
|
-
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
|
406
|
-
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
|
407
|
-
rating, sort_artist, user_rating, year, genre)
|
|
408
|
-
@channel = channel
|
|
409
|
-
@channel_number = channel_number
|
|
410
|
-
@channel_type = channel_type
|
|
411
|
-
@end_time = end_time
|
|
412
|
-
@hidden = hidden
|
|
413
|
-
@locked = locked
|
|
414
|
-
@start_time = start_time
|
|
415
|
-
@sub_channel_number = sub_channel_number
|
|
416
|
-
type = type.nil? ? 'unknown' : type
|
|
417
|
-
|
|
418
|
-
list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
|
419
|
-
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
|
420
|
-
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
|
421
|
-
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
|
422
|
-
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
|
423
|
-
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
|
424
|
-
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
|
425
|
-
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
|
426
|
-
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
|
427
|
-
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
|
428
|
-
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
|
429
|
-
rating, sort_artist, user_rating, year, genre)
|
|
430
|
-
end
|
|
431
|
-
end
|
|
432
|
-
|
|
433
|
-
# List.Item.File https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.File
|
|
434
|
-
class ListItemFile
|
|
435
|
-
include ListItemBase
|
|
436
|
-
include Comparable
|
|
437
|
-
extend Creatable
|
|
438
|
-
extend ListItemBase
|
|
439
|
-
|
|
440
|
-
attr_reader :file, :file_type, :last_modified, :mime_type, :size
|
|
441
|
-
|
|
442
|
-
fields_to_map %w[file_type last_modified mime_type size
|
|
443
|
-
album album_artist album_artist_id album_id album_release_type album_status bit_rate
|
|
444
|
-
bpm cast channels comment compilation contributors country description disc
|
|
445
|
-
disc_title display_composer display_conductor display_lyricist display_orchestra
|
|
446
|
-
duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
|
|
447
|
-
lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
|
|
448
|
-
original_title plot_outline premiered production_code release_date release_type
|
|
449
|
-
sample_rate season set set_id show_link show_title sort_title special_sort_episode
|
|
450
|
-
special_sort_season studio style tag tag_line theme top250 total_discs track
|
|
451
|
-
trailer tv_show_id type unique_id votes watched_episodes writer director resume
|
|
452
|
-
runtime stream_details date_added file last_played plot title art play_count
|
|
453
|
-
fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
|
|
454
|
-
rating sort_artist user_rating year genre]
|
|
455
|
-
|
|
456
|
-
def self.lazy_type_mapping
|
|
457
|
-
list_item_base_mappings
|
|
458
|
-
end
|
|
459
|
-
|
|
460
|
-
def initialize(file_type, last_modified, mime_type, size,
|
|
461
|
-
album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
|
462
|
-
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
|
463
|
-
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
|
464
|
-
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
|
465
|
-
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
|
466
|
-
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
|
467
|
-
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
|
468
|
-
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
|
469
|
-
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
|
470
|
-
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
|
471
|
-
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
|
472
|
-
rating, sort_artist, user_rating, year, genre)
|
|
473
|
-
@file = file
|
|
474
|
-
@file_type = file_type
|
|
475
|
-
@last_modified = last_modified
|
|
476
|
-
@mime_type = mime_type
|
|
477
|
-
@size = size
|
|
478
|
-
type = type.nil? ? 'unknown' : type
|
|
479
|
-
list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
|
|
480
|
-
bpm, cast, channels, comment, compilation, contributors, country, description, disc,
|
|
481
|
-
disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
|
|
482
|
-
duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
|
|
483
|
-
lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
|
|
484
|
-
original_title, plot_outline, premiered, production_code, release_date, release_type,
|
|
485
|
-
sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
|
|
486
|
-
special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
|
|
487
|
-
trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
|
|
488
|
-
runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
|
|
489
|
-
fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
|
|
490
|
-
rating, sort_artist, user_rating, year, genre)
|
|
491
|
-
end
|
|
492
|
-
end
|
|
493
|
-
|
|
494
|
-
# methods for list sorting
|
|
495
|
-
module ListSortMethod
|
|
496
|
-
extend Iterable
|
|
497
|
-
|
|
498
|
-
NONE = 'none'
|
|
499
|
-
LABEL = 'label'
|
|
500
|
-
DATE = 'date'
|
|
501
|
-
SIZE = 'size'
|
|
502
|
-
FILE = 'file'
|
|
503
|
-
PATH = 'path'
|
|
504
|
-
DRIVE_TYPE = 'drivetype'
|
|
505
|
-
TITLE = 'title'
|
|
506
|
-
TRACK = 'track'
|
|
507
|
-
TIME = 'time'
|
|
508
|
-
ARTIST = 'artist'
|
|
509
|
-
ALBUM = 'album'
|
|
510
|
-
ALBUM_TYPE = 'albumtype'
|
|
511
|
-
GENRE = 'genre'
|
|
512
|
-
COUNTRY = 'country'
|
|
513
|
-
YEAR = 'year'
|
|
514
|
-
RATING = 'rating'
|
|
515
|
-
USER_RATING = 'userrating'
|
|
516
|
-
VOTES = 'votes'
|
|
517
|
-
TOP_250 = 'top250'
|
|
518
|
-
PROGRAM_COUNT = 'programcount'
|
|
519
|
-
PLAYLIST = 'playlist'
|
|
520
|
-
EPISODE = 'episode'
|
|
521
|
-
SEASON = 'season'
|
|
522
|
-
TOTAL_EPISODES = 'totalepisodes'
|
|
523
|
-
WATCHED_EPISODES = 'watchedepisodes'
|
|
524
|
-
TV_SHOW_STATUS = 'tvshowstatus'
|
|
525
|
-
TV_SHOW_TITLE = 'tvshowtitle'
|
|
526
|
-
SORT_TITLE = 'sorttitle'
|
|
527
|
-
PRODUCTION_CODE = 'productioncode'
|
|
528
|
-
MPAA = 'mpaa'
|
|
529
|
-
STUDIO = 'studio'
|
|
530
|
-
DATE_ADDED = 'dateadded'
|
|
531
|
-
LAST_PLAYED = 'lastplayed'
|
|
532
|
-
PLAY_COUNT = 'playcount'
|
|
533
|
-
LISTENERS = 'listeners'
|
|
534
|
-
BITRATE = 'bitrate'
|
|
535
|
-
RANDOM = 'random'
|
|
536
|
-
TOTAL_DISCS = 'totaldiscs'
|
|
537
|
-
ORIGINAL_DATE = 'originaldate'
|
|
538
|
-
BPM = 'bpm'
|
|
539
|
-
end
|
|
540
|
-
end
|
|
541
|
-
end
|
|
542
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Media
|
|
6
|
-
|
|
7
|
-
# media types
|
|
8
|
-
module MediaType
|
|
9
|
-
extend Iterable
|
|
10
|
-
|
|
11
|
-
VIDEO = 'video'
|
|
12
|
-
AUDIO = 'audio'
|
|
13
|
-
ALL = 'all'
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Media.Details.Base https://kodi.wiki/view/JSON-RPC_API/v12#Media.Details.Base
|
|
17
|
-
module MediaDetailsBase
|
|
18
|
-
include Items::ItemDetailsBase
|
|
19
|
-
|
|
20
|
-
attr_reader :fan_art, :thumbnail
|
|
21
|
-
|
|
22
|
-
def media_details_base_mappings
|
|
23
|
-
item_details_base_mappings
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def media_details_base_by_hash(hash)
|
|
27
|
-
media_details_base(*Creatable.hash_to_arr(hash, %w[fan_art thumbnail label]), media_details_base_mappings)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def media_details_base(fan_art, thumbnail, label)
|
|
31
|
-
@fan_art = fan_art
|
|
32
|
-
@thumbnail = thumbnail
|
|
33
|
-
item_details_base(label)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# Media.Artwork https://kodi.wiki/view/JSON-RPC_API/v12#Media.Artwork
|
|
38
|
-
class MediaArtwork
|
|
39
|
-
include Comparable
|
|
40
|
-
extend Creatable
|
|
41
|
-
|
|
42
|
-
attr_reader :banner, :fan_art, :poster, :thumb
|
|
43
|
-
|
|
44
|
-
def initialize(banner, fan_art, poster, thumb)
|
|
45
|
-
@banner = banner
|
|
46
|
-
@fan_art = fan_art
|
|
47
|
-
@poster = poster
|
|
48
|
-
@thumb = thumb
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|