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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Addons
|
|
6
|
+
# Addon Types https://kodi.wiki/view/JSON-RPC_API/v12#Addon.Types
|
|
7
|
+
module AddonTypes
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
UNKNOWN = 'unknown'
|
|
11
|
+
KODI_ADSP = 'kodi.adsp'
|
|
12
|
+
KODI_AUDIO_DECODER = 'kodi.audiodecoder'
|
|
13
|
+
KODI_CONTEXT_ITEM = 'kodi.context.item'
|
|
14
|
+
KODI_GAME_CONTROLLER = 'kodi.game.controller'
|
|
15
|
+
KODI_INPUT_STREAM = 'kodi.inputstream'
|
|
16
|
+
KODI_PERIPHERAL = 'kodi.peripheral'
|
|
17
|
+
KODI_RESOURCE_IMAGES = 'kodi.resource.images'
|
|
18
|
+
KODI_RESOURCE_LANGUAGE = 'kodi.resource.language'
|
|
19
|
+
KODI_RESOURCE_UI_SOUNDS = 'kodi.resource.uisounds'
|
|
20
|
+
XBMC_ADDON_AUDIO = 'xbmc.addon.audio'
|
|
21
|
+
XBMC_ADDON_EXECUTABLE = 'xbmc.addon.executable'
|
|
22
|
+
XBMC_ADDON_IMAGE = 'xbmc.addon.image'
|
|
23
|
+
XBMC_ADDON_REPOSITORY = 'xbmc.addon.repository'
|
|
24
|
+
XBMC_ADDON_VIDEO = 'xbmc.addon.video'
|
|
25
|
+
XBMC_AUDIO_ENCODER = 'xbmc.audioencoder'
|
|
26
|
+
XBMC_GUI_SKIN = 'xbmc.gui.skin'
|
|
27
|
+
XBMC_METADATA_SCRAPER_ALBUMS = 'xbmc.metadata.scraper.albums'
|
|
28
|
+
XBMC_METADATA_SCRAPER_ARTISTS = 'xbmc.metadata.scraper.artists'
|
|
29
|
+
XBMC_METADATA_SCRAPER_LIBRARY = 'xbmc.metadata.scraper.library'
|
|
30
|
+
XBMC_METADATA_SCRAPER_MOVIES = 'xbmc.metadata.scraper.movies'
|
|
31
|
+
XBMC_METADATA_SCRAPER_MUSIC_VIDEOS = 'xbmc.metadata.scraper.musicvideos'
|
|
32
|
+
XBMC_METADATA_SCRAPER_TV_SHOWS = 'xbmc.metadata.scraper.episodes'
|
|
33
|
+
XBMC_PLAYER_MUSIC_VIZ = 'xbmc.player.musicviz'
|
|
34
|
+
XBMC_PVR_CLIENT = 'xbmc.pvrclient'
|
|
35
|
+
XBMC_PYTHON_LIBRARY = 'xbmc.python.library'
|
|
36
|
+
XBMC_PYTHON_LYRICS = 'xbmc.python.lyrics'
|
|
37
|
+
XBMC_PYTHON_MODULE = 'xbmc.python.module'
|
|
38
|
+
XBMC_PYTHON_PLUGIN_SOURCE = 'xbmc.python.pluginsource'
|
|
39
|
+
XBMC_PYTHON_SCRIPT = 'xbmc.python.script'
|
|
40
|
+
XBMC_PYTHON_WEATHER = 'xbmc.python.weather'
|
|
41
|
+
XBMC_SERVICE = 'xbmc.service'
|
|
42
|
+
XBMC_SUBTITLE_MODULE = 'xbmc.subtitle.module'
|
|
43
|
+
XBMC_UI_SCREENSAVER = 'xbmc.ui.screensaver'
|
|
44
|
+
XBMC_WEBINTERFACE = 'xbmc.webinterface'
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Addons
|
|
6
|
+
# getAddon return
|
|
7
|
+
class GetAddonReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :addon
|
|
12
|
+
|
|
13
|
+
type_mapping ['addon', AddonDetails]
|
|
14
|
+
|
|
15
|
+
def initialize(addon)
|
|
16
|
+
@addon = addon
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Addons
|
|
6
|
+
# getAddons return
|
|
7
|
+
class GetAddonsReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :addons, :limits
|
|
12
|
+
|
|
13
|
+
type_mapping ['addons', AddonDetails, true], ['limits', List::ListLimitsReturned]
|
|
14
|
+
|
|
15
|
+
def initialize(addons, limits)
|
|
16
|
+
@addons = addons
|
|
17
|
+
@limits = limits
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Application
|
|
6
|
+
# Application.Property.Name https://kodi.wiki/view/JSON-RPC_API/v12#Application.Property.Name
|
|
7
|
+
module PropertyName
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
VOLUME = 'volume'
|
|
11
|
+
MUTED = 'muted'
|
|
12
|
+
NAME = 'name'
|
|
13
|
+
VERSION = 'version'
|
|
14
|
+
SORT_TOKENS = 'sorttokens'
|
|
15
|
+
LANGUAGE = 'language'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Application
|
|
6
|
+
# Application.Property.Value https://kodi.wiki/view/JSON-RPC_API/v12#Application.Property.Value
|
|
7
|
+
class PropertyValue
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :name, :version, :muted, :volume
|
|
12
|
+
|
|
13
|
+
type_mapping ['version', Version]
|
|
14
|
+
|
|
15
|
+
def initialize(name, version, muted, volume)
|
|
16
|
+
@name = name
|
|
17
|
+
@version = version
|
|
18
|
+
@muted = muted
|
|
19
|
+
@volume = volume
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Application
|
|
6
|
+
# represent application properties version
|
|
7
|
+
class Version
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :major, :minor, :revision, :tag
|
|
12
|
+
|
|
13
|
+
def initialize(major, minor, revision, tag)
|
|
14
|
+
@major = major
|
|
15
|
+
@minor = minor
|
|
16
|
+
@revision = revision
|
|
17
|
+
@tag = tag
|
|
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 Audio
|
|
6
|
+
# Audio.Album.ReleaseType https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Album.ReleaseType
|
|
7
|
+
module AudioAlbumReleaseType
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
ALBUM = 'album'
|
|
11
|
+
SINGLE = 'single'
|
|
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 Audio
|
|
6
|
+
# Audio.Contributor https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Contributors
|
|
7
|
+
class AudioContributor
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :artist_id, :name, :role, :role_id
|
|
12
|
+
|
|
13
|
+
def initialize(artist_id, name, role, role_id)
|
|
14
|
+
@artist_id = artist_id
|
|
15
|
+
@name = name
|
|
16
|
+
@role = role
|
|
17
|
+
@role_id = role_id
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Base https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Base
|
|
7
|
+
module AudioDetailsBase
|
|
8
|
+
include Media::MediaDetailsBase
|
|
9
|
+
|
|
10
|
+
attr_reader :art, :date_added, :genre
|
|
11
|
+
|
|
12
|
+
def audio_details_base_mappings
|
|
13
|
+
mappings = { 'art' => Extensions::Creatable::CreateMap.new(Types::Media::MediaArtwork) }
|
|
14
|
+
mappings.merge(media_details_base_mappings)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def audio_details_base_by_hash(hash)
|
|
18
|
+
audio_details_base(*Extensions::Creatable.hash_to_arr(hash, %w[art date_added genre fan_art thumbnail label]),
|
|
19
|
+
audio_details_base_mappings)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
23
|
+
@art = art
|
|
24
|
+
@date_added = date_added
|
|
25
|
+
@genre = genre
|
|
26
|
+
media_details_base(fan_art, thumbnail, label)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Media https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Media
|
|
7
|
+
module AudioDetailsMedia
|
|
8
|
+
include AudioDetailsBase
|
|
9
|
+
|
|
10
|
+
attr_reader :artist, :artist_id, :display_artist, :musicbrainz_album_artist_id, :original_date, :rating,
|
|
11
|
+
:release_date, :sort_artist, :title, :user_rating, :votes, :year
|
|
12
|
+
|
|
13
|
+
def audio_details_media_mappings
|
|
14
|
+
audio_details_base_mappings
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def audio_details_media_by_hash(hash)
|
|
18
|
+
audio_details_media(*Extensions::Creatable.hash_to_arr(hash, %w[artist artist_id display_artist
|
|
19
|
+
musicbrainz_album_artist_id original_date rating
|
|
20
|
+
release_date sort_artist title user_rating votes year art
|
|
21
|
+
date_added genre fan_art thumbnail label],
|
|
22
|
+
audio_details_base_mappings))
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
26
|
+
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
27
|
+
art, date_added, genre, fan_art, thumbnail, label)
|
|
28
|
+
@artist = artist
|
|
29
|
+
@artist_id = artist_id
|
|
30
|
+
@display_artist = display_artist
|
|
31
|
+
@musicbrainz_album_artist_id = musicbrainz_album_artist_id
|
|
32
|
+
@original_date = original_date
|
|
33
|
+
@rating = rating
|
|
34
|
+
@release_date = release_date
|
|
35
|
+
@sort_artist = sort_artist
|
|
36
|
+
@title = title
|
|
37
|
+
@user_rating = user_rating
|
|
38
|
+
@votes = votes
|
|
39
|
+
@year = year
|
|
40
|
+
audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Fields.Album https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Fields.Album
|
|
7
|
+
module AudioFieldsAlbum
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
#album id
|
|
11
|
+
ALBUM_DURATION = 'albumduration'
|
|
12
|
+
ALBUM_LABEL = 'albumlabel'
|
|
13
|
+
ALBUM_STATUS = 'albumstatus'
|
|
14
|
+
ART = 'art'
|
|
15
|
+
ARTIST = 'artist'
|
|
16
|
+
ARTIST_ID = 'artistid'
|
|
17
|
+
COMPILATION = 'compilation'
|
|
18
|
+
DATE_ADDED = 'dateadded'
|
|
19
|
+
DATE_MODIFIED = 'datemodified'
|
|
20
|
+
DATE_NEW = 'datenew'
|
|
21
|
+
DESCRIPTION = 'description'
|
|
22
|
+
DISPLAY_ARTIST = 'displayartist'
|
|
23
|
+
FAN_ART = 'fanart'
|
|
24
|
+
GENRE = 'genre'
|
|
25
|
+
IS_BOX_SET = 'isboxset'
|
|
26
|
+
LAST_PLAYED = 'lastplayed'
|
|
27
|
+
MOOD = 'mood'
|
|
28
|
+
MUSICBRAINZ_ALBUM_ARTIST_ID = 'musicbrainzalbumartistid'
|
|
29
|
+
MUSICBRAINZ_ALBUM_ID = 'musicbrainzalbumid'
|
|
30
|
+
MUSICBRAINZ_RELEASE_GROUP_ID = 'musicbrainzreleasegroupid'
|
|
31
|
+
ORIGINAL_DATE = 'originaldate'
|
|
32
|
+
PLAY_COUNT = 'playcount'
|
|
33
|
+
RATING = 'rating'
|
|
34
|
+
RELEASE_DATE = 'releasedate'
|
|
35
|
+
RELEASE_TYPE = 'releasetype'
|
|
36
|
+
SONG_GENRES = 'songgenres'
|
|
37
|
+
SORT_ARTIST = 'sortartist'
|
|
38
|
+
SOURCE_ID = 'sourceid'
|
|
39
|
+
STYLE = 'style'
|
|
40
|
+
THEME = 'theme'
|
|
41
|
+
THUMBNAIL = 'thumbnail'
|
|
42
|
+
TITLE = 'title'
|
|
43
|
+
TOTAL_DISCS = 'totaldiscs'
|
|
44
|
+
TYPE = 'type'
|
|
45
|
+
USER_RATING = 'userrating'
|
|
46
|
+
VOTES = 'votes'
|
|
47
|
+
YEAR = 'year'
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Album https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Album
|
|
7
|
+
class DetailsAlbum
|
|
8
|
+
include AudioDetailsMedia
|
|
9
|
+
include Extensions::Comparable
|
|
10
|
+
extend Extensions::Creatable
|
|
11
|
+
|
|
12
|
+
attr_reader :album_duration, :album_id, :album_label, :album_status, :compilation, :date_modified, :date_new,
|
|
13
|
+
:description, :is_box_set, :last_played, :mood, :musicbrainz_album_id, :musicbrainz_release_group_id,
|
|
14
|
+
:play_count, :release_type, :song_genres, :source_id, :style, :theme, :total_discs, :type
|
|
15
|
+
|
|
16
|
+
fields_to_map %w[album_duration album_id album_label album_status art artist artist_id compilation date_added
|
|
17
|
+
date_modified date_new description display_artist fan_art genre is_box_set label last_played
|
|
18
|
+
mood musicbrainz_album_artist_id musicbrainz_album_id musicbrainz_release_group_id
|
|
19
|
+
original_date play_count rating release_date release_type song_genres sort_artist source_id
|
|
20
|
+
style theme thumbnail title total_discs type user_rating votes year]
|
|
21
|
+
|
|
22
|
+
type_mapping ['songgenres', Genre, true], ['art', Types::Media::MediaArtwork]
|
|
23
|
+
|
|
24
|
+
def initialize(album_duration, album_id, album_label, album_status, art, artist, artist_id, compilation,
|
|
25
|
+
date_added, date_modified, date_new, description, display_artist, fan_art, genre, is_box_set,
|
|
26
|
+
label, last_played, mood, musicbrainz_album_artist_id, musicbrainz_album_id,
|
|
27
|
+
musicbrainz_release_group_id, original_date, play_count, rating, release_date, release_type,
|
|
28
|
+
song_genres, sort_artist, source_id, style, theme, thumbnail, title, total_discs, type,
|
|
29
|
+
user_rating, votes, year)
|
|
30
|
+
@album_duration = album_duration
|
|
31
|
+
@album_id = album_id
|
|
32
|
+
@album_label = album_label
|
|
33
|
+
@album_status = album_status
|
|
34
|
+
@compilation = compilation
|
|
35
|
+
@date_modified = date_modified
|
|
36
|
+
@date_new = date_new
|
|
37
|
+
@description = description
|
|
38
|
+
@is_box_set = is_box_set
|
|
39
|
+
@last_played = last_played
|
|
40
|
+
@mood = mood
|
|
41
|
+
@musicbrainz_album_id = musicbrainz_album_id
|
|
42
|
+
@musicbrainz_release_group_id = musicbrainz_release_group_id
|
|
43
|
+
@play_count = play_count
|
|
44
|
+
@release_type = release_type
|
|
45
|
+
@song_genres = song_genres
|
|
46
|
+
@source_id = source_id
|
|
47
|
+
@style = style
|
|
48
|
+
@theme = theme
|
|
49
|
+
@total_discs = total_discs
|
|
50
|
+
@type = type
|
|
51
|
+
audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
52
|
+
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
53
|
+
art, date_added, genre, fan_art, thumbnail, label)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Genres https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Genres
|
|
7
|
+
class Genre
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :genre_id, :title
|
|
12
|
+
|
|
13
|
+
def initialize(genre_id, title)
|
|
14
|
+
@genre_id = genre_id
|
|
15
|
+
@title = title
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# return type for AudioLibrary.GetAlbums
|
|
7
|
+
class GetAlbumsReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :albums, :limits
|
|
12
|
+
|
|
13
|
+
type_mapping ['albums', DetailsAlbum, true], ['limits', List::ListLimitsReturned]
|
|
14
|
+
|
|
15
|
+
def initialize(albums, limits)
|
|
16
|
+
@albums = albums
|
|
17
|
+
@limits = limits
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Favourites
|
|
6
|
+
# Favourite.Details.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Details.Favourite
|
|
7
|
+
class DetailsFavourite
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :path, :thumbnail, :title, :type, :window, :window_parameter
|
|
12
|
+
|
|
13
|
+
def initialize(path, thumbnail, title, type, window, window_parameter)
|
|
14
|
+
@path = path
|
|
15
|
+
@thumbnail = thumbnail
|
|
16
|
+
@title = title
|
|
17
|
+
@type = type
|
|
18
|
+
@window = window
|
|
19
|
+
@window_parameter = window_parameter
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Favourites
|
|
6
|
+
# Favourite.Fields.Favourite https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Fields.Favourite
|
|
7
|
+
module FieldsFavourite
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
WINDOW = 'window'
|
|
11
|
+
WINDOW_PARAMETER = 'windowparameter'
|
|
12
|
+
THUMBNAIL = 'thumbnail'
|
|
13
|
+
PATH = 'path'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Favourites
|
|
6
|
+
# return type for Favourites.GetFavourites
|
|
7
|
+
class GetFavouriteReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :favourites, :limits
|
|
12
|
+
|
|
13
|
+
type_mapping ['favourites', DetailsFavourite, true], ['limits', Types::List::ListLimitsReturned]
|
|
14
|
+
|
|
15
|
+
def initialize(favourites, limits)
|
|
16
|
+
@favourites = favourites
|
|
17
|
+
@limits = limits
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Favourites
|
|
6
|
+
# Favourite.Type https://kodi.wiki/view/JSON-RPC_API/v12#Favourite.Type
|
|
7
|
+
module Type
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
MEDIA = 'media'
|
|
11
|
+
WINDOW = 'window'
|
|
12
|
+
SCRIPT = 'script'
|
|
13
|
+
ANDROID_APP = 'androidapp'
|
|
14
|
+
UNKNOWN = 'unknown'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Files
|
|
6
|
+
# File/Label tuple
|
|
7
|
+
class FileLabel
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :file, :label
|
|
12
|
+
|
|
13
|
+
def initialize(file, label)
|
|
14
|
+
@file = file
|
|
15
|
+
@label = label
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Files
|
|
6
|
+
# return value for GetDirectory
|
|
7
|
+
class GetDirectoryReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :files, :limits
|
|
12
|
+
|
|
13
|
+
type_mapping ['files', List::ListItemFile, true], ['limits', List::ListLimitsReturned]
|
|
14
|
+
|
|
15
|
+
def initialize(files, limits)
|
|
16
|
+
@files = files
|
|
17
|
+
@limits = limits
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Files
|
|
6
|
+
# return value for GetSources
|
|
7
|
+
class GetSourcesReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :sources, :limits
|
|
12
|
+
|
|
13
|
+
type_mapping ['sources', Files::FileLabel, true], ['limits', List::ListLimitsReturned]
|
|
14
|
+
|
|
15
|
+
def initialize(sources, limits)
|
|
16
|
+
@sources = sources
|
|
17
|
+
@limits = limits
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Files
|
|
6
|
+
# Files.Media https://kodi.wiki/view/JSON-RPC_API/v12#Files.Media
|
|
7
|
+
module Media
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
VIDEO = 'video'
|
|
11
|
+
MUSIC = 'music'
|
|
12
|
+
PICTURES = 'pictures'
|
|
13
|
+
FILES = 'files'
|
|
14
|
+
PROGRAMS = 'programs'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Files
|
|
6
|
+
# return value for GetPrepareDownload
|
|
7
|
+
class PrepareDownloadReturned
|
|
8
|
+
include Extensions::Comparable
|
|
9
|
+
extend Extensions::Creatable
|
|
10
|
+
|
|
11
|
+
attr_reader :details, :mode, :protocol
|
|
12
|
+
|
|
13
|
+
def initialize(details, mode, protocol)
|
|
14
|
+
@details = details
|
|
15
|
+
@mode = mode
|
|
16
|
+
@protocol = protocol
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Global
|
|
6
|
+
# direction for left, right, up, down
|
|
7
|
+
module Direction
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
LEFT = 'left'
|
|
11
|
+
RIGHT = 'right'
|
|
12
|
+
UP = 'up'
|
|
13
|
+
DOWN = 'down'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Global
|
|
6
|
+
# Global.Time https://kodi.wiki/view/JSON-RPC_API/v12#Global.Time
|
|
7
|
+
class GlobalTime
|
|
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
|