kodi_client 0.6.3 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/README.md +1 -0
- data/kodi_client.gemspec +2 -2
- data/lib/kodi_client/extensions/chainable.rb +73 -0
- data/lib/kodi_client/extensions/comparable.rb +29 -0
- data/lib/kodi_client/extensions/creatable.rb +132 -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 +6 -6
- data/lib/kodi_client/{method → methods}/application.rb +2 -2
- data/lib/kodi_client/methods/audio_library.rb +334 -0
- data/lib/kodi_client/{method → methods}/favourites.rb +2 -2
- data/lib/kodi_client/{method → methods}/files.rb +6 -10
- 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 +5 -7
- data/lib/kodi_client/{method → methods}/system.rb +2 -2
- data/lib/kodi_client/methods/video_library.rb +18 -0
- 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_artist_role_type.rb +21 -0
- data/lib/kodi_client/types/audio/audio_contributor_type.rb +22 -0
- data/lib/kodi_client/types/audio/audio_details_album_type.rb +58 -0
- data/lib/kodi_client/types/audio/audio_details_artist_type.rb +53 -0
- data/lib/kodi_client/types/audio/audio_details_base_type.rb +30 -0
- data/lib/kodi_client/types/audio/audio_details_media_type.rb +50 -0
- data/lib/kodi_client/types/audio/audio_details_role_type.rb +25 -0
- data/lib/kodi_client/types/audio/audio_details_song_type.rb +72 -0
- data/lib/kodi_client/types/audio/audio_fields_album_type.rb +50 -0
- data/lib/kodi_client/types/audio/audio_fields_artist_type.rb +39 -0
- data/lib/kodi_client/types/audio/audio_fields_role_type.rb +15 -0
- data/lib/kodi_client/types/audio/audio_fields_song_type.rb +61 -0
- data/lib/kodi_client/types/audio/available_art_type.rb +21 -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/audio/get_artists_returned_type.rb +23 -0
- data/lib/kodi_client/types/audio/get_genres_returned_type.rb +24 -0
- data/lib/kodi_client/types/audio/get_roles_returned_type.rb +25 -0
- data/lib/kodi_client/types/audio/get_songs_returned_type.rb +25 -0
- data/lib/kodi_client/types/audio/get_sources_return_type.rb +25 -0
- data/lib/kodi_client/types/audio/property_name_type.rb +25 -0
- data/lib/kodi_client/types/audio/property_value_type.rb +33 -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} +2 -4
- data/lib/kodi_client/types/library/library_details_genre_type.rb +27 -0
- data/lib/kodi_client/types/library/library_details_source_type.rb +26 -0
- data/lib/kodi_client/types/library/library_fields_genre_type.rb +17 -0
- data/lib/kodi_client/types/library/library_fields_source_type.rb +17 -0
- 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 +70 -0
- data/lib/kodi_client/types/list/list_item_base_type.rb +141 -0
- data/lib/kodi_client/types/list/list_item_file_type.rb +66 -0
- data/lib/kodi_client/types/list/list_limits_returned_type.rb +23 -0
- data/lib/kodi_client/types/list/list_limits_type.rb +23 -0
- data/lib/kodi_client/types/list/list_sort_method_type.rb +54 -0
- data/lib/kodi_client/types/list/list_sort_type.rb +28 -0
- data/lib/kodi_client/types/list/sort_order_type.rb +15 -0
- data/lib/kodi_client/types/media/media_artwork_type.rb +26 -0
- data/lib/kodi_client/types/media/media_details_base_type.rb +29 -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_content_type_type.rb +18 -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 +160 -49
- metadata +132 -38
- data/lib/kodi_client/Chainable.rb +0 -48
- data/lib/kodi_client/kodi_module.rb +0 -80
- data/lib/kodi_client/method/audio_library.rb +0 -46
- 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,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
|
|
7
|
+
# Audio.Artist.Roles https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Artist.Roles
|
|
8
|
+
class AudioArtistRole
|
|
9
|
+
include Extensions::Comparable
|
|
10
|
+
extend Extensions::Creatable
|
|
11
|
+
|
|
12
|
+
attr_reader :role, :role_id
|
|
13
|
+
|
|
14
|
+
def initialize(role, role_id)
|
|
15
|
+
@role = role
|
|
16
|
+
@role_id = role_id
|
|
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 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,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 AudioDetailsAlbum
|
|
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,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Artist https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Artist
|
|
7
|
+
class AudioDetailsArtist
|
|
8
|
+
include AudioDetailsBase
|
|
9
|
+
include Extensions::Comparable
|
|
10
|
+
extend Extensions::Creatable
|
|
11
|
+
|
|
12
|
+
attr_reader :artist, :artist_id, :born, :compilation_artist, :description, :died, :disambiguation, :disbanded,
|
|
13
|
+
:formed, :gender, :instrument, :is_album_artist, :mood, :musicbrainz_artist_id, :roles, :song_genres,
|
|
14
|
+
:sort_name, :source_id, :style, :type, :years_active
|
|
15
|
+
|
|
16
|
+
fields_to_map %w[artist artist_id born compilation_artist description died disambiguation disbanded
|
|
17
|
+
formed gender instrument is_album_artist mood musicbrainz_artist_id roles song_genres
|
|
18
|
+
sort_name source_id style type years_active art date_added genre fan_art thumbnail
|
|
19
|
+
label]
|
|
20
|
+
|
|
21
|
+
type_mapping ['songgenres', Genre, true], ['art', Types::Media::MediaArtwork], ['roles', AudioArtistRole, true]
|
|
22
|
+
|
|
23
|
+
def initialize(artist, artist_id, born, compilation_artist, description, died, disambiguation, disbanded,
|
|
24
|
+
formed, gender, instrument, is_album_artist, mood, musicbrainz_artist_id, roles, song_genres,
|
|
25
|
+
sort_name, source_id, style, type, years_active, art, date_added, genre, fan_art, thumbnail,
|
|
26
|
+
label)
|
|
27
|
+
@artist = artist
|
|
28
|
+
@artist_id = artist_id
|
|
29
|
+
@born = born
|
|
30
|
+
@compilation_artist = compilation_artist
|
|
31
|
+
@description = description
|
|
32
|
+
@died = died
|
|
33
|
+
@disambiguation = disambiguation
|
|
34
|
+
@disbanded = disbanded
|
|
35
|
+
@formed = formed
|
|
36
|
+
@gender = gender
|
|
37
|
+
@instrument = instrument
|
|
38
|
+
@is_album_artist = is_album_artist
|
|
39
|
+
@mood = mood
|
|
40
|
+
@musicbrainz_artist_id = musicbrainz_artist_id
|
|
41
|
+
@roles = roles
|
|
42
|
+
@song_genres = song_genres
|
|
43
|
+
@sort_name = sort_name
|
|
44
|
+
@source_id = source_id
|
|
45
|
+
@style = style
|
|
46
|
+
@type = type
|
|
47
|
+
@years_active = years_active
|
|
48
|
+
audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
[['art', Types::Media::MediaArtwork]] + media_details_base_mappings
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def audio_details_base_by_hash(hash)
|
|
17
|
+
audio_details_base(*Extensions::Creatable.hash_to_arr(hash, %w[art date_added genre fan_art thumbnail label]),
|
|
18
|
+
audio_details_base_mappings)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
22
|
+
@art = art
|
|
23
|
+
@date_added = date_added
|
|
24
|
+
@genre = genre
|
|
25
|
+
media_details_base(fan_art, thumbnail, label)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
def self.included(base)
|
|
11
|
+
base.extend(self)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
attr_reader :artist, :artist_id, :display_artist, :musicbrainz_album_artist_id, :original_date, :rating,
|
|
15
|
+
:release_date, :sort_artist, :title, :user_rating, :votes, :year
|
|
16
|
+
|
|
17
|
+
def audio_details_media_mappings
|
|
18
|
+
audio_details_base_mappings
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def audio_details_media_by_hash(hash)
|
|
22
|
+
audio_details_media(*Extensions::Creatable.hash_to_arr(hash, %w[artist artist_id display_artist
|
|
23
|
+
musicbrainz_album_artist_id original_date
|
|
24
|
+
rating release_date sort_artist title
|
|
25
|
+
user_rating votes year art date_added
|
|
26
|
+
genre fan_art thumbnail label],
|
|
27
|
+
audio_details_base_mappings))
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
31
|
+
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
32
|
+
art, date_added, genre, fan_art, thumbnail, label)
|
|
33
|
+
@artist = artist
|
|
34
|
+
@artist_id = artist_id
|
|
35
|
+
@display_artist = display_artist
|
|
36
|
+
@musicbrainz_album_artist_id = musicbrainz_album_artist_id
|
|
37
|
+
@original_date = original_date
|
|
38
|
+
@rating = rating
|
|
39
|
+
@release_date = release_date
|
|
40
|
+
@sort_artist = sort_artist
|
|
41
|
+
@title = title
|
|
42
|
+
@user_rating = user_rating
|
|
43
|
+
@votes = votes
|
|
44
|
+
@year = year
|
|
45
|
+
audio_details_base(art, date_added, genre, fan_art, thumbnail, label)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Role https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Role
|
|
7
|
+
class AudioDetailsRole
|
|
8
|
+
include Items::ItemDetailsBase
|
|
9
|
+
include Extensions::Comparable
|
|
10
|
+
extend Extensions::Creatable
|
|
11
|
+
|
|
12
|
+
attr_reader :role_id, :title
|
|
13
|
+
|
|
14
|
+
fields_to_map %w[role_id title label]
|
|
15
|
+
|
|
16
|
+
def initialize(role_id, title, label)
|
|
17
|
+
@role_id = role_id
|
|
18
|
+
@title = title
|
|
19
|
+
item_details_base(label)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Details.Song https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Details.Song
|
|
7
|
+
class AudioDetailsSong
|
|
8
|
+
include AudioDetailsMedia
|
|
9
|
+
include Extensions::Comparable
|
|
10
|
+
extend Extensions::Creatable
|
|
11
|
+
|
|
12
|
+
attr_reader :album, :album_artist, :album_artist_id, :album_id, :album_release_type, :bitrate, :bpm, :channels,
|
|
13
|
+
:comment, :contributors, :disc, :disc_title, :display_composer, :display_conductor,
|
|
14
|
+
:display_lyricist, :display_orchestra, :duration, :file, :genre_id, :last_played, :lyrics, :mood,
|
|
15
|
+
:musicbrainz_artist_id, :musicbrainz_track_id, :play_count, :sample_rate, :song_id, :source_id,
|
|
16
|
+
:track
|
|
17
|
+
|
|
18
|
+
type_mapping ['contributors', Types::Audio::AudioContributor, true], *audio_details_media_mappings
|
|
19
|
+
|
|
20
|
+
fields_to_map %w[album album_artist album_artist_id album_id album_release_type bitrate bpm channels
|
|
21
|
+
comment contributors disc disc_title display_composer display_conductor display_lyricist
|
|
22
|
+
display_orchestra duration file genre_id last_played lyrics mood musicbrainz_artist_id
|
|
23
|
+
musicbrainz_track_id play_count sample_rate song_id source_id track
|
|
24
|
+
artist artist_id display_artist musicbrainz_album_artist_id original_date
|
|
25
|
+
rating release_date sort_artist title user_rating votes year
|
|
26
|
+
art date_added genre fan_art thumbnail label]
|
|
27
|
+
|
|
28
|
+
def initialize(album, album_artist, album_artist_id, album_id, album_release_type, bitrate, bpm, channels,
|
|
29
|
+
comment, contributors, disc, disc_title, display_composer, display_conductor, display_lyricist,
|
|
30
|
+
display_orchestra, duration, file, genre_id, last_played, lyrics, mood, musicbrainz_artist_id,
|
|
31
|
+
musicbrainz_track_id, play_count, sample_rate, song_id, source_id, track,
|
|
32
|
+
artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
33
|
+
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
34
|
+
art, date_added, genre, fan_art, thumbnail, label)
|
|
35
|
+
@album = album
|
|
36
|
+
@album_artist = album_artist
|
|
37
|
+
@album_artist_id = album_artist_id
|
|
38
|
+
@album_id = album_id
|
|
39
|
+
@album_release_type = album_release_type
|
|
40
|
+
@bitrate = bitrate
|
|
41
|
+
@bpm = bpm
|
|
42
|
+
@channels = channels
|
|
43
|
+
@comment = comment
|
|
44
|
+
@contributors = contributors
|
|
45
|
+
@disc = disc
|
|
46
|
+
@disc_title = disc_title
|
|
47
|
+
@display_composer = display_composer
|
|
48
|
+
@display_conductor = display_conductor
|
|
49
|
+
@display_lyricist = display_lyricist
|
|
50
|
+
@display_orchestra = display_orchestra
|
|
51
|
+
@duration = duration
|
|
52
|
+
@file = file
|
|
53
|
+
@genre_id = genre_id
|
|
54
|
+
@last_played = last_played
|
|
55
|
+
@lyrics = lyrics
|
|
56
|
+
@mood = mood
|
|
57
|
+
@musicbrainz_artist_id = musicbrainz_artist_id
|
|
58
|
+
@musicbrainz_track_id = musicbrainz_track_id
|
|
59
|
+
@play_count = play_count
|
|
60
|
+
@sample_rate = sample_rate
|
|
61
|
+
@song_id = song_id
|
|
62
|
+
@source_id = source_id
|
|
63
|
+
@track = track
|
|
64
|
+
audio_details_media(artist, artist_id, display_artist, musicbrainz_album_artist_id, original_date,
|
|
65
|
+
rating, release_date, sort_artist, title, user_rating, votes, year,
|
|
66
|
+
art, date_added, genre, fan_art, thumbnail, label)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
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_DURATION = 'albumduration'
|
|
11
|
+
ALBUM_LABEL = 'albumlabel'
|
|
12
|
+
ALBUM_STATUS = 'albumstatus'
|
|
13
|
+
ART = 'art'
|
|
14
|
+
ARTIST = 'artist'
|
|
15
|
+
ARTIST_ID = 'artistid'
|
|
16
|
+
COMPILATION = 'compilation'
|
|
17
|
+
DATE_ADDED = 'dateadded'
|
|
18
|
+
DATE_MODIFIED = 'datemodified'
|
|
19
|
+
DATE_NEW = 'datenew'
|
|
20
|
+
DESCRIPTION = 'description'
|
|
21
|
+
DISPLAY_ARTIST = 'displayartist'
|
|
22
|
+
FAN_ART = 'fanart'
|
|
23
|
+
GENRE = 'genre'
|
|
24
|
+
IS_BOX_SET = 'isboxset'
|
|
25
|
+
LAST_PLAYED = 'lastplayed'
|
|
26
|
+
MOOD = 'mood'
|
|
27
|
+
MUSICBRAINZ_ALBUM_ARTIST_ID = 'musicbrainzalbumartistid'
|
|
28
|
+
MUSICBRAINZ_ALBUM_ID = 'musicbrainzalbumid'
|
|
29
|
+
MUSICBRAINZ_RELEASE_GROUP_ID = 'musicbrainzreleasegroupid'
|
|
30
|
+
ORIGINAL_DATE = 'originaldate'
|
|
31
|
+
PLAY_COUNT = 'playcount'
|
|
32
|
+
RATING = 'rating'
|
|
33
|
+
RELEASE_DATE = 'releasedate'
|
|
34
|
+
RELEASE_TYPE = 'releasetype'
|
|
35
|
+
SONG_GENRES = 'songgenres'
|
|
36
|
+
SORT_ARTIST = 'sortartist'
|
|
37
|
+
SOURCE_ID = 'sourceid'
|
|
38
|
+
STYLE = 'style'
|
|
39
|
+
THEME = 'theme'
|
|
40
|
+
THUMBNAIL = 'thumbnail'
|
|
41
|
+
TITLE = 'title'
|
|
42
|
+
TOTAL_DISCS = 'totaldiscs'
|
|
43
|
+
TYPE = 'type'
|
|
44
|
+
USER_RATING = 'userrating'
|
|
45
|
+
VOTES = 'votes'
|
|
46
|
+
YEAR = 'year'
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Fields.Artist https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Fields.Artist
|
|
7
|
+
module AudioFieldsArtist
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
INSTRUMENT = 'instrument'
|
|
11
|
+
STYLE = 'style'
|
|
12
|
+
MOOD = 'mood'
|
|
13
|
+
BORN = 'born'
|
|
14
|
+
FORMED = 'formed'
|
|
15
|
+
DESCRIPTION = 'description'
|
|
16
|
+
GENRE = 'genre'
|
|
17
|
+
DIED = 'died'
|
|
18
|
+
DISBANDED = 'disbanded'
|
|
19
|
+
YEARS_ACTIVE = 'yearsactive'
|
|
20
|
+
MUSICBRAINZ_ARTIST_ID = 'musicbrainzartistid'
|
|
21
|
+
FAN_ART = 'fanart'
|
|
22
|
+
THUMBNAIL = 'thumbnail'
|
|
23
|
+
COMPILATION_ARTIST = 'compilationartist'
|
|
24
|
+
DATE_ADDED = 'dateadded'
|
|
25
|
+
ROLES = 'roles'
|
|
26
|
+
SONG_GENRES = 'songgenres'
|
|
27
|
+
IS_ALBUM_ARTIST = 'isalbumartist'
|
|
28
|
+
SORT_NAME = 'sortname'
|
|
29
|
+
TYPE = 'type'
|
|
30
|
+
GENDER = 'gender'
|
|
31
|
+
DISAMBIGUATION = 'disambiguation'
|
|
32
|
+
ART = 'art'
|
|
33
|
+
SOURCE_ID = 'sourceid'
|
|
34
|
+
DATE_MODIFIED = 'datemodified'
|
|
35
|
+
DATE_NEW = 'datenew'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module KodiClient
|
|
4
|
+
module Types
|
|
5
|
+
module Audio
|
|
6
|
+
# Audio.Fields.Role https://kodi.wiki/view/JSON-RPC_API/v12#Audio.Fields.Role
|
|
7
|
+
module AudioFieldsRole
|
|
8
|
+
extend Extensions::Iterable
|
|
9
|
+
|
|
10
|
+
TITLE = 'title'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|