kodi_client 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +4 -4
  14. data/lib/kodi_client/{method → methods}/application.rb +2 -2
  15. data/lib/kodi_client/{method → methods}/audio_library.rb +2 -2
  16. data/lib/kodi_client/{method → methods}/favourites.rb +2 -2
  17. data/lib/kodi_client/{method → methods}/files.rb +2 -2
  18. data/lib/kodi_client/{method → methods}/gui.rb +2 -2
  19. data/lib/kodi_client/{method → methods}/input.rb +2 -2
  20. data/lib/kodi_client/{method → methods}/player.rb +2 -2
  21. data/lib/kodi_client/{method → methods}/profiles.rb +2 -2
  22. data/lib/kodi_client/{method → methods}/system.rb +2 -2
  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/types/{item_types.rb → items/item_details_base_type.rb} +1 -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/types/{pvr_type.rb → pvr/channel_type_type.rb} +2 -4
  100. data/lib/kodi_client/types/system/property_name_type.rb +17 -0
  101. data/lib/kodi_client/types/{system_types.rb → system/property_value_type.rb} +2 -13
  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 -49
  110. metadata +107 -34
  111. data/lib/kodi_client/Chainable.rb +0 -48
  112. data/lib/kodi_client/kodi_module.rb +0 -80
  113. data/lib/kodi_client/types/addon_types.rb +0 -177
  114. data/lib/kodi_client/types/application_types.rb +0 -52
  115. data/lib/kodi_client/types/audio_types.rb +0 -221
  116. data/lib/kodi_client/types/favourites_types.rb +0 -61
  117. data/lib/kodi_client/types/files_types.rb +0 -63
  118. data/lib/kodi_client/types/global_types.rb +0 -102
  119. data/lib/kodi_client/types/gui_types.rb +0 -179
  120. data/lib/kodi_client/types/input_types.rb +0 -214
  121. data/lib/kodi_client/types/list_types.rb +0 -542
  122. data/lib/kodi_client/types/media_types.rb +0 -53
  123. data/lib/kodi_client/types/player_type.rb +0 -294
  124. data/lib/kodi_client/types/profiles_types.rb +0 -65
  125. data/lib/kodi_client/types/video_types.rb +0 -150
  126. data/lib/kodi_client/util/comparable.rb +0 -20
  127. data/lib/kodi_client/util/creatable.rb +0 -106
  128. 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,73 @@
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
+ extend ListItemBase
12
+
13
+ attr_reader :channel, :channel_number, :channel_type, :end_time, :hidden, :locked, :start_time,
14
+ :sub_channel_number
15
+
16
+ fields_to_map %w[channel channel_number channel_type end_time hidden locked start_time sub_channel_number
17
+ album album_artist album_artist_id album_id album_release_type album_status bit_rate
18
+ bpm cast channels comment compilation contributors country description disc
19
+ disc_title display_composer display_conductor display_lyricist display_orchestra
20
+ duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
21
+ lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
22
+ original_title plot_outline premiered production_code release_date release_type
23
+ sample_rate season set set_id show_link show_title sort_title special_sort_episode
24
+ special_sort_season studio style tag tag_line theme top250 total_discs track
25
+ trailer tv_show_id type unique_id votes watched_episodes writer director resume
26
+ runtime stream_details date_added file last_played plot title art play_count
27
+ fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
28
+ rating sort_artist user_rating year genre]
29
+
30
+ def self.lazy_type_mapping
31
+ list_item_base_mappings
32
+ end
33
+
34
+ def initialize(channel, channel_number, channel_type, end_time, hidden, locked, start_time, sub_channel_number,
35
+ album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
36
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
37
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
38
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
39
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
40
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
41
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
42
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
43
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
44
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
45
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
46
+ rating, sort_artist, user_rating, year, genre)
47
+ @channel = channel
48
+ @channel_number = channel_number
49
+ @channel_type = channel_type
50
+ @end_time = end_time
51
+ @hidden = hidden
52
+ @locked = locked
53
+ @start_time = start_time
54
+ @sub_channel_number = sub_channel_number
55
+ type = type.nil? ? 'unknown' : type
56
+
57
+ list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
58
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
59
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
60
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
61
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
62
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
63
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
64
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
65
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
66
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
67
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
68
+ rating, sort_artist, user_rating, year, genre)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,138 @@
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
+ attr_reader :album, :album_artist, :album_artist_id, :album_id, :album_release_type, :album_status, :bit_rate,
12
+ :bpm, :cast, :channels, :comment, :compilation, :contributors, :country, :description, :disc,
13
+ :disc_title, :display_composer, :display_conductor, :display_lyricist, :display_orchestra,
14
+ :duration, :dyn_path, :episode, :episode_guide, :first_aired, :id, :imdb_number, :is_box_set,
15
+ :lyrics, :media_path, :mood, :mpaa, :musicbrainz_artist_id, :musicbrainz_track_id, :original_date,
16
+ :original_title, :plot_outline, :premiered, :production_code, :release_date, :release_type,
17
+ :sample_rate, :season, :set, :set_id, :show_link, :show_title, :sort_title, :special_sort_episode,
18
+ :special_sort_season, :studio, :style, :tag, :tag_line, :theme, :top250, :total_discs, :track,
19
+ :trailer, :tv_show_id, :type, :unique_id, :votes, :watched_episodes, :writer
20
+
21
+ def list_item_base_mappings
22
+ mappings = {
23
+ 'cast' => Extensions::Creatable::CreateMap.new(Video::VideoCast, true),
24
+ 'contributors' => Extensions::Creatable::CreateMap.new(Audio::AudioContributor, true),
25
+ 'resume' => Extensions::Creatable::CreateMap.new(Video::VideoResume),
26
+ 'streamdetails' => Extensions::Creatable::CreateMap.new(Video::StreamDetails),
27
+ 'art' => Extensions::Creatable::CreateMap.new(Media::MediaArtwork)
28
+ }
29
+ mappings.merge(video_details_file_mappings).merge(audio_details_media_mappings)
30
+ end
31
+
32
+ def list_item_base_by_hash(hash)
33
+ return nil if hash.nil?
34
+
35
+ list_item_base(*Extensions::Creatable.hash_to_arr(
36
+ hash, %w[album album_artist album_artist_id album_id album_release_type album_status bit_rate
37
+ bpm cast channels comment compilation contributors country description disc
38
+ disc_title display_composer display_conductor display_lyricist display_orchestra
39
+ duration dyn_path episode episode_guide first_aired id imdb_number is_box_set
40
+ lyrics media_path mood mpaa musicbrainz_artist_id musicbrainz_track_id original_date
41
+ original_title plot_outline premiered production_code release_date release_type
42
+ sample_rate season set set_id show_link show_title sort_title special_sort_episode
43
+ special_sort_season studio style tag tag_line theme top250 total_discs track
44
+ trailer tv_show_id type unique_id votes watched_episodes writer director resume
45
+ runtime stream_details date_added file last_played plot title art play_count
46
+ fan_art thumbnail label artist artist_id display_artist musicbrainz_album_artist_id
47
+ rating sort_artist user_rating year genre], list_item_base_mappings
48
+ ))
49
+ end
50
+
51
+ def list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
52
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
53
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
54
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
55
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
56
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
57
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
58
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
59
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
60
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
61
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
62
+ rating, sort_artist, user_rating, year, genre)
63
+ @album = album
64
+ @album_artist = album_artist
65
+ @album_artist_id = album_artist_id
66
+ @album_id = album_id
67
+ @album_release_type = album_release_type
68
+ @album_status = album_status
69
+ @bit_rate = bit_rate
70
+ @bpm = bpm
71
+ @cast = cast
72
+ @channels = channels
73
+ @comment = comment
74
+ @compilation = compilation
75
+ @contributors = contributors
76
+ @country = country
77
+ @description = description
78
+ @disc = disc
79
+ @disc_title = disc_title
80
+ @display_composer = display_composer
81
+ @display_conductor = display_conductor
82
+ @display_lyricist = display_lyricist
83
+ @display_orchestra = display_orchestra
84
+ @duration = duration
85
+ @dyn_path = dyn_path
86
+ @episode = episode
87
+ @episode_guide = episode_guide
88
+ @first_aired = first_aired
89
+ @id = id
90
+ @imdb_number = imdb_number
91
+ @is_box_set = is_box_set
92
+ @lyrics = lyrics
93
+ @media_path = media_path
94
+ @mood = mood
95
+ @mpaa = mpaa
96
+ @musicbrainz_artist_id = musicbrainz_artist_id
97
+ @musicbrainz_track_id = musicbrainz_track_id
98
+ @original_date = original_date
99
+ @original_title = original_title
100
+ @plot_outline = plot_outline
101
+ @premiered = premiered
102
+ @production_code = production_code
103
+ @release_date = release_date
104
+ @release_type = release_type
105
+ @sample_rate = sample_rate
106
+ @season = season
107
+ @set = set
108
+ @set_id = set_id
109
+ @show_link = show_link
110
+ @show_title = show_title
111
+ @sort_title = sort_title
112
+ @special_sort_episode = special_sort_episode
113
+ @special_sort_season = special_sort_season
114
+ @studio = studio
115
+ @style = style
116
+ @tag = tag
117
+ @tag_line = tag_line
118
+ @theme = theme
119
+ @top250 = top250
120
+ @total_discs = total_discs
121
+ @track = track
122
+ @trailer = trailer
123
+ @tv_show_id = tv_show_id
124
+ @type = type
125
+ @unique_id = unique_id
126
+ @votes = votes
127
+ @watched_episodes = watched_episodes
128
+ @writer = writer
129
+ video_details_file(director, resume, runtime, stream_details, date_added, file, last_played, plot, title,
130
+ art, play_count, fan_art, thumbnail, label)
131
+ audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date, rating,
132
+ release_date, sort_artist, title, user_rating, votes, year, art, date_added, genre,
133
+ fan_art, thumbnail, label)
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,68 @@
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
+ extend ListItemBase
12
+
13
+ attr_reader :file, :file_type, :last_modified, :mime_type, :size
14
+
15
+ fields_to_map %w[file_type last_modified mime_type size
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
+ def self.lazy_type_mapping
30
+ list_item_base_mappings
31
+ end
32
+
33
+ def initialize(file_type, last_modified, mime_type, size,
34
+ album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
35
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
36
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
37
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
38
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
39
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
40
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
41
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
42
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
43
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
44
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
45
+ rating, sort_artist, user_rating, year, genre)
46
+ @file = file
47
+ @file_type = file_type
48
+ @last_modified = last_modified
49
+ @mime_type = mime_type
50
+ @size = size
51
+ type = type.nil? ? 'unknown' : type
52
+ list_item_base(album, album_artist, album_artist_id, album_id, album_release_type, album_status, bit_rate,
53
+ bpm, cast, channels, comment, compilation, contributors, country, description, disc,
54
+ disc_title, display_composer, display_conductor, display_lyricist, display_orchestra,
55
+ duration, dyn_path, episode, episode_guide, first_aired, id, imdb_number, is_box_set,
56
+ lyrics, media_path, mood, mpaa, musicbrainz_artist_id, musicbrainz_track_id, original_date,
57
+ original_title, plot_outline, premiered, production_code, release_date, release_type,
58
+ sample_rate, season, set, set_id, show_link, show_title, sort_title, special_sort_episode,
59
+ special_sort_season, studio, style, tag, tag_line, theme, top250, total_discs, track,
60
+ trailer, tv_show_id, type, unique_id, votes, watched_episodes, writer, director, resume,
61
+ runtime, stream_details, date_added, file, last_played, plot, title, art, play_count,
62
+ fan_art, thumbnail, label, artist, artist_id, display_artist, musicbrainz_album_artist_id,
63
+ rating, sort_artist, user_rating, year, genre)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ 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,19 @@
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
+ end
17
+ end
18
+ end
19
+ 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,22 @@
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
+ end
20
+ end
21
+ end
22
+ 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,22 @@
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
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
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]), media_details_base_mappings)
18
+ end
19
+
20
+ def media_details_base(fan_art, thumbnail, label)
21
+ @fan_art = fan_art
22
+ @thumbnail = thumbnail
23
+ item_details_base(label)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ 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