kodi_client 0.6.3 → 0.7.2

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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/README.md +1 -0
  4. data/kodi_client.gemspec +2 -2
  5. data/lib/kodi_client/extensions/chainable.rb +73 -0
  6. data/lib/kodi_client/extensions/comparable.rb +29 -0
  7. data/lib/kodi_client/extensions/creatable.rb +132 -0
  8. data/lib/kodi_client/extensions/iterable.rb +14 -0
  9. data/lib/kodi_client/kodi_error.rb +14 -0
  10. data/lib/kodi_client/kodi_method.rb +34 -0
  11. data/lib/kodi_client/{options.rb → kodi_options.rb} +1 -1
  12. data/lib/kodi_client/kodi_request.rb +16 -0
  13. data/lib/kodi_client/kodi_response.rb +21 -0
  14. data/lib/kodi_client/{method → methods}/addons.rb +6 -6
  15. data/lib/kodi_client/{method → methods}/application.rb +2 -2
  16. data/lib/kodi_client/methods/audio_library.rb +334 -0
  17. data/lib/kodi_client/{method → methods}/favourites.rb +2 -2
  18. data/lib/kodi_client/{method → methods}/files.rb +6 -10
  19. data/lib/kodi_client/{method → methods}/gui.rb +2 -2
  20. data/lib/kodi_client/{method → methods}/input.rb +2 -2
  21. data/lib/kodi_client/{method → methods}/player.rb +2 -2
  22. data/lib/kodi_client/{method → methods}/profiles.rb +5 -7
  23. data/lib/kodi_client/{method → methods}/system.rb +2 -2
  24. data/lib/kodi_client/methods/video_library.rb +18 -0
  25. data/lib/kodi_client/types/addons/addon_content_type.rb +18 -0
  26. data/lib/kodi_client/types/addons/addon_dependency_type.rb +21 -0
  27. data/lib/kodi_client/types/addons/addon_details_type.rb +44 -0
  28. data/lib/kodi_client/types/addons/addon_extra_info_type.rb +20 -0
  29. data/lib/kodi_client/types/addons/addon_fields_type.rb +28 -0
  30. data/lib/kodi_client/types/addons/addon_types_type.rb +48 -0
  31. data/lib/kodi_client/types/addons/get_addon_returned_type.rb +21 -0
  32. data/lib/kodi_client/types/addons/get_addons_returned_type.rb +22 -0
  33. data/lib/kodi_client/types/application/property_name_type.rb +19 -0
  34. data/lib/kodi_client/types/application/property_value_type.rb +24 -0
  35. data/lib/kodi_client/types/application/version_type.rb +22 -0
  36. data/lib/kodi_client/types/audio/audio_album_release_type_type.rb +15 -0
  37. data/lib/kodi_client/types/audio/audio_artist_role_type.rb +21 -0
  38. data/lib/kodi_client/types/audio/audio_contributor_type.rb +22 -0
  39. data/lib/kodi_client/types/audio/audio_details_album_type.rb +58 -0
  40. data/lib/kodi_client/types/audio/audio_details_artist_type.rb +53 -0
  41. data/lib/kodi_client/types/audio/audio_details_base_type.rb +30 -0
  42. data/lib/kodi_client/types/audio/audio_details_media_type.rb +50 -0
  43. data/lib/kodi_client/types/audio/audio_details_role_type.rb +25 -0
  44. data/lib/kodi_client/types/audio/audio_details_song_type.rb +72 -0
  45. data/lib/kodi_client/types/audio/audio_fields_album_type.rb +50 -0
  46. data/lib/kodi_client/types/audio/audio_fields_artist_type.rb +39 -0
  47. data/lib/kodi_client/types/audio/audio_fields_role_type.rb +15 -0
  48. data/lib/kodi_client/types/audio/audio_fields_song_type.rb +61 -0
  49. data/lib/kodi_client/types/audio/available_art_type.rb +21 -0
  50. data/lib/kodi_client/types/audio/genre_type.rb +20 -0
  51. data/lib/kodi_client/types/audio/get_albums_returned_type.rb +22 -0
  52. data/lib/kodi_client/types/audio/get_artists_returned_type.rb +23 -0
  53. data/lib/kodi_client/types/audio/get_genres_returned_type.rb +24 -0
  54. data/lib/kodi_client/types/audio/get_roles_returned_type.rb +25 -0
  55. data/lib/kodi_client/types/audio/get_songs_returned_type.rb +25 -0
  56. data/lib/kodi_client/types/audio/get_sources_return_type.rb +25 -0
  57. data/lib/kodi_client/types/audio/property_name_type.rb +25 -0
  58. data/lib/kodi_client/types/audio/property_value_type.rb +33 -0
  59. data/lib/kodi_client/types/favourites/details_favourite_type.rb +24 -0
  60. data/lib/kodi_client/types/favourites/fields_favourite_type.rb +17 -0
  61. data/lib/kodi_client/types/favourites/get_favourite_returned_type.rb +22 -0
  62. data/lib/kodi_client/types/favourites/type_type.rb +18 -0
  63. data/lib/kodi_client/types/files/file_label_type.rb +20 -0
  64. data/lib/kodi_client/types/files/get_directory_returned_type.rb +22 -0
  65. data/lib/kodi_client/types/files/get_sources_returned_type.rb +22 -0
  66. data/lib/kodi_client/types/files/media_type.rb +18 -0
  67. data/lib/kodi_client/types/files/prepare_download_returned_type.rb +21 -0
  68. data/lib/kodi_client/types/global/direction_type.rb +17 -0
  69. data/lib/kodi_client/types/global/global_time_type.rb +22 -0
  70. data/lib/kodi_client/types/global/id_label_type.rb +20 -0
  71. data/lib/kodi_client/types/global/id_name_type.rb +20 -0
  72. data/lib/kodi_client/types/global/increment_decrement_type.rb +15 -0
  73. data/lib/kodi_client/types/global/next_prev_type.rb +17 -0
  74. data/lib/kodi_client/types/global/password_encryption_type.rb +16 -0
  75. data/lib/kodi_client/types/global/rotate_type.rb +15 -0
  76. data/lib/kodi_client/types/global/toggle_type.rb +16 -0
  77. data/lib/kodi_client/types/gui/gui_window_type.rb +124 -0
  78. data/lib/kodi_client/types/gui/property_name_type.rb +18 -0
  79. data/lib/kodi_client/types/gui/property_value_type.rb +26 -0
  80. data/lib/kodi_client/types/gui/stereoscopy_mode_type.rb +31 -0
  81. data/lib/kodi_client/types/input/input_action_type.rb +212 -0
  82. data/lib/kodi_client/types/{item_types.rb → items/item_details_base_type.rb} +2 -4
  83. data/lib/kodi_client/types/library/library_details_genre_type.rb +27 -0
  84. data/lib/kodi_client/types/library/library_details_source_type.rb +26 -0
  85. data/lib/kodi_client/types/library/library_fields_genre_type.rb +17 -0
  86. data/lib/kodi_client/types/library/library_fields_source_type.rb +17 -0
  87. data/lib/kodi_client/types/list/list_field_files_type.rb +83 -0
  88. data/lib/kodi_client/types/list/list_fields_all_type.rb +96 -0
  89. data/lib/kodi_client/types/list/list_item_all_type.rb +70 -0
  90. data/lib/kodi_client/types/list/list_item_base_type.rb +141 -0
  91. data/lib/kodi_client/types/list/list_item_file_type.rb +66 -0
  92. data/lib/kodi_client/types/list/list_limits_returned_type.rb +23 -0
  93. data/lib/kodi_client/types/list/list_limits_type.rb +23 -0
  94. data/lib/kodi_client/types/list/list_sort_method_type.rb +54 -0
  95. data/lib/kodi_client/types/list/list_sort_type.rb +28 -0
  96. data/lib/kodi_client/types/list/sort_order_type.rb +15 -0
  97. data/lib/kodi_client/types/media/media_artwork_type.rb +26 -0
  98. data/lib/kodi_client/types/media/media_details_base_type.rb +29 -0
  99. data/lib/kodi_client/types/media/media_type_type.rb +16 -0
  100. data/lib/kodi_client/types/player/audio_stream_type.rb +29 -0
  101. data/lib/kodi_client/types/player/player_position_time_type.rb +22 -0
  102. data/lib/kodi_client/types/player/player_repeat_type.rb +17 -0
  103. data/lib/kodi_client/types/player/player_speed_type.rb +26 -0
  104. data/lib/kodi_client/types/player/player_type.rb +24 -0
  105. data/lib/kodi_client/types/player/player_type_type.rb +16 -0
  106. data/lib/kodi_client/types/player/player_view_mode_type.rb +23 -0
  107. data/lib/kodi_client/types/player/player_visibility_type.rb +16 -0
  108. data/lib/kodi_client/types/player/property_name_type.rb +38 -0
  109. data/lib/kodi_client/types/player/property_value_type.rb +60 -0
  110. data/lib/kodi_client/types/player/seek_jump_type.rb +17 -0
  111. data/lib/kodi_client/types/player/seek_returned_type.rb +23 -0
  112. data/lib/kodi_client/types/player/subtitle_type.rb +24 -0
  113. data/lib/kodi_client/types/player/video_stream_type.rb +26 -0
  114. data/lib/kodi_client/types/player/view_mode_type.rb +22 -0
  115. data/lib/kodi_client/types/player/zoom_type.rb +15 -0
  116. data/lib/kodi_client/types/profiles/details_profile_type.rb +24 -0
  117. data/lib/kodi_client/types/profiles/fields_profile_type.rb +15 -0
  118. data/lib/kodi_client/types/profiles/get_profiles_returned_type.rb +22 -0
  119. data/lib/kodi_client/types/profiles/profile_password_type.rb +20 -0
  120. data/lib/kodi_client/types/{pvr_type.rb → pvr/channel_type_type.rb} +2 -4
  121. data/lib/kodi_client/types/system/property_name_type.rb +17 -0
  122. data/lib/kodi_client/types/{system_types.rb → system/property_value_type.rb} +2 -13
  123. data/lib/kodi_client/types/video/stream_details_type.rb +24 -0
  124. data/lib/kodi_client/types/video/video_cast_type.rb +22 -0
  125. data/lib/kodi_client/types/video/video_content_type_type.rb +18 -0
  126. data/lib/kodi_client/types/video/video_details_base_type.rb +29 -0
  127. data/lib/kodi_client/types/video/video_details_file_type.rb +37 -0
  128. data/lib/kodi_client/types/video/video_details_item_type.rb +32 -0
  129. data/lib/kodi_client/types/video/video_details_media_type.rb +28 -0
  130. data/lib/kodi_client/types/video/video_resume_type.rb +20 -0
  131. data/lib/kodi_client.rb +160 -49
  132. metadata +132 -38
  133. data/lib/kodi_client/Chainable.rb +0 -48
  134. data/lib/kodi_client/kodi_module.rb +0 -80
  135. data/lib/kodi_client/method/audio_library.rb +0 -46
  136. data/lib/kodi_client/types/addon_types.rb +0 -177
  137. data/lib/kodi_client/types/application_types.rb +0 -52
  138. data/lib/kodi_client/types/audio_types.rb +0 -221
  139. data/lib/kodi_client/types/favourites_types.rb +0 -61
  140. data/lib/kodi_client/types/files_types.rb +0 -63
  141. data/lib/kodi_client/types/global_types.rb +0 -102
  142. data/lib/kodi_client/types/gui_types.rb +0 -179
  143. data/lib/kodi_client/types/input_types.rb +0 -214
  144. data/lib/kodi_client/types/list_types.rb +0 -542
  145. data/lib/kodi_client/types/media_types.rb +0 -53
  146. data/lib/kodi_client/types/player_type.rb +0 -294
  147. data/lib/kodi_client/types/profiles_types.rb +0 -65
  148. data/lib/kodi_client/types/video_types.rb +0 -150
  149. data/lib/kodi_client/util/comparable.rb +0 -20
  150. data/lib/kodi_client/util/creatable.rb +0 -106
  151. data/lib/kodi_client/util/iterable.rb +0 -11
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Fields.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.All
7
+ module ListFieldsAll
8
+ extend Extensions::Iterable
9
+
10
+ ALBUM = 'album'
11
+ ALBUM_ARTIST = 'albumartist'
12
+ ALBUM_ARTIST_ID = 'albumartistid'
13
+ ALBUM_ID = 'albumid'
14
+ ALBUM_LABEL = 'albumlabel'
15
+ ALBUM_RELEASE_TYPE = 'albumreleasetype'
16
+ ART = 'art'
17
+ ARTIST = 'artist'
18
+ ARTIST_ID = 'artistid'
19
+ CAST = 'cast'
20
+ CHANNEL = 'channel'
21
+ CHANNEL_NUMBER = 'channelnumber'
22
+ CHANNEL_TYPE = 'channeltype'
23
+ COMMENT = 'comment'
24
+ COMPILATION = 'compilation'
25
+ CONTRIBUTORS = 'contributors'
26
+ COUNTRY = 'country'
27
+ DATE_ADDED = 'dateadded'
28
+ DESCRIPTION = 'description'
29
+ DIRECTOR = 'director'
30
+ DISC = 'disc'
31
+ DISPLAY_ARTIST = 'displayartist'
32
+ DISPLAY_COMPOSER = 'displaycomposer'
33
+ DISPLAY_CONDUCTOR = 'displayconductor'
34
+ DISPLAY_LYRICIST = 'displaylyricist'
35
+ DISPLAY_ORCHESTRA = 'displayorchestra'
36
+ DURATION = 'duration'
37
+ END_TIME = 'endtime'
38
+ EPISODE = 'episode'
39
+ EPISODE_GUIDE = 'episodeguide'
40
+ FAN_ART = 'fanart'
41
+ FILE = 'file'
42
+ FIRST_AIRED = 'firstaired'
43
+ GENRE = 'genre'
44
+ GENRE_ID = 'genreid'
45
+ HIDDEN = 'hidden'
46
+ IMDB_NUMBER = 'imdbnumber'
47
+ LAST_PLAYED = 'lastplayed'
48
+ LOCKED = 'locked'
49
+ LYRICS = 'lyrics'
50
+ MOOD = 'mood'
51
+ MPAA = 'mpaa'
52
+ MUSICBRAINZ_ALBUM_ARTIST_ID = 'musicbrainzalbumartistid'
53
+ MUSICBRAINZ_ALBUM_ID = 'musicbrainzalbumid'
54
+ MUSICBRAINZ_ARTIST_ID = 'musicbrainzartistid'
55
+ MUSICBRAINZ_TRACK_ID = 'musicbrainztrackid'
56
+ ORIGINAL_TITLE = 'originaltitle'
57
+ PLAY_COUNT = 'playcount'
58
+ PLOT = 'plot'
59
+ PLOT_OUTLINE = 'plotoutline'
60
+ PREMIERED = 'premiered'
61
+ PRODUCTION_CODE = 'productioncode'
62
+ RATING = 'rating'
63
+ RELEASE_TYPE = 'releasetype'
64
+ RESUME = 'resume'
65
+ RUNTIME = 'runtime'
66
+ SEASON = 'season'
67
+ SET = 'set'
68
+ SET_ID = 'setid'
69
+ SHOW_LINK = 'showlink'
70
+ SHOW_TITLE = 'showtitle'
71
+ SORT_TITLE = 'sorttitle'
72
+ SPECIAL_SORT_EPISODE = 'specialsortepisode'
73
+ SPECIAL_SORT_SEASON = 'specialsortseason'
74
+ START_TIME = 'starttime'
75
+ STREAM_DETAILS = 'streamdetails'
76
+ STUDIO = 'studio'
77
+ STYLE = 'style'
78
+ TAG = 'tag'
79
+ TAGLINE = 'tagline'
80
+ THEME = 'theme'
81
+ THUMBNAIL = 'thumbnail'
82
+ TITLE = 'title'
83
+ TOP250 = 'top250'
84
+ TRACK = 'track'
85
+ TRAILER = 'trailer'
86
+ TV_SHOW_ID = 'tvshowid'
87
+ UNIQUE_ID = 'uniqueid'
88
+ USER_RATING = 'userrating'
89
+ VOTES = 'votes'
90
+ WATCHED_EPISODES = 'watchedepisodes'
91
+ WRITER = 'writer'
92
+ YEAR = 'year'
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Item.All https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.All
7
+ class ListItemAll
8
+ include ListItemBase
9
+ include Extensions::Comparable
10
+ extend Extensions::Creatable
11
+
12
+ attr_reader :channel, :channel_number, :channel_type, :end_time, :hidden, :locked, :start_time,
13
+ :sub_channel_number
14
+
15
+ fields_to_map %w[channel channel_number channel_type end_time hidden locked start_time sub_channel_number
16
+ album album_artist album_artist_id album_id album_release_type album_status bit_rate
17
+ bpm cast channels comment compilation contributors country description disc
18
+ disc_title display_composer display_conductor display_lyricist display_orchestra
19
+ duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
20
+ lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
21
+ original_title plot_outline premiered production_code release_date release_type
22
+ sample_rate season set set_id show_link show_title sort_title special_sort_episode
23
+ special_sort_season studio style tag tag_line theme top250 total_discs track
24
+ trailer tv_show_id type unique_id votes watched_episodes writer director resume
25
+ runtime stream_details date_added file last_played plot title art play_count
26
+ fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
27
+ rating sort_artist user_rating year genre]
28
+
29
+ type_mapping(*list_item_base_mappings)
30
+
31
+ def initialize(channel, channel_number, channel_type, end_time, hidden, locked, start_time, sub_channel_number,
32
+ album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
33
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
34
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
35
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
36
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
37
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
38
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
39
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
40
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
41
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
42
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
43
+ rating, sort_artist, user_rating, year, genre)
44
+ @channel = channel
45
+ @channel_number = channel_number
46
+ @channel_type = channel_type
47
+ @end_time = end_time
48
+ @hidden = hidden
49
+ @locked = locked
50
+ @start_time = start_time
51
+ @sub_channel_number = sub_channel_number
52
+ type = type.nil? ? 'unknown' : type
53
+
54
+ list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
55
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
56
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
57
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
58
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
59
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
60
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
61
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
62
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
63
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
64
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
65
+ rating, sort_artist, user_rating, year, genre)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Item.Base https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.Base
7
+ module ListItemBase
8
+ include Video::VideoDetailsFile
9
+ include Audio::AudioDetailsMedia
10
+
11
+ def self.included(base)
12
+ base.extend(self)
13
+ end
14
+
15
+ attr_reader :album, :album_artist, :album_artist_id, :album_id, :album_release_type, :album_status, :bit_rate,
16
+ :bpm, :cast, :channels, :comment, :compilation, :contributors, :country, :description, :disc,
17
+ :disc_title, :display_composer, :display_conductor, :display_lyricist, :display_orchestra,
18
+ :duration, :dyn_path, :episode, :episode_guide, :first_aired, :id, :imdb_number, :is_box_set,
19
+ :lyrics, :media_path, :mood, :mpaa, :musicbrainz_artist_id, :musicbrainz_track_id, :original_date,
20
+ :original_title, :plot_outline, :premiered, :production_code, :release_date, :release_type,
21
+ :sample_rate, :season, :set, :set_id, :show_link, :show_title, :sort_title, :special_sort_episode,
22
+ :special_sort_season, :studio, :style, :tag, :tag_line, :theme, :top250, :total_discs, :track,
23
+ :trailer, :tv_show_id, :type, :unique_id, :votes, :watched_episodes, :writer
24
+
25
+ def list_item_base_mappings
26
+ [
27
+ ['cast', Video::VideoCast, true],
28
+ ['contributors', Audio::AudioContributor, true],
29
+ ['resume', Video::VideoResume],
30
+ ['streamdetails', Video::StreamDetails],
31
+ ['art', Media::MediaArtwork]
32
+ ] + video_details_file_mappings + audio_details_media_mappings
33
+ end
34
+
35
+ def list_item_base_by_hash(hash)
36
+ return nil if hash.nil?
37
+
38
+ list_item_base(*Extensions::Creatable.hash_to_arr(
39
+ hash, %w[album album_artist album_artist_id album_id album_release_type album_status bit_rate
40
+ bpm cast channels comment compilation contributors country description disc
41
+ disc_title display_composer display_conductor display_lyricist display_orchestra
42
+ duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
43
+ lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
44
+ original_title plot_outline premiered production_code release_date release_type
45
+ sample_rate season set set_id show_link show_title sort_title special_sort_episode
46
+ special_sort_season studio style tag tag_line theme top250 total_discs track
47
+ trailer tv_show_id type unique_id votes watched_episodes writer director resume
48
+ runtime stream_details date_added file last_played plot title art play_count
49
+ fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
50
+ rating sort_artist user_rating year genre], list_item_base_mappings
51
+ ))
52
+ end
53
+
54
+ def list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
55
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
56
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
57
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
58
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
59
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
60
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
61
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
62
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
63
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
64
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
65
+ rating, sort_artist, user_rating, year, genre)
66
+ @album = album
67
+ @album_artist = album_artist
68
+ @album_artist_id = album_artist_id
69
+ @album_id = album_id
70
+ @album_release_type = album_release_type
71
+ @album_status = album_status
72
+ @bit_rate = bit_rate
73
+ @bpm = bpm
74
+ @cast = cast
75
+ @channels = channels
76
+ @comment = comment
77
+ @compilation = compilation
78
+ @contributors = contributors
79
+ @country = country
80
+ @description = description
81
+ @disc = disc
82
+ @disc_title = disc_title
83
+ @display_composer = display_composer
84
+ @display_conductor = display_conductor
85
+ @display_lyricist = display_lyricist
86
+ @display_orchestra = display_orchestra
87
+ @duration = duration
88
+ @dyn_path = dyn_path
89
+ @episode = episode
90
+ @episode_guide = episode_guide
91
+ @first_aired = first_aired
92
+ @id = id
93
+ @imdb_number = imdb_number
94
+ @is_box_set = is_box_set
95
+ @lyrics = lyrics
96
+ @media_path = media_path
97
+ @mood = mood
98
+ @mpaa = mpaa
99
+ @musicbrainz_artist_id = musicbrainz_artist_id
100
+ @musicbrainz_track_id = musicbrainz_track_id
101
+ @original_date = original_date
102
+ @original_title = original_title
103
+ @plot_outline = plot_outline
104
+ @premiered = premiered
105
+ @production_code = production_code
106
+ @release_date = release_date
107
+ @release_type = release_type
108
+ @sample_rate = sample_rate
109
+ @season = season
110
+ @set = set
111
+ @set_id = set_id
112
+ @show_link = show_link
113
+ @show_title = show_title
114
+ @sort_title = sort_title
115
+ @special_sort_episode = special_sort_episode
116
+ @special_sort_season = special_sort_season
117
+ @studio = studio
118
+ @style = style
119
+ @tag = tag
120
+ @tag_line = tag_line
121
+ @theme = theme
122
+ @top250 = top250
123
+ @total_discs = total_discs
124
+ @track = track
125
+ @trailer = trailer
126
+ @tv_show_id = tv_show_id
127
+ @type = type
128
+ @unique_id = unique_id
129
+ @votes = votes
130
+ @watched_episodes = watched_episodes
131
+ @writer = writer
132
+ video_details_file(director, resume, runtime, stream_details, date_added, file, last_played, plot, title,
133
+ art, play_count, fan_art, thumbnail, label)
134
+ audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date, rating,
135
+ release_date, sort_artist, title, user_rating, votes, year, art, date_added, genre,
136
+ fan_art, thumbnail, label)
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Item.File https://kodi.wiki/view/JSON-RPC_API/v12#List.Item.File
7
+ class ListItemFile
8
+ include ListItemBase
9
+ include Extensions::Comparable
10
+ extend Extensions::Creatable
11
+
12
+ attr_reader :file, :file_type, :last_modified, :mime_type, :size
13
+
14
+ fields_to_map %w[file_type last_modified mime_type size
15
+ album album_artist album_artist_id album_id album_release_type album_status bit_rate
16
+ bpm cast channels comment compilation contributors country description disc
17
+ disc_title display_composer display_conductor display_lyricist display_orchestra
18
+ duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
19
+ lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
20
+ original_title plot_outline premiered production_code release_date release_type
21
+ sample_rate season set set_id show_link show_title sort_title special_sort_episode
22
+ special_sort_season studio style tag tag_line theme top250 total_discs track
23
+ trailer tv_show_id type unique_id votes watched_episodes writer director resume
24
+ runtime stream_details date_added file last_played plot title art play_count
25
+ fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
26
+ rating sort_artist user_rating year genre]
27
+
28
+ type_mapping(*list_item_base_mappings)
29
+
30
+
31
+ def initialize(file_type, last_modified, mime_type, size,
32
+ album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
33
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
34
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
35
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
36
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
37
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
38
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
39
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
40
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
41
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
42
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
43
+ rating, sort_artist, user_rating, year, genre)
44
+ @file = file
45
+ @file_type = file_type
46
+ @last_modified = last_modified
47
+ @mime_type = mime_type
48
+ @size = size
49
+ type = type.nil? ? 'unknown' : type
50
+ list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
51
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
52
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
53
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
54
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
55
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
56
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
57
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
58
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
59
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
60
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
61
+ rating, sort_artist, user_rating, year, genre)
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.LimitsReturned https://kodi.wiki/view/JSON-RPC_API/v12#List.LimitsReturned
7
+ class ListLimitsReturned
8
+ include Extensions::Comparable
9
+ extend Extensions::Creatable
10
+
11
+ attr_reader :list_start, :list_end, :total
12
+
13
+ fields_to_map %w[start end total]
14
+
15
+ def initialize(list_start, list_end, total)
16
+ @list_start = list_start
17
+ @list_end = list_end
18
+ @total = total
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Limits https://kodi.wiki/view/JSON-RPC_API/v12#List.Limits
7
+ class ListLimits
8
+ include Extensions::Comparable
9
+
10
+ attr_reader :list_start, :list_end
11
+
12
+ def initialize(list_start, list_end)
13
+ @list_start = list_start
14
+ @list_end = list_end
15
+ end
16
+
17
+ def to_h
18
+ { 'start' => @list_start, 'end' => @list_end }
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # methods for list sorting https://kodi.wiki/view/JSON-RPC_API/v12#List.Sort
7
+ module ListSortMethod
8
+ extend Extensions::Iterable
9
+
10
+ NONE = 'none'
11
+ LABEL = 'label'
12
+ DATE = 'date'
13
+ SIZE = 'size'
14
+ FILE = 'file'
15
+ PATH = 'path'
16
+ DRIVE_TYPE = 'drivetype'
17
+ TITLE = 'title'
18
+ TRACK = 'track'
19
+ TIME = 'time'
20
+ ARTIST = 'artist'
21
+ ALBUM = 'album'
22
+ ALBUM_TYPE = 'albumtype'
23
+ GENRE = 'genre'
24
+ COUNTRY = 'country'
25
+ YEAR = 'year'
26
+ RATING = 'rating'
27
+ USER_RATING = 'userrating'
28
+ VOTES = 'votes'
29
+ TOP_250 = 'top250'
30
+ PROGRAM_COUNT = 'programcount'
31
+ PLAYLIST = 'playlist'
32
+ EPISODE = 'episode'
33
+ SEASON = 'season'
34
+ TOTAL_EPISODES = 'totalepisodes'
35
+ WATCHED_EPISODES = 'watchedepisodes'
36
+ TV_SHOW_STATUS = 'tvshowstatus'
37
+ TV_SHOW_TITLE = 'tvshowtitle'
38
+ SORT_TITLE = 'sorttitle'
39
+ PRODUCTION_CODE = 'productioncode'
40
+ MPAA = 'mpaa'
41
+ STUDIO = 'studio'
42
+ DATE_ADDED = 'dateadded'
43
+ LAST_PLAYED = 'lastplayed'
44
+ PLAY_COUNT = 'playcount'
45
+ LISTENERS = 'listeners'
46
+ BITRATE = 'bitrate'
47
+ RANDOM = 'random'
48
+ TOTAL_DISCS = 'totaldiscs'
49
+ ORIGINAL_DATE = 'originaldate'
50
+ BPM = 'bpm'
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # List.Sort https://kodi.wiki/view/JSON-RPC_API/v12#List.Sort
7
+ class ListSort
8
+ include Extensions::Comparable
9
+
10
+ attr_reader :ignore_article, :method, :order, :use_artist_sort_name
11
+
12
+ def initialize(ignore_article = false, method = ListSortMethod::NONE,
13
+ sort_order = SortOrder::ASCENDING, use_artist_sort_name = false)
14
+ @ignore_article = ignore_article
15
+ @method = method
16
+ @order = sort_order
17
+ @use_artist_sort_name = use_artist_sort_name
18
+ end
19
+
20
+ def to_h
21
+ { 'ignorearticle' => @ignore_article, 'method' => @method,
22
+ 'order' => @order,
23
+ 'useartistsortname' => @use_artist_sort_name }
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module List
6
+ # ascending/descending for sorting https://kodi.wiki/view/JSON-RPC_API/v12#List.Sort
7
+ module SortOrder
8
+ extend Extensions::Iterable
9
+
10
+ ASCENDING = 'ascending'
11
+ DESCENDING = 'descending'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Media
6
+ # Media.Artwork https://kodi.wiki/view/JSON-RPC_API/v12#Media.Artwork
7
+ class MediaArtwork
8
+ include Extensions::Comparable
9
+ extend Extensions::Creatable
10
+
11
+ attr_reader :banner, :fan_art, :poster, :thumb
12
+
13
+ def initialize(banner, fan_art, poster, thumb)
14
+ @banner = banner
15
+ @fan_art = fan_art
16
+ @poster = poster
17
+ @thumb = thumb
18
+ end
19
+
20
+ def to_h
21
+ { 'banner' => @banner, 'fanart' => @fan_art, 'poster' => @poster, 'thumb' => @thumb }
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Media
6
+ # Media.Details.Base https://kodi.wiki/view/JSON-RPC_API/v12#Media.Details.Base
7
+ module MediaDetailsBase
8
+ include Items::ItemDetailsBase
9
+
10
+ attr_reader :fan_art, :thumbnail
11
+
12
+ def media_details_base_mappings
13
+ item_details_base_mappings
14
+ end
15
+
16
+ def media_details_base_by_hash(hash)
17
+ media_details_base(*Extensions::Creatable.hash_to_arr(hash, %w[fan_art thumbnail label]),
18
+ media_details_base_mappings)
19
+ end
20
+
21
+ def media_details_base(fan_art, thumbnail, label)
22
+ @fan_art = fan_art
23
+ @thumbnail = thumbnail
24
+ item_details_base(label)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Media
6
+ # media types
7
+ module MediaType
8
+ extend Extensions::Iterable
9
+
10
+ VIDEO = 'video'
11
+ AUDIO = 'audio'
12
+ ALL = 'all'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Player
6
+ # Player.Audio.Stream https://kodi.wiki/view/JSON-RPC_API/v12#Player.Audio.Stream
7
+ class AudioStream
8
+ include Extensions::Comparable
9
+ extend Extensions::Creatable
10
+
11
+ attr_reader :bitrate, :channels, :codec, :index, :is_default, :is_forced, :is_original, :language,
12
+ :name, :sample_rate
13
+
14
+ def initialize(bitrate, channels, codec, index, is_default, is_forced, is_original, language, name, sample_rate)
15
+ @bitrate = bitrate
16
+ @channels = channels
17
+ @codec = codec
18
+ @index = index
19
+ @is_default = is_default
20
+ @is_forced = is_forced
21
+ @is_original = is_original
22
+ @language = language
23
+ @name = name
24
+ @sample_rate = sample_rate
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Player
6
+ # Player.Position.Time https://kodi.wiki/view/JSON-RPC_API/v12#Player.Position.Time
7
+ class PlayerPositionTime
8
+ include Extensions::Comparable
9
+ extend Extensions::Creatable
10
+
11
+ attr_reader :hours, :minutes, :seconds, :milliseconds
12
+
13
+ def initialize(hours, minutes, seconds, milliseconds)
14
+ @hours = hours
15
+ @minutes = minutes
16
+ @seconds = seconds
17
+ @milliseconds = milliseconds
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KodiClient
4
+ module Types
5
+ module Player
6
+ # Player.Repeat https://kodi.wiki/view/JSON-RPC_API/v12#Player.Repeat
7
+ module PlayerRepeat
8
+ extend Extensions::Iterable
9
+
10
+ OFF = 'off'
11
+ ONE = 'one'
12
+ ALL = 'all'
13
+ CYCLE = 'cycle'
14
+ end
15
+ end
16
+ end
17
+ end