kodi_client 0.6.0 → 0.6.4

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