kodi_client 0.6.1 → 0.7.0
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 +1 -0
- data/kodi_client.gemspec +2 -2
- 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 +6 -10
- data/lib/kodi_client/{method → methods}/application.rb +2 -5
- data/lib/kodi_client/methods/audio_library.rb +334 -0
- data/lib/kodi_client/{method → methods}/favourites.rb +2 -5
- data/lib/kodi_client/{method → methods}/files.rb +6 -14
- data/lib/kodi_client/{method → methods}/gui.rb +2 -5
- data/lib/kodi_client/{method → methods}/input.rb +2 -6
- data/lib/kodi_client/{method → methods}/player.rb +2 -7
- data/lib/kodi_client/{method → methods}/profiles.rb +5 -10
- data/lib/kodi_client/{method → methods}/system.rb +2 -6
- 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_artist_role_type.rb +21 -0
- data/lib/kodi_client/types/audio/audio_contributor_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_details_album_type.rb +58 -0
- data/lib/kodi_client/types/audio/audio_details_artist_type.rb +54 -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 +46 -0
- data/lib/kodi_client/types/audio/audio_details_role_type.rb +25 -0
- data/lib/kodi_client/types/audio/audio_details_song_type.rb +76 -0
- data/lib/kodi_client/types/audio/audio_fields_album_type.rb +50 -0
- data/lib/kodi_client/types/audio/audio_fields_artist_type.rb +39 -0
- data/lib/kodi_client/types/audio/audio_fields_role_type.rb +15 -0
- data/lib/kodi_client/types/audio/audio_fields_song_type.rb +61 -0
- data/lib/kodi_client/types/audio/available_art_type.rb +21 -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/audio/get_artists_returned_type.rb +23 -0
- data/lib/kodi_client/types/audio/get_genres_returned_type.rb +24 -0
- data/lib/kodi_client/types/audio/get_roles_returned_type.rb +25 -0
- data/lib/kodi_client/types/audio/get_songs_returned_type.rb +25 -0
- data/lib/kodi_client/types/audio/get_sources_return_type.rb +25 -0
- data/lib/kodi_client/types/audio/property_name_type.rb +25 -0
- data/lib/kodi_client/types/audio/property_value_type.rb +33 -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/{global_types/item_types.rb → types/items/item_details_base_type.rb} +1 -3
- data/lib/kodi_client/types/library/library_details_genre_type.rb +27 -0
- data/lib/kodi_client/types/library/library_details_source_type.rb +26 -0
- data/lib/kodi_client/types/library/library_fields_genre_type.rb +17 -0
- data/lib/kodi_client/types/library/library_fields_source_type.rb +17 -0
- 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 +23 -0
- data/lib/kodi_client/types/list/list_sort_method_type.rb +54 -0
- data/lib/kodi_client/types/list/list_sort_type.rb +28 -0
- data/lib/kodi_client/types/list/sort_order_type.rb +15 -0
- data/lib/kodi_client/types/media/media_artwork_type.rb +26 -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/{global_types/pvr_type.rb → types/pvr/channel_type_type.rb} +2 -6
- data/lib/kodi_client/types/system/property_name_type.rb +17 -0
- data/lib/kodi_client/{global_types/system_types.rb → types/system/property_value_type.rb} +2 -17
- 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 +156 -24
- metadata +129 -37
- data/lib/kodi_client/Chainable.rb +0 -49
- data/lib/kodi_client/global_types/addon_types.rb +0 -180
- data/lib/kodi_client/global_types/application_types.rb +0 -56
- data/lib/kodi_client/global_types/audio_types.rb +0 -226
- data/lib/kodi_client/global_types/favourites_types.rb +0 -66
- data/lib/kodi_client/global_types/files_types.rb +0 -68
- data/lib/kodi_client/global_types/global_types.rb +0 -106
- data/lib/kodi_client/global_types/gui_types.rb +0 -184
- data/lib/kodi_client/global_types/input_types.rb +0 -216
- data/lib/kodi_client/global_types/list_types.rb +0 -548
- data/lib/kodi_client/global_types/media_types.rb +0 -58
- data/lib/kodi_client/global_types/player_type.rb +0 -300
- data/lib/kodi_client/global_types/profiles_types.rb +0 -70
- data/lib/kodi_client/global_types/video_types.rb +0 -155
- data/lib/kodi_client/kodi_module.rb +0 -87
- data/lib/kodi_client/method/audio_library.rb +0 -49
- 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,548 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'kodi_client/util/comparable'
|
4
|
-
require 'kodi_client/util/creatable'
|
5
|
-
require 'kodi_client/util/iterable'
|
6
|
-
require 'kodi_client/global_types/video_types'
|
7
|
-
require 'kodi_client/global_types/audio_types'
|
8
|
-
|
9
|
-
module KodiClient
|
10
|
-
module Types
|
11
|
-
module List
|
12
|
-
|
13
|
-
# List.Limits https://kodi.wiki/view/JSON-RPC_API/v12#List.Limits
|
14
|
-
class ListLimits
|
15
|
-
include Comparable
|
16
|
-
|
17
|
-
attr_reader :list_start, :list_end
|
18
|
-
|
19
|
-
def initialize(list_start, list_end)
|
20
|
-
@list_start = list_start
|
21
|
-
@list_end = list_end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# List.LimitsReturned https://kodi.wiki/view/JSON-RPC_API/v12#List.LimitsReturned
|
26
|
-
class ListLimitsReturned
|
27
|
-
include Comparable
|
28
|
-
extend Creatable
|
29
|
-
|
30
|
-
attr_reader :list_start, :list_end, :total
|
31
|
-
|
32
|
-
fields_to_map %w[start end total]
|
33
|
-
|
34
|
-
def initialize(list_start, list_end, total)
|
35
|
-
@list_start = list_start
|
36
|
-
@list_end = list_end
|
37
|
-
@total = total
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# ascending/descending for sorting
|
42
|
-
module SortOrder
|
43
|
-
extend Iterable
|
44
|
-
|
45
|
-
ASCENDING = 'ascending'
|
46
|
-
DESCENDING = 'descending'
|
47
|
-
end
|
48
|
-
|
49
|
-
# List.Sort https://kodi.wiki/view/JSON-RPC_API/v12#List.Sort
|
50
|
-
class ListSort
|
51
|
-
include Comparable
|
52
|
-
|
53
|
-
attr_reader :ignore_article, :method, :order, :use_artist_sort_name
|
54
|
-
|
55
|
-
def initialize(ignore_article = false, method = ListSortMethod::NONE,
|
56
|
-
sort_order = SortOrder::ASCENDING, use_artist_sort_name = false)
|
57
|
-
@ignore_article = ignore_article
|
58
|
-
@method = method
|
59
|
-
@order = sort_order
|
60
|
-
@use_artist_sort_name = use_artist_sort_name
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# List.Fields.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.All
|
65
|
-
module ListFieldsAll
|
66
|
-
extend Iterable
|
67
|
-
|
68
|
-
ALBUM = 'album'
|
69
|
-
ALBUMARTIST = 'albumartist'
|
70
|
-
ALBUMARTISTID = 'albumartistid'
|
71
|
-
ALBUMID = 'albumid'
|
72
|
-
ALBUMLABEL = 'albumlabel'
|
73
|
-
ALBUMRELEASETYPE = 'albumreleasetype'
|
74
|
-
ART = 'art'
|
75
|
-
ARTIST = 'artist'
|
76
|
-
ARTISTID = 'artistid'
|
77
|
-
CAST = 'cast'
|
78
|
-
CHANNEL = 'channel'
|
79
|
-
CHANNELNUMBER = 'channelnumber'
|
80
|
-
CHANNELTYPE = 'channeltype'
|
81
|
-
COMMENT = 'comment'
|
82
|
-
COMPILATION = 'compilation'
|
83
|
-
CONTRIBUTORS = 'contributors'
|
84
|
-
COUNTRY = 'country'
|
85
|
-
DATEADDED = 'dateadded'
|
86
|
-
DESCRIPTION = 'description'
|
87
|
-
DIRECTOR = 'director'
|
88
|
-
DISC = 'disc'
|
89
|
-
DISPLAYARTIST = 'displayartist'
|
90
|
-
DISPLAYCOMPOSER = 'displaycomposer'
|
91
|
-
DISPLAYCONDUCTOR = 'displayconductor'
|
92
|
-
DISPLAYLYRICIST = 'displaylyricist'
|
93
|
-
DISPLAYORCHESTRA = 'displayorchestra'
|
94
|
-
DURATION = 'duration'
|
95
|
-
ENDTIME = 'endtime'
|
96
|
-
EPISODE = 'episode'
|
97
|
-
EPISODEGUIDE = 'episodeguide'
|
98
|
-
FANART = 'fanart'
|
99
|
-
FILE = 'file'
|
100
|
-
FIRSTAIRED = 'firstaired'
|
101
|
-
GENRE = 'genre'
|
102
|
-
GENREID = 'genreid'
|
103
|
-
HIDDEN = 'hidden'
|
104
|
-
IMDBNUMBER = 'imdbnumber'
|
105
|
-
LASTPLAYED = 'lastplayed'
|
106
|
-
LOCKED = 'locked'
|
107
|
-
LYRICS = 'lyrics'
|
108
|
-
MOOD = 'mood'
|
109
|
-
MPAA = 'mpaa'
|
110
|
-
MUSICBRAINZALBUMARTISTID = 'musicbrainzalbumartistid'
|
111
|
-
MUSICBRAINZALBUMID = 'musicbrainzalbumid'
|
112
|
-
MUSICBRAINZARTISTID = 'musicbrainzartistid'
|
113
|
-
MUSICBRAINZTRACKID = 'musicbrainztrackid'
|
114
|
-
ORIGINALTITLE = 'originaltitle'
|
115
|
-
PLAYCOUNT = 'playcount'
|
116
|
-
PLOT = 'plot'
|
117
|
-
PLOTOUTLINE = 'plotoutline'
|
118
|
-
PREMIERED = 'premiered'
|
119
|
-
PRODUCTIONCODE = 'productioncode'
|
120
|
-
RATING = 'rating'
|
121
|
-
RELEASETYPE = 'releasetype'
|
122
|
-
RESUME = 'resume'
|
123
|
-
RUNTIME = 'runtime'
|
124
|
-
SEASON = 'season'
|
125
|
-
SET = 'set'
|
126
|
-
SETID = 'setid'
|
127
|
-
SHOWLINK = 'showlink'
|
128
|
-
SHOWTITLE = 'showtitle'
|
129
|
-
SORTTITLE = 'sorttitle'
|
130
|
-
SPECIALSORTEPISODE = 'specialsortepisode'
|
131
|
-
SPECIALSORTSEASON = 'specialsortseason'
|
132
|
-
STARTTIME = 'starttime'
|
133
|
-
STREAMDETAILS = 'streamdetails'
|
134
|
-
STUDIO = 'studio'
|
135
|
-
STYLE = 'style'
|
136
|
-
TAG = 'tag'
|
137
|
-
TAGLINE = 'tagline'
|
138
|
-
THEME = 'theme'
|
139
|
-
THUMBNAIL = 'thumbnail'
|
140
|
-
TITLE = 'title'
|
141
|
-
TOP250 = 'top250'
|
142
|
-
TRACK = 'track'
|
143
|
-
TRAILER = 'trailer'
|
144
|
-
TVSHOWID = 'tvshowid'
|
145
|
-
UNIQUEID = 'uniqueid'
|
146
|
-
USERRATING = 'userrating'
|
147
|
-
VOTES = 'votes'
|
148
|
-
WATCHEDEPISODES = 'watchedepisodes'
|
149
|
-
WRITER = 'writer'
|
150
|
-
YEAR = 'year'
|
151
|
-
end
|
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
|
-
|
242
|
-
# List.Item.Base https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.Base
|
243
|
-
module ListItemBase
|
244
|
-
include Video::VideoDetailsFile
|
245
|
-
include Audio::AudioDetailsMedia
|
246
|
-
|
247
|
-
attr_reader :album, :album_artist, :album_artist_id, :album_id, :album_release_type, :album_status, :bit_rate,
|
248
|
-
:bpm, :cast, :channels, :comment, :compilation, :contributors, :country, :description, :disc,
|
249
|
-
:disc_title, :display_composer, :display_conductor, :display_lyricist, :display_orchestra,
|
250
|
-
:duration, :dyn_path, :episode, :episode_guide, :first_aired, :id, :imdb_number, :is_box_set,
|
251
|
-
:lyrics, :media_path, :mood, :mpaa, :musicbrainz_artist_id, :musicbrainz_track_id, :original_date,
|
252
|
-
:original_title, :plot_outline, :premiered, :production_code, :release_date, :release_type,
|
253
|
-
:sample_rate, :season, :set, :set_id, :show_link, :show_title, :sort_title, :special_sort_episode,
|
254
|
-
:special_sort_season, :studio, :style, :tag, :tag_line, :theme, :top250, :total_discs, :track,
|
255
|
-
:trailer, :tv_show_id, :type, :unique_id, :votes, :watched_episodes, :writer
|
256
|
-
|
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)
|
370
|
-
end
|
371
|
-
end
|
372
|
-
|
373
|
-
# List.Item.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.All
|
374
|
-
class ListItemAll
|
375
|
-
include ListItemBase
|
376
|
-
include Comparable
|
377
|
-
extend Creatable
|
378
|
-
extend ListItemBase
|
379
|
-
|
380
|
-
attr_reader :channel, :channel_number, :channel_type, :end_time, :hidden, :locked, :start_time,
|
381
|
-
:sub_channel_number
|
382
|
-
|
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
|
464
|
-
end
|
465
|
-
|
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)
|
497
|
-
end
|
498
|
-
end
|
499
|
-
|
500
|
-
# methods for list sorting
|
501
|
-
module ListSortMethod
|
502
|
-
extend Iterable
|
503
|
-
|
504
|
-
NONE = 'none'
|
505
|
-
LABEL = 'label'
|
506
|
-
DATE = 'date'
|
507
|
-
SIZE = 'size'
|
508
|
-
FILE = 'file'
|
509
|
-
PATH = 'path'
|
510
|
-
DRIVE_TYPE = 'drivetype'
|
511
|
-
TITLE = 'title'
|
512
|
-
TRACK = 'track'
|
513
|
-
TIME = 'time'
|
514
|
-
ARTIST = 'artist'
|
515
|
-
ALBUM = 'album'
|
516
|
-
ALBUM_TYPE = 'albumtype'
|
517
|
-
GENRE = 'genre'
|
518
|
-
COUNTRY = 'country'
|
519
|
-
YEAR = 'year'
|
520
|
-
RATING = 'rating'
|
521
|
-
USER_RATING = 'userrating'
|
522
|
-
VOTES = 'votes'
|
523
|
-
TOP_250 = 'top250'
|
524
|
-
PROGRAM_COUNT = 'programcount'
|
525
|
-
PLAYLIST = 'playlist'
|
526
|
-
EPISODE = 'episode'
|
527
|
-
SEASON = 'season'
|
528
|
-
TOTAL_EPISODES = 'totalepisodes'
|
529
|
-
WATCHED_EPISODES = 'watchedepisodes'
|
530
|
-
TV_SHOW_STATUS = 'tvshowstatus'
|
531
|
-
TV_SHOW_TITLE = 'tvshowtitle'
|
532
|
-
SORT_TITLE = 'sorttitle'
|
533
|
-
PRODUCTION_CODE = 'productioncode'
|
534
|
-
MPAA = 'mpaa'
|
535
|
-
STUDIO = 'studio'
|
536
|
-
DATE_ADDED = 'dateadded'
|
537
|
-
LAST_PLAYED = 'lastplayed'
|
538
|
-
PLAY_COUNT = 'playcount'
|
539
|
-
LISTENERS = 'listeners'
|
540
|
-
BITRATE = 'bitrate'
|
541
|
-
RANDOM = 'random'
|
542
|
-
TOTAL_DISCS = 'totaldiscs'
|
543
|
-
ORIGINAL_DATE = 'originaldate'
|
544
|
-
BPM = 'bpm'
|
545
|
-
end
|
546
|
-
end
|
547
|
-
end
|
548
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'kodi_client/global_types/item_types'
|
4
|
-
require 'kodi_client/util/comparable'
|
5
|
-
require 'kodi_client/util/creatable'
|
6
|
-
require 'kodi_client/util/iterable'
|
7
|
-
|
8
|
-
module KodiClient
|
9
|
-
module Types
|
10
|
-
module Media
|
11
|
-
|
12
|
-
# media types
|
13
|
-
module MediaType
|
14
|
-
extend Iterable
|
15
|
-
|
16
|
-
VIDEO = 'video'
|
17
|
-
AUDIO = 'audio'
|
18
|
-
ALL = 'all'
|
19
|
-
end
|
20
|
-
|
21
|
-
# Media.Details.Base https://kodi.wiki/view/JSON-RPC_API/v12#Media.Details.Base
|
22
|
-
module MediaDetailsBase
|
23
|
-
include Items::ItemDetailsBase
|
24
|
-
|
25
|
-
attr_reader :fan_art, :thumbnail
|
26
|
-
|
27
|
-
def media_details_base_mappings
|
28
|
-
item_details_base_mappings
|
29
|
-
end
|
30
|
-
|
31
|
-
def media_details_base_by_hash(hash)
|
32
|
-
media_details_base(*Creatable.hash_to_arr(hash, %w[fan_art thumbnail label]), media_details_base_mappings)
|
33
|
-
end
|
34
|
-
|
35
|
-
def media_details_base(fan_art, thumbnail, label)
|
36
|
-
@fan_art = fan_art
|
37
|
-
@thumbnail = thumbnail
|
38
|
-
item_details_base(label)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# Media.Artwork https://kodi.wiki/view/JSON-RPC_API/v12#Media.Artwork
|
43
|
-
class MediaArtwork
|
44
|
-
include Comparable
|
45
|
-
extend Creatable
|
46
|
-
|
47
|
-
attr_reader :banner, :fan_art, :poster, :thumb
|
48
|
-
|
49
|
-
def initialize(banner, fan_art, poster, thumb)
|
50
|
-
@banner = banner
|
51
|
-
@fan_art = fan_art
|
52
|
-
@poster = poster
|
53
|
-
@thumb = thumb
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|