kodi_client 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/kodi_client.gemspec +1 -1
- data/lib/kodi_client/extensions/chainable.rb +71 -0
- data/lib/kodi_client/extensions/comparable.rb +29 -0
- data/lib/kodi_client/extensions/creatable.rb +137 -0
- data/lib/kodi_client/extensions/iterable.rb +14 -0
- data/lib/kodi_client/kodi_error.rb +14 -0
- data/lib/kodi_client/kodi_method.rb +34 -0
- data/lib/kodi_client/{options.rb → kodi_options.rb} +1 -1
- data/lib/kodi_client/kodi_request.rb +16 -0
- data/lib/kodi_client/kodi_response.rb +21 -0
- data/lib/kodi_client/{method → methods}/addons.rb +4 -4
- data/lib/kodi_client/{method → methods}/application.rb +2 -2
- data/lib/kodi_client/{method → methods}/audio_library.rb +2 -2
- data/lib/kodi_client/{method → methods}/favourites.rb +2 -2
- data/lib/kodi_client/{method → methods}/files.rb +2 -2
- data/lib/kodi_client/{method → methods}/gui.rb +2 -2
- data/lib/kodi_client/{method → methods}/input.rb +2 -2
- data/lib/kodi_client/{method → methods}/player.rb +2 -2
- data/lib/kodi_client/{method → methods}/profiles.rb +2 -2
- data/lib/kodi_client/{method → methods}/system.rb +2 -2
- data/lib/kodi_client/types/addons/addon_content_type.rb +18 -0
- data/lib/kodi_client/types/addons/addon_dependency_type.rb +21 -0
- data/lib/kodi_client/types/addons/addon_details_type.rb +44 -0
- data/lib/kodi_client/types/addons/addon_extra_info_type.rb +20 -0
- data/lib/kodi_client/types/addons/addon_fields_type.rb +28 -0
- data/lib/kodi_client/types/addons/addon_types_type.rb +48 -0
- data/lib/kodi_client/types/addons/get_addon_returned_type.rb +21 -0
- data/lib/kodi_client/types/addons/get_addons_returned_type.rb +22 -0
- data/lib/kodi_client/types/application/property_name_type.rb +19 -0
- data/lib/kodi_client/types/application/property_value_type.rb +24 -0
- data/lib/kodi_client/types/application/version_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_album_release_type_type.rb +15 -0
- data/lib/kodi_client/types/audio/audio_contributor_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_details_base_type.rb +31 -0
- data/lib/kodi_client/types/audio/audio_details_media_type.rb +45 -0
- data/lib/kodi_client/types/audio/audio_fields_album_type.rb +51 -0
- data/lib/kodi_client/types/audio/details_album_type.rb +58 -0
- data/lib/kodi_client/types/audio/genre_type.rb +20 -0
- data/lib/kodi_client/types/audio/get_albums_returned_type.rb +22 -0
- data/lib/kodi_client/types/favourites/details_favourite_type.rb +24 -0
- data/lib/kodi_client/types/favourites/fields_favourite_type.rb +17 -0
- data/lib/kodi_client/types/favourites/get_favourite_returned_type.rb +22 -0
- data/lib/kodi_client/types/favourites/type_type.rb +18 -0
- data/lib/kodi_client/types/files/file_label_type.rb +20 -0
- data/lib/kodi_client/types/files/get_directory_returned_type.rb +22 -0
- data/lib/kodi_client/types/files/get_sources_returned_type.rb +22 -0
- data/lib/kodi_client/types/files/media_type.rb +18 -0
- data/lib/kodi_client/types/files/prepare_download_returned_type.rb +21 -0
- data/lib/kodi_client/types/global/direction_type.rb +17 -0
- data/lib/kodi_client/types/global/global_time_type.rb +22 -0
- data/lib/kodi_client/types/global/id_label_type.rb +20 -0
- data/lib/kodi_client/types/global/id_name_type.rb +20 -0
- data/lib/kodi_client/types/global/increment_decrement_type.rb +15 -0
- data/lib/kodi_client/types/global/next_prev_type.rb +17 -0
- data/lib/kodi_client/types/global/password_encryption_type.rb +16 -0
- data/lib/kodi_client/types/global/rotate_type.rb +15 -0
- data/lib/kodi_client/types/global/toggle_type.rb +16 -0
- data/lib/kodi_client/types/gui/gui_window_type.rb +124 -0
- data/lib/kodi_client/types/gui/property_name_type.rb +18 -0
- data/lib/kodi_client/types/gui/property_value_type.rb +26 -0
- data/lib/kodi_client/types/gui/stereoscopy_mode_type.rb +31 -0
- data/lib/kodi_client/types/input/input_action_type.rb +212 -0
- data/lib/kodi_client/types/{item_types.rb → items/item_details_base_type.rb} +1 -3
- data/lib/kodi_client/types/list/list_field_files_type.rb +83 -0
- data/lib/kodi_client/types/list/list_fields_all_type.rb +96 -0
- data/lib/kodi_client/types/list/list_item_all_type.rb +73 -0
- data/lib/kodi_client/types/list/list_item_base_type.rb +138 -0
- data/lib/kodi_client/types/list/list_item_file_type.rb +68 -0
- data/lib/kodi_client/types/list/list_limits_returned_type.rb +23 -0
- data/lib/kodi_client/types/list/list_limits_type.rb +19 -0
- data/lib/kodi_client/types/list/list_sort_method_type.rb +54 -0
- data/lib/kodi_client/types/list/list_sort_type.rb +22 -0
- data/lib/kodi_client/types/list/sort_order_type.rb +15 -0
- data/lib/kodi_client/types/media/media_artwork_type.rb +22 -0
- data/lib/kodi_client/types/media/media_details_base_type.rb +28 -0
- data/lib/kodi_client/types/media/media_type_type.rb +16 -0
- data/lib/kodi_client/types/player/audio_stream_type.rb +29 -0
- data/lib/kodi_client/types/player/player_position_time_type.rb +22 -0
- data/lib/kodi_client/types/player/player_repeat_type.rb +17 -0
- data/lib/kodi_client/types/player/player_speed_type.rb +26 -0
- data/lib/kodi_client/types/player/player_type.rb +24 -0
- data/lib/kodi_client/types/player/player_type_type.rb +16 -0
- data/lib/kodi_client/types/player/player_view_mode_type.rb +23 -0
- data/lib/kodi_client/types/player/player_visibility_type.rb +16 -0
- data/lib/kodi_client/types/player/property_name_type.rb +38 -0
- data/lib/kodi_client/types/player/property_value_type.rb +60 -0
- data/lib/kodi_client/types/player/seek_jump_type.rb +17 -0
- data/lib/kodi_client/types/player/seek_returned_type.rb +23 -0
- data/lib/kodi_client/types/player/subtitle_type.rb +24 -0
- data/lib/kodi_client/types/player/video_stream_type.rb +26 -0
- data/lib/kodi_client/types/player/view_mode_type.rb +22 -0
- data/lib/kodi_client/types/player/zoom_type.rb +15 -0
- data/lib/kodi_client/types/profiles/details_profile_type.rb +24 -0
- data/lib/kodi_client/types/profiles/fields_profile_type.rb +15 -0
- data/lib/kodi_client/types/profiles/get_profiles_returned_type.rb +22 -0
- data/lib/kodi_client/types/profiles/profile_password_type.rb +20 -0
- data/lib/kodi_client/types/{pvr_type.rb → pvr/channel_type_type.rb} +2 -4
- data/lib/kodi_client/types/system/property_name_type.rb +17 -0
- data/lib/kodi_client/types/{system_types.rb → system/property_value_type.rb} +2 -13
- data/lib/kodi_client/types/video/stream_details_type.rb +24 -0
- data/lib/kodi_client/types/video/video_cast_type.rb +22 -0
- data/lib/kodi_client/types/video/video_details_base_type.rb +29 -0
- data/lib/kodi_client/types/video/video_details_file_type.rb +37 -0
- data/lib/kodi_client/types/video/video_details_item_type.rb +32 -0
- data/lib/kodi_client/types/video/video_details_media_type.rb +28 -0
- data/lib/kodi_client/types/video/video_resume_type.rb +20 -0
- data/lib/kodi_client.rb +137 -49
- metadata +107 -34
- data/lib/kodi_client/Chainable.rb +0 -48
- data/lib/kodi_client/kodi_module.rb +0 -80
- data/lib/kodi_client/types/addon_types.rb +0 -177
- data/lib/kodi_client/types/application_types.rb +0 -52
- data/lib/kodi_client/types/audio_types.rb +0 -221
- data/lib/kodi_client/types/favourites_types.rb +0 -61
- data/lib/kodi_client/types/files_types.rb +0 -63
- data/lib/kodi_client/types/global_types.rb +0 -102
- data/lib/kodi_client/types/gui_types.rb +0 -179
- data/lib/kodi_client/types/input_types.rb +0 -214
- data/lib/kodi_client/types/list_types.rb +0 -542
- data/lib/kodi_client/types/media_types.rb +0 -53
- data/lib/kodi_client/types/player_type.rb +0 -294
- data/lib/kodi_client/types/profiles_types.rb +0 -65
- data/lib/kodi_client/types/video_types.rb +0 -150
- data/lib/kodi_client/util/comparable.rb +0 -20
- data/lib/kodi_client/util/creatable.rb +0 -106
- data/lib/kodi_client/util/iterable.rb +0 -11
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'kodi_client/types/item_types'
|
|
4
|
-
require 'kodi_client/types/list_types'
|
|
5
|
-
|
|
6
|
-
module KodiClient
|
|
7
|
-
module Types
|
|
8
|
-
module Addons
|
|
9
|
-
|
|
10
|
-
# Addon Types https://kodi.wiki/view/JSON-RPC_API/v12#Addon.Types
|
|
11
|
-
module AddonTypes
|
|
12
|
-
extend Iterable
|
|
13
|
-
|
|
14
|
-
UNKNOWN = 'unknown'
|
|
15
|
-
KODI_ADSP = 'kodi.adsp'
|
|
16
|
-
KODI_AUDIODECODER = 'kodi.audiodecoder'
|
|
17
|
-
KODI_CONTEXT_ITEM = 'kodi.context.item'
|
|
18
|
-
KODI_GAME_CONTROLLER = 'kodi.game.controller'
|
|
19
|
-
KODI_INPUTSTREAM = 'kodi.inputstream'
|
|
20
|
-
KODI_PERIPHERAL = 'kodi.peripheral'
|
|
21
|
-
KODI_RESOURCE_IMAGES = 'kodi.resource.images'
|
|
22
|
-
KODI_RESOURCE_LANGUAGE = 'kodi.resource.language'
|
|
23
|
-
KODI_RESOURCE_UISOUNDS = 'kodi.resource.uisounds'
|
|
24
|
-
XBMC_ADDON_AUDIO = 'xbmc.addon.audio'
|
|
25
|
-
XBMC_ADDON_EXECUTABLE = 'xbmc.addon.executable'
|
|
26
|
-
XBMC_ADDON_IMAGE = 'xbmc.addon.image'
|
|
27
|
-
XBMC_ADDON_REPOSITORY = 'xbmc.addon.repository'
|
|
28
|
-
XBMC_ADDON_VIDEO = 'xbmc.addon.video'
|
|
29
|
-
XBMC_AUDIOENCODER = 'xbmc.audioencoder'
|
|
30
|
-
XBMC_GUI_SKIN = 'xbmc.gui.skin'
|
|
31
|
-
XBMC_METADATA_SCRAPER_ALBUMS = 'xbmc.metadata.scraper.albums'
|
|
32
|
-
XBMC_METADATA_SCRAPER_ARTISTS = 'xbmc.metadata.scraper.artists'
|
|
33
|
-
XBMC_METADATA_SCRAPER_LIBRARY = 'xbmc.metadata.scraper.library'
|
|
34
|
-
XBMC_METADATA_SCRAPER_MOVIES = 'xbmc.metadata.scraper.movies'
|
|
35
|
-
XBMC_METADATA_SCRAPER_MUSICVIDEOS = 'xbmc.metadata.scraper.musicvideos'
|
|
36
|
-
XBMC_METADATA_SCRAPER_TVSHOWS = 'xbmc.metadata.scraper.episodes'
|
|
37
|
-
XBMC_PLAYER_MUSICVIZ = 'xbmc.player.musicviz'
|
|
38
|
-
XBMC_PVRCLIENT = 'xbmc.pvrclient'
|
|
39
|
-
XBMC_PYTHON_LIBRARY = 'xbmc.python.library'
|
|
40
|
-
XBMC_PYTHON_LYRICS = 'xbmc.python.lyrics'
|
|
41
|
-
XBMC_PYTHON_MODULE = 'xbmc.python.module'
|
|
42
|
-
XBMC_PYTHON_PLUGINSOURCE = 'xbmc.python.pluginsource'
|
|
43
|
-
XBMC_PYTHON_SCRIPT = 'xbmc.python.script'
|
|
44
|
-
XBMC_PYTHON_WEATHER = 'xbmc.python.weather'
|
|
45
|
-
XBMC_SERVICE = 'xbmc.service'
|
|
46
|
-
XBMC_SUBTITLE_MODULE = 'xbmc.subtitle.module'
|
|
47
|
-
XBMC_UI_SCREENSAVER = 'xbmc.ui.screensaver'
|
|
48
|
-
XBMC_WEBINTERFACE = 'xbmc.webinterface'
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Addon.Content https://kodi.wiki/view/JSON-RPC_API/v12#Addon.Content
|
|
52
|
-
module AddonContent
|
|
53
|
-
extend Iterable
|
|
54
|
-
|
|
55
|
-
UNKNOWN = 'unknown'
|
|
56
|
-
AUDIO = 'audio'
|
|
57
|
-
EXECUTABLE = 'executable'
|
|
58
|
-
IMAGE = 'image'
|
|
59
|
-
VIDEO = 'video'
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Addon.Fields https://kodi.wiki/view/JSON-RPC_API/v12#Addon.Content
|
|
63
|
-
module AddonFields
|
|
64
|
-
extend Iterable
|
|
65
|
-
|
|
66
|
-
AUTHOR = 'author'
|
|
67
|
-
BROKEN = 'broken'
|
|
68
|
-
DEPENDENCIES = 'dependencies'
|
|
69
|
-
DESCRIPTION = 'description'
|
|
70
|
-
DISCLAIMER = 'disclaimer'
|
|
71
|
-
ENABLED = 'enabled'
|
|
72
|
-
EXTRAINFO = 'extrainfo'
|
|
73
|
-
FANART = 'fanart'
|
|
74
|
-
INSTALLED = 'installed'
|
|
75
|
-
NAME = 'name'
|
|
76
|
-
PATH = 'path'
|
|
77
|
-
RATING = 'rating'
|
|
78
|
-
SUMMARY = 'summary'
|
|
79
|
-
THUMBNAIL = 'thumbnail'
|
|
80
|
-
VERSION = 'version'
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# represents addon dependency
|
|
84
|
-
class AddonDependency
|
|
85
|
-
include Comparable
|
|
86
|
-
extend Creatable
|
|
87
|
-
|
|
88
|
-
attr_reader :addon_id, :optional, :version
|
|
89
|
-
|
|
90
|
-
def initialize(addon_id, optional, version)
|
|
91
|
-
@addon_id = addon_id
|
|
92
|
-
@optional = optional
|
|
93
|
-
@version = version
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
# represents addon extra info
|
|
98
|
-
class AddonExtraInfo
|
|
99
|
-
include Comparable
|
|
100
|
-
extend Creatable
|
|
101
|
-
|
|
102
|
-
attr_reader :key, :value
|
|
103
|
-
|
|
104
|
-
def initialize(key, value)
|
|
105
|
-
@key = key
|
|
106
|
-
@value = value
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
# represents addon details
|
|
111
|
-
class AddonDetails
|
|
112
|
-
include Comparable
|
|
113
|
-
include Items::ItemDetailsBase
|
|
114
|
-
extend Creatable
|
|
115
|
-
|
|
116
|
-
attr_reader :addon_id, :author, :broken, :dependencies, :description, :disclaimer, :enabled, :extra_info,
|
|
117
|
-
:fan_art, :installed, :name, :path, :rating, :summary, :thumbnail, :type, :version
|
|
118
|
-
|
|
119
|
-
fields_to_map %w[addon_id author broken dependencies description disclaimer enabled extra_info fan_art
|
|
120
|
-
installed name path rating summary thumbnail type version label]
|
|
121
|
-
|
|
122
|
-
type_mapping ['dependencies', AddonDependency, true], ['extrainfo', AddonExtraInfo, true]
|
|
123
|
-
|
|
124
|
-
def initialize(addon_id, author, broken, dependencies, description, disclaimer, enabled, extra_info,
|
|
125
|
-
fan_art, installed, name, path, rating, summary, thumbnail, type, version, label)
|
|
126
|
-
@addon_id = addon_id
|
|
127
|
-
@author = author
|
|
128
|
-
@broken = broken
|
|
129
|
-
@dependencies = dependencies
|
|
130
|
-
@description = description
|
|
131
|
-
@disclaimer = disclaimer
|
|
132
|
-
@enabled = enabled
|
|
133
|
-
@extra_info = extra_info
|
|
134
|
-
@fan_art = fan_art
|
|
135
|
-
@installed = installed
|
|
136
|
-
@name = name
|
|
137
|
-
@path = path
|
|
138
|
-
@rating = rating
|
|
139
|
-
@summary = summary
|
|
140
|
-
@thumbnail = thumbnail
|
|
141
|
-
@type = type
|
|
142
|
-
@version = version
|
|
143
|
-
item_details_base(label)
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# getAddons return
|
|
148
|
-
class Addons
|
|
149
|
-
include Comparable
|
|
150
|
-
extend Creatable
|
|
151
|
-
|
|
152
|
-
attr_reader :addons, :limits
|
|
153
|
-
|
|
154
|
-
type_mapping ['addons', AddonDetails, true], ['limits', List::ListLimitsReturned]
|
|
155
|
-
|
|
156
|
-
def initialize(addons, limits)
|
|
157
|
-
@addons = addons
|
|
158
|
-
@limits = limits
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# getAddon return
|
|
163
|
-
class Addon
|
|
164
|
-
include Comparable
|
|
165
|
-
extend Creatable
|
|
166
|
-
|
|
167
|
-
attr_reader :addon
|
|
168
|
-
|
|
169
|
-
type_mapping ['addon', AddonDetails]
|
|
170
|
-
|
|
171
|
-
def initialize(addon)
|
|
172
|
-
@addon = addon
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Application
|
|
6
|
-
|
|
7
|
-
# Application.Property.Name https://kodi.wiki/view/JSON-RPC_API/v12#Application.Property.Name
|
|
8
|
-
module PropertyName
|
|
9
|
-
extend Iterable
|
|
10
|
-
|
|
11
|
-
VOLUME = 'volume'
|
|
12
|
-
MUTED = 'muted'
|
|
13
|
-
NAME = 'name'
|
|
14
|
-
VERSION = 'version'
|
|
15
|
-
SORT_TOKENS = 'sorttokens'
|
|
16
|
-
LANGUAGE = 'language'
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# represent application properties version
|
|
20
|
-
class Version
|
|
21
|
-
include Comparable
|
|
22
|
-
extend Creatable
|
|
23
|
-
|
|
24
|
-
attr_reader :major, :minor, :revision, :tag
|
|
25
|
-
|
|
26
|
-
def initialize(major, minor, revision, tag)
|
|
27
|
-
@major = major
|
|
28
|
-
@minor = minor
|
|
29
|
-
@revision = revision
|
|
30
|
-
@tag = tag
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Application.Property.Value https://kodi.wiki/view/JSON-RPC_API/v12#Application.Property.Value
|
|
35
|
-
class PropertyValue
|
|
36
|
-
include Comparable
|
|
37
|
-
extend Creatable
|
|
38
|
-
|
|
39
|
-
attr_reader :name, :version, :muted, :volume
|
|
40
|
-
|
|
41
|
-
type_mapping ['version', Version]
|
|
42
|
-
|
|
43
|
-
def initialize(name, version, muted, volume)
|
|
44
|
-
@name = name
|
|
45
|
-
@version = version
|
|
46
|
-
@muted = muted
|
|
47
|
-
@volume = volume
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Audio
|
|
6
|
-
|
|
7
|
-
# Audio.Contributor https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Contributors
|
|
8
|
-
class AudioContributor
|
|
9
|
-
include Comparable
|
|
10
|
-
extend Creatable
|
|
11
|
-
|
|
12
|
-
attr_reader :artist_id, :name, :role, :role_id
|
|
13
|
-
|
|
14
|
-
def initialize(artist_id, name, role, role_id)
|
|
15
|
-
@artist_id = artist_id
|
|
16
|
-
@name = name
|
|
17
|
-
@role = role
|
|
18
|
-
@role_id = role_id
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# Audio.Album.ReleaseType https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Album.ReleaseType
|
|
23
|
-
module AudioAlbumReleaseType
|
|
24
|
-
extend Iterable
|
|
25
|
-
|
|
26
|
-
ALBUM = 'album'
|
|
27
|
-
SINGLE = 'single'
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Audio.Details.Base https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Base
|
|
31
|
-
module AudioDetailsBase
|
|
32
|
-
include Media::MediaDetailsBase
|
|
33
|
-
|
|
34
|
-
attr_reader :art, :date_added, :genre
|
|
35
|
-
|
|
36
|
-
def audio_details_base_mappings
|
|
37
|
-
mappings = { 'art' => Creatable::CreateMap.new(Types::Media::MediaArtwork) }
|
|
38
|
-
mappings.merge(media_details_base_mappings)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def audio_details_base_by_hash(hash)
|
|
42
|
-
audio_details_base(*Creatable.hash_to_arr(hash, %w[art date_added genre fan_art thumbnail label]),
|
|
43
|
-
audio_details_base_mappings)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
47
|
-
@art = art
|
|
48
|
-
@date_added = date_added
|
|
49
|
-
@genre = genre
|
|
50
|
-
media_details_base(fan_art, thumbnail, label)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Audio.Details.Media https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Media
|
|
55
|
-
module AudioDetailsMedia
|
|
56
|
-
include AudioDetailsBase
|
|
57
|
-
|
|
58
|
-
attr_reader :artist, :artist_id, :display_artist, :musicbrainz_album_artist_id, :original_date, :rating,
|
|
59
|
-
:release_date, :sort_artist, :title, :user_rating, :votes, :year
|
|
60
|
-
|
|
61
|
-
def audio_details_media_mappings
|
|
62
|
-
audio_details_base_mappings
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def audio_details_media_by_hash(hash)
|
|
66
|
-
audio_details_media(*Creatable.hash_to_arr(hash, %w[artist artist_id display_artist
|
|
67
|
-
musicbrainz_album_artist_id original_date rating
|
|
68
|
-
release_date sort_artist title user_rating votes year art
|
|
69
|
-
date_added genre fan_art thumbnail label],
|
|
70
|
-
audio_details_base_mappings))
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
74
|
-
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
75
|
-
art, date_added, genre, fan_art, thumbnail, label)
|
|
76
|
-
@artist = artist
|
|
77
|
-
@artist_id = artist_id
|
|
78
|
-
@display_artist = display_artist
|
|
79
|
-
@musicbrainz_album_artist_id = musicbrainz_album_artist_id
|
|
80
|
-
@original_date = original_date
|
|
81
|
-
@rating = rating
|
|
82
|
-
@release_date = release_date
|
|
83
|
-
@sort_artist = sort_artist
|
|
84
|
-
@title = title
|
|
85
|
-
@user_rating = user_rating
|
|
86
|
-
@votes = votes
|
|
87
|
-
@year = year
|
|
88
|
-
audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# Audio.Fields.Album https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Fields.Album
|
|
93
|
-
module AudioFieldsAlbum
|
|
94
|
-
extend Iterable
|
|
95
|
-
|
|
96
|
-
#album id
|
|
97
|
-
ALBUM_DURATION = 'albumduration'
|
|
98
|
-
ALBUM_LABEL = 'albumlabel'
|
|
99
|
-
ALBUM_STATUS = 'albumstatus'
|
|
100
|
-
ART = 'art'
|
|
101
|
-
ARTIST = 'artist'
|
|
102
|
-
ARTIST_ID = 'artistid'
|
|
103
|
-
COMPILATION = 'compilation'
|
|
104
|
-
DATE_ADDED = 'dateadded'
|
|
105
|
-
DATE_MODIFIED = 'datemodified'
|
|
106
|
-
DATE_NEW = 'datenew'
|
|
107
|
-
DESCRIPTION = 'description'
|
|
108
|
-
DISPLAY_ARTIST = 'displayartist'
|
|
109
|
-
FAN_ART = 'fanart'
|
|
110
|
-
GENRE = 'genre'
|
|
111
|
-
IS_BOX_SET = 'isboxset'
|
|
112
|
-
LAST_PLAYED = 'lastplayed'
|
|
113
|
-
MOOD = 'mood'
|
|
114
|
-
MUSICBRAINZ_ALBUM_ARTIST_ID = 'musicbrainzalbumartistid'
|
|
115
|
-
MUSICBRAINZ_ALBUM_ID = 'musicbrainzalbumid'
|
|
116
|
-
MUSICBRAINZ_RELEASE_GROUP_ID = 'musicbrainzreleasegroupid'
|
|
117
|
-
ORIGINAL_DATE = 'originaldate'
|
|
118
|
-
PLAY_COUNT = 'playcount'
|
|
119
|
-
RATING = 'rating'
|
|
120
|
-
RELEASE_DATE = 'releasedate'
|
|
121
|
-
RELEASE_TYPE = 'releasetype'
|
|
122
|
-
SONG_GENRES = 'songgenres'
|
|
123
|
-
SORT_ARTIST = 'sortartist'
|
|
124
|
-
SOURCE_ID = 'sourceid'
|
|
125
|
-
STYLE = 'style'
|
|
126
|
-
THEME = 'theme'
|
|
127
|
-
THUMBNAIL = 'thumbnail'
|
|
128
|
-
TITLE = 'title'
|
|
129
|
-
TOTAL_DISCS = 'totaldiscs'
|
|
130
|
-
TYPE = 'type'
|
|
131
|
-
USER_RATING = 'userrating'
|
|
132
|
-
VOTES = 'votes'
|
|
133
|
-
YEAR = 'year'
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
# Audio.Details.Genres https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Genres
|
|
137
|
-
class Genre
|
|
138
|
-
include Comparable
|
|
139
|
-
extend Creatable
|
|
140
|
-
|
|
141
|
-
attr_reader :genre_id, :title
|
|
142
|
-
|
|
143
|
-
def initialize(genre_id, title)
|
|
144
|
-
@genre_id = genre_id
|
|
145
|
-
@title = title
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# Audio.Details.Album https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Album
|
|
150
|
-
class DetailsAlbum
|
|
151
|
-
include AudioDetailsMedia
|
|
152
|
-
include Comparable
|
|
153
|
-
extend Creatable
|
|
154
|
-
|
|
155
|
-
attr_reader :album_duration, :album_id, :album_label, :album_status, :compilation, :date_modified, :date_new,
|
|
156
|
-
:description, :is_box_set, :last_played, :mood, :musicbrainz_album_id, :musicbrainz_release_group_id,
|
|
157
|
-
:play_count, :release_type, :song_genres, :source_id, :style, :theme, :total_discs, :type
|
|
158
|
-
|
|
159
|
-
fields_to_map %w[album_duration album_id album_label album_status art artist artist_id compilation date_added
|
|
160
|
-
date_modified date_new description display_artist fan_art genre is_box_set label last_played
|
|
161
|
-
mood musicbrainz_album_artist_id musicbrainz_album_id musicbrainz_release_group_id
|
|
162
|
-
original_date play_count rating release_date release_type song_genres sort_artist source_id
|
|
163
|
-
style theme thumbnail title total_discs type user_rating votes year]
|
|
164
|
-
|
|
165
|
-
type_mapping ['songgenres', Genre, true], ['art', Types::Media::MediaArtwork]
|
|
166
|
-
|
|
167
|
-
def initialize(album_duration, album_id, album_label, album_status, art, artist, artist_id, compilation,
|
|
168
|
-
date_added, date_modified, date_new, description, display_artist, fan_art, genre, is_box_set,
|
|
169
|
-
label, last_played, mood, musicbrainz_album_artist_id, musicbrainz_album_id,
|
|
170
|
-
musicbrainz_release_group_id, original_date, play_count, rating, release_date, release_type,
|
|
171
|
-
song_genres, sort_artist, source_id, style, theme, thumbnail, title, total_discs, type,
|
|
172
|
-
user_rating, votes, year)
|
|
173
|
-
@album_duration = album_duration
|
|
174
|
-
@album_id = album_id
|
|
175
|
-
@album_label = album_label
|
|
176
|
-
@album_status = album_status
|
|
177
|
-
@compilation = compilation
|
|
178
|
-
@date_modified = date_modified
|
|
179
|
-
@date_new = date_new
|
|
180
|
-
@description = description
|
|
181
|
-
@is_box_set = is_box_set
|
|
182
|
-
@last_played = last_played
|
|
183
|
-
@mood = mood
|
|
184
|
-
@musicbrainz_album_id = musicbrainz_album_id
|
|
185
|
-
@musicbrainz_release_group_id = musicbrainz_release_group_id
|
|
186
|
-
@play_count = play_count
|
|
187
|
-
@release_type = release_type
|
|
188
|
-
@song_genres = song_genres
|
|
189
|
-
@source_id = source_id
|
|
190
|
-
@style = style
|
|
191
|
-
@theme = theme
|
|
192
|
-
@total_discs = total_discs
|
|
193
|
-
@type = type
|
|
194
|
-
audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
195
|
-
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
196
|
-
art, date_added, genre, fan_art, thumbnail, label)
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
# return type for AudioLibrary.GetAlbums
|
|
201
|
-
class GetAlbumsReturned
|
|
202
|
-
include Comparable
|
|
203
|
-
extend Creatable
|
|
204
|
-
|
|
205
|
-
attr_reader :albums, :limits
|
|
206
|
-
|
|
207
|
-
def self.lazy_type_mapping
|
|
208
|
-
{
|
|
209
|
-
'albums' => Creatable::CreateMap.new(DetailsAlbum, true),
|
|
210
|
-
'limits' => Creatable::CreateMap.new(List::ListLimitsReturned)
|
|
211
|
-
}
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
def initialize(albums, limits)
|
|
215
|
-
@albums = albums
|
|
216
|
-
@limits = limits
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
end
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Favourites
|
|
6
|
-
|
|
7
|
-
# Favourite.Type https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Type
|
|
8
|
-
module Type
|
|
9
|
-
extend Iterable
|
|
10
|
-
|
|
11
|
-
MEDIA = 'media'
|
|
12
|
-
WINDOW = 'window'
|
|
13
|
-
SCRIPT = 'script'
|
|
14
|
-
ANDROID_APP = 'androidapp'
|
|
15
|
-
UNKNOWN = 'unknown'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Favourite.Fields.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Fields.Favourite
|
|
19
|
-
module FieldsFavourite
|
|
20
|
-
extend Iterable
|
|
21
|
-
|
|
22
|
-
WINDOW = 'window'
|
|
23
|
-
WINDOW_PARAMETER = 'windowparameter'
|
|
24
|
-
THUMBNAIL = 'thumbnail'
|
|
25
|
-
PATH = 'path'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Favourite.Details.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Details.Favourite
|
|
29
|
-
class DetailsFavourite
|
|
30
|
-
include Comparable
|
|
31
|
-
extend Creatable
|
|
32
|
-
|
|
33
|
-
attr_reader :path, :thumbnail, :title, :type, :window, :window_parameter
|
|
34
|
-
|
|
35
|
-
def initialize(path, thumbnail, title, type, window, window_parameter)
|
|
36
|
-
@path = path
|
|
37
|
-
@thumbnail = thumbnail
|
|
38
|
-
@title = title
|
|
39
|
-
@type = type
|
|
40
|
-
@window = window
|
|
41
|
-
@window_parameter = window_parameter
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# return type for Favourites.GetFavourites
|
|
46
|
-
class GetFavouriteReturned
|
|
47
|
-
include Comparable
|
|
48
|
-
extend Creatable
|
|
49
|
-
|
|
50
|
-
attr_reader :favourites, :limits
|
|
51
|
-
|
|
52
|
-
type_mapping ['favourites', DetailsFavourite, true], ['limits', Types::List::ListLimitsReturned]
|
|
53
|
-
|
|
54
|
-
def initialize(favourites, limits)
|
|
55
|
-
@favourites = favourites
|
|
56
|
-
@limits = limits
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Files
|
|
6
|
-
|
|
7
|
-
# Files.Media https://kodi.wiki/view/JSON-RPC_API/v12#Files.Media
|
|
8
|
-
module Media
|
|
9
|
-
extend Iterable
|
|
10
|
-
|
|
11
|
-
VIDEO = 'video'
|
|
12
|
-
MUSIC = 'music'
|
|
13
|
-
PICTURES = 'pictures'
|
|
14
|
-
FILES = 'files'
|
|
15
|
-
PROGRAMS = 'programs'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# return value for GetDirectory
|
|
19
|
-
class GetDirectoryReturned
|
|
20
|
-
include Comparable
|
|
21
|
-
extend Creatable
|
|
22
|
-
|
|
23
|
-
attr_reader :files, :limits
|
|
24
|
-
|
|
25
|
-
type_mapping ['files', List::ListItemFile, true], ['limits', List::ListLimitsReturned]
|
|
26
|
-
|
|
27
|
-
def initialize(files, limits)
|
|
28
|
-
@files = files
|
|
29
|
-
@limits = limits
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# return value for GetSources
|
|
34
|
-
class GetSourcesReturned
|
|
35
|
-
include Comparable
|
|
36
|
-
extend Creatable
|
|
37
|
-
|
|
38
|
-
attr_reader :sources, :limits
|
|
39
|
-
|
|
40
|
-
type_mapping ['sources', List::FileLabel, true], ['limits', List::ListLimitsReturned]
|
|
41
|
-
|
|
42
|
-
def initialize(sources, limits)
|
|
43
|
-
@sources = sources
|
|
44
|
-
@limits = limits
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# return value for GetPrepareDownload
|
|
49
|
-
class PrepareDownloadReturned
|
|
50
|
-
include Comparable
|
|
51
|
-
extend Creatable
|
|
52
|
-
|
|
53
|
-
attr_reader :details, :mode, :protocol
|
|
54
|
-
|
|
55
|
-
def initialize(details, mode, protocol)
|
|
56
|
-
@details = details
|
|
57
|
-
@mode = mode
|
|
58
|
-
@protocol = protocol
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module KodiClient
|
|
4
|
-
module Types
|
|
5
|
-
module Global
|
|
6
|
-
|
|
7
|
-
# Global.Toggle https://kodi.wiki/view/JSON-RPC_API/v12#Global.Toggle
|
|
8
|
-
module Toggle
|
|
9
|
-
extend Iterable
|
|
10
|
-
|
|
11
|
-
TOGGLE = 'toggle'
|
|
12
|
-
TRUE = true
|
|
13
|
-
FALSE = false
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# rotate for clockwise and counter clockwise
|
|
17
|
-
module Rotate
|
|
18
|
-
extend Iterable
|
|
19
|
-
|
|
20
|
-
CLOCKWISE = 'clockwise'
|
|
21
|
-
COUNTER_CLOCKWISE = 'counterclockwise'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# direction for left, right, up, down
|
|
25
|
-
module Direction
|
|
26
|
-
extend Iterable
|
|
27
|
-
|
|
28
|
-
LEFT = 'left'
|
|
29
|
-
RIGHT = 'right'
|
|
30
|
-
UP = 'up'
|
|
31
|
-
DOWN = 'down'
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# enum for prev/next
|
|
35
|
-
module NextPrev
|
|
36
|
-
extend Iterable
|
|
37
|
-
|
|
38
|
-
NEXT = 'next'
|
|
39
|
-
PREV = 'previous'
|
|
40
|
-
ON = 'on'
|
|
41
|
-
OFF = 'off'
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Global.IncrementDecrement https://kodi.wiki/view/JSON-RPC_API/v12#Global.IncrementDecrement
|
|
45
|
-
module IncrementDecrement
|
|
46
|
-
extend Iterable
|
|
47
|
-
|
|
48
|
-
INCREMENT = 'increment'
|
|
49
|
-
DECREMENT = 'decrement'
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# id/label type
|
|
53
|
-
class IdLabel
|
|
54
|
-
include Comparable
|
|
55
|
-
extend Creatable
|
|
56
|
-
|
|
57
|
-
attr_reader :id, :label
|
|
58
|
-
|
|
59
|
-
def initialize(id, label)
|
|
60
|
-
@id = id
|
|
61
|
-
@label = label
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# id/name type
|
|
66
|
-
class IdName
|
|
67
|
-
include Comparable
|
|
68
|
-
extend Creatable
|
|
69
|
-
|
|
70
|
-
attr_reader :id, :name
|
|
71
|
-
|
|
72
|
-
def initialize(id, name)
|
|
73
|
-
@id = id
|
|
74
|
-
@name = name
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
# Global.Time https://kodi.wiki/view/JSON-RPC_API/v12#Global.Time
|
|
79
|
-
class GlobalTime
|
|
80
|
-
include Comparable
|
|
81
|
-
extend Creatable
|
|
82
|
-
|
|
83
|
-
attr_reader :hours, :minutes, :seconds, :milliseconds
|
|
84
|
-
|
|
85
|
-
def initialize(hours, minutes, seconds, milliseconds)
|
|
86
|
-
@hours = hours
|
|
87
|
-
@minutes = minutes
|
|
88
|
-
@seconds = seconds
|
|
89
|
-
@milliseconds = milliseconds
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# available Password Encryptions
|
|
94
|
-
module PasswordEncryption
|
|
95
|
-
extend Iterable
|
|
96
|
-
|
|
97
|
-
NONE = 'none'
|
|
98
|
-
MD5 = 'md5'
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|