kodi_client 0.5.6 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/kodi_client.gemspec +3 -3
- data/lib/kodi_client/Chainable.rb +4 -1
- data/lib/kodi_client/global_types/addon_types.rb +50 -52
- data/lib/kodi_client/global_types/application_types.rb +21 -23
- data/lib/kodi_client/global_types/audio_types.rb +179 -29
- data/lib/kodi_client/global_types/favourites_types.rb +14 -17
- data/lib/kodi_client/global_types/files_types.rb +68 -0
- data/lib/kodi_client/global_types/global_types.rb +18 -24
- data/lib/kodi_client/global_types/gui_types.rb +15 -16
- data/lib/kodi_client/global_types/item_types.rb +10 -2
- data/lib/kodi_client/global_types/list_types.rb +326 -98
- data/lib/kodi_client/global_types/media_types.rb +21 -13
- data/lib/kodi_client/global_types/player_type.rb +110 -110
- data/lib/kodi_client/global_types/profiles_types.rb +14 -14
- data/lib/kodi_client/global_types/system_types.rb +7 -9
- data/lib/kodi_client/global_types/video_types.rb +80 -43
- data/lib/kodi_client/method/addons.rb +7 -19
- data/lib/kodi_client/method/application.rb +1 -1
- data/lib/kodi_client/method/audio_library.rb +49 -0
- data/lib/kodi_client/method/favourites.rb +1 -1
- data/lib/kodi_client/method/files.rb +89 -0
- data/lib/kodi_client/method/gui.rb +2 -2
- data/lib/kodi_client/method/player.rb +6 -6
- data/lib/kodi_client/method/profiles.rb +2 -2
- data/lib/kodi_client/method/system.rb +1 -1
- data/lib/kodi_client/util/comparable.rb +4 -1
- data/lib/kodi_client/util/creatable.rb +106 -0
- data/lib/kodi_client.rb +10 -10
- metadata +9 -5
@@ -28,42 +28,30 @@ module KodiClient
|
|
28
28
|
'installed' => installed.nil? || !installed ? 'all' : 'installed'
|
29
29
|
})
|
30
30
|
json = invoke_api(request)
|
31
|
-
|
32
|
-
result = json['result'].nil? ? nil : Types::Addons::Addons.new(json['result'])
|
31
|
+
result = Types::Addons::Addons.create(json['result'])
|
33
32
|
json['result'] = result
|
34
33
|
KodiResponse.new(json)
|
35
34
|
end
|
36
35
|
|
37
36
|
def get_addon_details(addon_id = nil, properties = [], kodi_id = 1)
|
38
|
-
request = KodiRequest.new(kodi_id, GET_ADDON_DETAILS,
|
39
|
-
|
40
|
-
'addonid' => addon_id,
|
41
|
-
'properties' => properties
|
42
|
-
})
|
37
|
+
request = KodiRequest.new(kodi_id, GET_ADDON_DETAILS, { 'addonid' => addon_id,
|
38
|
+
'properties' => properties })
|
43
39
|
json = invoke_api(request)
|
44
40
|
|
45
|
-
result =
|
41
|
+
result = Types::Addons::Addon.create(json['result'])
|
46
42
|
json['result'] = result
|
47
43
|
KodiResponse.new(json)
|
48
44
|
end
|
49
45
|
|
50
46
|
def execute_addon(addon_id = nil, params = '', wait = false, kodi_id = 1)
|
51
|
-
request = KodiRequest.new(kodi_id, EXECUTE_ADDON,
|
52
|
-
|
53
|
-
'addonid' => addon_id,
|
54
|
-
'params' => params,
|
55
|
-
'wait' => wait
|
56
|
-
})
|
47
|
+
request = KodiRequest.new(kodi_id, EXECUTE_ADDON, { 'addonid' => addon_id, 'params' => params,
|
48
|
+
'wait' => wait })
|
57
49
|
json = invoke_api(request)
|
58
50
|
KodiResponse.new(json)
|
59
51
|
end
|
60
52
|
|
61
53
|
def set_addon_enabled(addon_id = nil, enabled = Types::Global::Toggle::TOGGLE, kodi_id = 1)
|
62
|
-
request = KodiRequest.new(kodi_id, SET_ADDON_ENABLED,
|
63
|
-
{
|
64
|
-
'addonid' => addon_id,
|
65
|
-
'enabled' => enabled
|
66
|
-
})
|
54
|
+
request = KodiRequest.new(kodi_id, SET_ADDON_ENABLED, { 'addonid' => addon_id, 'enabled' => enabled })
|
67
55
|
json = invoke_api(request)
|
68
56
|
KodiResponse.new(json)
|
69
57
|
end
|
@@ -28,7 +28,7 @@ module KodiClient
|
|
28
28
|
def get_properties(properties = Types::Application::PropertyName.all_properties, kodi_id = 1)
|
29
29
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
|
30
30
|
json = invoke_api(request)
|
31
|
-
result =
|
31
|
+
result = Types::Application::PropertyValue.create(json['result'])
|
32
32
|
json['result'] = result
|
33
33
|
KodiResponse.new(json)
|
34
34
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/kodi_module'
|
4
|
+
require 'kodi_client/global_types/application_types'
|
5
|
+
|
6
|
+
module KodiClient
|
7
|
+
module Modules
|
8
|
+
# contains all Kodi Application methods
|
9
|
+
class AudioLibrary < KodiModule
|
10
|
+
|
11
|
+
CLEAN = 'AudioLibrary.Clean'
|
12
|
+
EXPORT = 'AudioLibrary.Export'
|
13
|
+
GET_ALBUM_DETAILS = 'AudioLibrary.GetAlbumDetails'
|
14
|
+
GET_ALBUMS = 'AudioLibrary.GetAlbums'
|
15
|
+
|
16
|
+
def clean(show_dialogs = true, kodi_id = 1)
|
17
|
+
request = KodiRequest.new(kodi_id, CLEAN, { 'showdialogs' => show_dialogs })
|
18
|
+
json = invoke_api(request)
|
19
|
+
KodiResponse.new(json)
|
20
|
+
end
|
21
|
+
|
22
|
+
def export(path, kodi_id = 1)
|
23
|
+
request = KodiRequest.new(kodi_id, EXPORT, { 'options' => { 'path' => path } })
|
24
|
+
json = invoke_api(request)
|
25
|
+
KodiResponse.new(json)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_album_details(album_id, properties = Types::Audio::AudioFieldsAlbum.all_properties, kodi_id = 1)
|
29
|
+
request = KodiRequest.new(kodi_id, GET_ALBUM_DETAILS, { 'albumid' => album_id, 'properties' => properties })
|
30
|
+
json = invoke_api(request)
|
31
|
+
KodiResponse.new(json)
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_albums(properties = Types::Audio::AudioFieldsAlbum.all_properties,
|
35
|
+
limits = Types::List::ListLimits.new(0, 50),
|
36
|
+
sort = Types::List::ListSort.new, include_singles = false, all_roles = false, kodi_id = 1)
|
37
|
+
request = KodiRequest.new(kodi_id, GET_ALBUMS,
|
38
|
+
{ 'properties' => properties,
|
39
|
+
'limits' => { 'start' => limits.list_start, 'end' => limits.list_end },
|
40
|
+
'sort' => { 'ignorearticle' => sort.ignore_article, 'method' => sort.method,
|
41
|
+
'order' => sort.order,
|
42
|
+
'useartistsortname' => sort.use_artist_sort_name },
|
43
|
+
'includesingles' => include_singles, 'allroles' => all_roles })
|
44
|
+
json = invoke_api(request)
|
45
|
+
KodiResponse.new(json)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -28,7 +28,7 @@ module KodiClient
|
|
28
28
|
params['type'] = type unless type.nil?
|
29
29
|
request = KodiRequest.new(kodi_id, GET_FAVOURITES, params)
|
30
30
|
json = invoke_api(request)
|
31
|
-
result =
|
31
|
+
result = Types::Favourites::GetFavouriteReturned.create(json['result'])
|
32
32
|
json['result'] = result
|
33
33
|
KodiResponse.new(json)
|
34
34
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'kodi_client/kodi_module'
|
4
|
+
require 'kodi_client/global_types/files_types'
|
5
|
+
require 'kodi_client/global_types/list_types'
|
6
|
+
|
7
|
+
module KodiClient
|
8
|
+
module Modules
|
9
|
+
# contains all Kodi Application methods
|
10
|
+
class Files < KodiModule
|
11
|
+
|
12
|
+
GET_DIRECTORY = 'Files.GetDirectory'
|
13
|
+
GET_FILE_DETAILS = 'Files.GetFileDetails'
|
14
|
+
GET_SOURCES = 'Files.GetSources'
|
15
|
+
PREPARE_DOWNLOAD = 'Files.PrepareDownload'
|
16
|
+
SET_FILE_DETAILS = 'Files.SetFileDetails'
|
17
|
+
|
18
|
+
def get_directory(directory, media = Types::Files::Media::FILES,
|
19
|
+
properties = Types::List::ListFieldFiles.all_properties,
|
20
|
+
sort = Types::List::ListSort.new,
|
21
|
+
limits = Types::List::ListLimits.new(0, 50), kodi_id = 1)
|
22
|
+
request = KodiRequest.new(kodi_id, GET_DIRECTORY,
|
23
|
+
{
|
24
|
+
'directory' => directory,
|
25
|
+
'media' => media,
|
26
|
+
'properties' => properties,
|
27
|
+
'sort' => { 'ignorearticle' => sort.ignore_article, 'method' => sort.method,
|
28
|
+
'order' => sort.order,
|
29
|
+
'useartistsortname' => sort.use_artist_sort_name },
|
30
|
+
'limits' => { 'start' => limits.list_start, 'end' => limits.list_end }
|
31
|
+
})
|
32
|
+
json = invoke_api(request)
|
33
|
+
result = KodiClient::Types::Files::GetDirectoryReturned.create(json['result'])
|
34
|
+
json['result'] = result
|
35
|
+
KodiResponse.new(json)
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_file_details(file, media = Types::Files::Media::FILES,
|
39
|
+
properties = Types::List::ListFieldFiles.all_properties, kodi_id = 1)
|
40
|
+
request = KodiRequest.new(kodi_id, GET_FILE_DETAILS,
|
41
|
+
{
|
42
|
+
'file' => file,
|
43
|
+
'media' => media,
|
44
|
+
'properties' => properties
|
45
|
+
})
|
46
|
+
json = invoke_api(request)
|
47
|
+
result = KodiClient::Types::List::ListItemFile.create(json['result'])
|
48
|
+
json['result'] = result
|
49
|
+
KodiResponse.new(json)
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_sources(media = Types::Files::Media::FILES,
|
53
|
+
sort = Types::List::ListSort.new,
|
54
|
+
limits = Types::List::ListLimits.new(0, 50), kodi_id = 1)
|
55
|
+
request = KodiRequest.new(kodi_id, GET_SOURCES,
|
56
|
+
{
|
57
|
+
'media' => media,
|
58
|
+
'sort' => { 'ignorearticle' => sort.ignore_article, 'method' => sort.method,
|
59
|
+
'order' => sort.order,
|
60
|
+
'useartistsortname' => sort.use_artist_sort_name },
|
61
|
+
'limits' => { 'start' => limits.list_start, 'end' => limits.list_end }
|
62
|
+
})
|
63
|
+
json = invoke_api(request)
|
64
|
+
result = KodiClient::Types::Files::GetSourcesReturned.create(json['result'])
|
65
|
+
json['result'] = result
|
66
|
+
KodiResponse.new(json)
|
67
|
+
end
|
68
|
+
|
69
|
+
def prepare_download(path, kodi_id = 1)
|
70
|
+
request = KodiRequest.new(kodi_id, PREPARE_DOWNLOAD, { 'path' => path })
|
71
|
+
json = invoke_api(request)
|
72
|
+
result = KodiClient::Types::Files::PrepareDownloadReturned.create(json['result'])
|
73
|
+
json['result'] = result
|
74
|
+
KodiResponse.new(json)
|
75
|
+
end
|
76
|
+
|
77
|
+
def set_file_details(file, media = Types::Files::Media::VIDEO, play_count = nil, last_played = nil,
|
78
|
+
resume = nil, kodi_id = 1)
|
79
|
+
params = { 'file' => file, 'media' => media}
|
80
|
+
params['playcount'] = play_count unless play_count.nil?
|
81
|
+
params['lastplayed'] = last_played unless last_played.nil?
|
82
|
+
params['resume'] = resume unless resume.nil?
|
83
|
+
request = KodiRequest.new(kodi_id, SET_FILE_DETAILS, params)
|
84
|
+
json = invoke_api(request)
|
85
|
+
KodiResponse.new(json)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -24,7 +24,7 @@ module KodiClient
|
|
24
24
|
def get_properties(properties = Types::GUI::PropertyName.all_properties, kodi_id = 1)
|
25
25
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
|
26
26
|
json = invoke_api(request)
|
27
|
-
result =
|
27
|
+
result = KodiClient::Types::GUI::PropertyValue.create(json['result'])
|
28
28
|
json['result'] = result
|
29
29
|
KodiResponse.new(json)
|
30
30
|
end
|
@@ -32,7 +32,7 @@ module KodiClient
|
|
32
32
|
def get_stereoscopic_modes(kodi_id = 1)
|
33
33
|
request = KodiRequest.new(kodi_id, GET_STEREOSCOPIC_MODES, {})
|
34
34
|
json = invoke_api(request)
|
35
|
-
result =
|
35
|
+
result = Types::GUI::StereoscopyMode.create_list(json['result']['stereoscopicmodes'])
|
36
36
|
json['result'] = result
|
37
37
|
KodiResponse.new(json)
|
38
38
|
end
|
@@ -41,7 +41,7 @@ module KodiClient
|
|
41
41
|
def get_active_players(kodi_id = 1)
|
42
42
|
request = KodiRequest.new(kodi_id, GET_ACTIVE_PLAYER, {})
|
43
43
|
json = invoke_api(request)
|
44
|
-
result =
|
44
|
+
result = Types::Player::Player.create_list(json['result'])
|
45
45
|
json['result'] = result
|
46
46
|
KodiResponse.new(json)
|
47
47
|
end
|
@@ -57,7 +57,7 @@ module KodiClient
|
|
57
57
|
request = KodiRequest.new(kodi_id, GET_ITEM, { 'playerid' => player_id,
|
58
58
|
'properties' => properties })
|
59
59
|
json = invoke_api(request)
|
60
|
-
result = Types::List::ListItemAll.
|
60
|
+
result = Types::List::ListItemAll.create(json['result']['item'])
|
61
61
|
json['result'] = result
|
62
62
|
KodiResponse.new(json)
|
63
63
|
end
|
@@ -65,7 +65,7 @@ module KodiClient
|
|
65
65
|
def get_players(media = Types::Media::MediaType::ALL, kodi_id = 1)
|
66
66
|
request = KodiRequest.new(kodi_id, GET_PLAYERS, { 'media' => media })
|
67
67
|
json = invoke_api(request)
|
68
|
-
result =
|
68
|
+
result = Types::Player::Player.create_list(json['result'])
|
69
69
|
json['result'] = result
|
70
70
|
KodiResponse.new(json)
|
71
71
|
end
|
@@ -74,7 +74,7 @@ module KodiClient
|
|
74
74
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'playerid' => player_id,
|
75
75
|
'properties' => properties })
|
76
76
|
json = invoke_api(request)
|
77
|
-
result = Types::Player::PropertyValue.
|
77
|
+
result = Types::Player::PropertyValue.create(json['result'])
|
78
78
|
json['result'] = result
|
79
79
|
KodiResponse.new(json)
|
80
80
|
end
|
@@ -82,7 +82,7 @@ module KodiClient
|
|
82
82
|
def get_view_mode(kodi_id = 1)
|
83
83
|
request = KodiRequest.new(kodi_id, GET_VIEW_MODE, {})
|
84
84
|
json = invoke_api(request)
|
85
|
-
result = Types::Player::PlayerViewMode.
|
85
|
+
result = Types::Player::PlayerViewMode.create(json['result'])
|
86
86
|
json['result'] = result
|
87
87
|
KodiResponse.new(json)
|
88
88
|
end
|
@@ -130,7 +130,7 @@ module KodiClient
|
|
130
130
|
def seek(player_id, value, kodi_id = 1)
|
131
131
|
request = KodiRequest.new(kodi_id, SEEK, { 'playerid' => player_id, 'value' => value })
|
132
132
|
json = invoke_api(request)
|
133
|
-
result = Types::Player::
|
133
|
+
result = Types::Player::SeekReturned.create(json['result'])
|
134
134
|
json['result'] = result
|
135
135
|
KodiResponse.new(json)
|
136
136
|
end
|
@@ -15,7 +15,7 @@ module KodiClient
|
|
15
15
|
def get_current_profile(properties = Types::Profiles::FieldsProfile.all_properties, kodi_id = 1)
|
16
16
|
request = KodiRequest.new(kodi_id, GET_CURRENT_PROFILE, { 'properties' => properties })
|
17
17
|
json = invoke_api(request)
|
18
|
-
result =
|
18
|
+
result = Types::Profiles::DetailsProfile.create(json['result'])
|
19
19
|
json['result'] = result
|
20
20
|
KodiResponse.new(json)
|
21
21
|
end
|
@@ -30,7 +30,7 @@ module KodiClient
|
|
30
30
|
'order' => sort.order,
|
31
31
|
'useartistsortname' => sort.use_artist_sort_name } })
|
32
32
|
json = invoke_api(request)
|
33
|
-
result =
|
33
|
+
result = Types::Profiles::GetProfilesReturned.create(json['result'])
|
34
34
|
json['result'] = result
|
35
35
|
KodiResponse.new(json)
|
36
36
|
end
|
@@ -25,7 +25,7 @@ module KodiClient
|
|
25
25
|
def get_properties(properties = Types::System::PropertyName.all_properties, kodi_id = 1)
|
26
26
|
request = KodiRequest.new(kodi_id, GET_PROPERTIES, { 'properties' => properties })
|
27
27
|
json = invoke_api(request)
|
28
|
-
result =
|
28
|
+
result = Types::System::PropertyValue.create(json['result'])
|
29
29
|
json['result'] = result
|
30
30
|
KodiResponse.new(json)
|
31
31
|
end
|
@@ -4,7 +4,6 @@ module KodiClient
|
|
4
4
|
|
5
5
|
# offers compare methods
|
6
6
|
module Comparable
|
7
|
-
|
8
7
|
def compare(obj1, obj2)
|
9
8
|
is_same = true
|
10
9
|
obj1.instance_variables.each do |it|
|
@@ -13,5 +12,9 @@ module KodiClient
|
|
13
12
|
|
14
13
|
is_same
|
15
14
|
end
|
15
|
+
|
16
|
+
def ==(other)
|
17
|
+
compare(self, other)
|
18
|
+
end
|
16
19
|
end
|
17
20
|
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module KodiClient
|
4
|
+
|
5
|
+
# creates a create and create_list method by hash
|
6
|
+
module Creatable
|
7
|
+
|
8
|
+
def fields_to_map(fields)
|
9
|
+
@fields_to_map = fields
|
10
|
+
end
|
11
|
+
|
12
|
+
def type_mapping(*args)
|
13
|
+
return if args.nil?
|
14
|
+
|
15
|
+
@type_mapping = {}
|
16
|
+
args.map { |it| @type_mapping[it[0]] = Creatable::CreateMap.new(it[1], it[2].nil? ? false : it[2]) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def lazy_type_mapping
|
20
|
+
{}
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_list(hash)
|
24
|
+
hash.nil? ? [] : hash.map { |it| create(it) }.reject(&:nil?)
|
25
|
+
end
|
26
|
+
|
27
|
+
def create(hash)
|
28
|
+
return nil if hash.nil?
|
29
|
+
|
30
|
+
if @fields_to_map.nil? || @fields_to_map.empty?
|
31
|
+
fields = @kodi_fields
|
32
|
+
return nil if @kodi_fields.none? { |it| !hash[it.to_s.gsub('_', '')].nil? }
|
33
|
+
else
|
34
|
+
fields = @fields_to_map
|
35
|
+
end
|
36
|
+
|
37
|
+
mapping = @type_mapping.nil? ? lazy_type_mapping : @type_mapping
|
38
|
+
args = fields.map do |it|
|
39
|
+
field = it.to_s.gsub('_', '')
|
40
|
+
Creatable.extract_field_from_hash(field, hash, mapping)
|
41
|
+
end
|
42
|
+
|
43
|
+
new(*args)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.hash_to_arr(hash, fields, mapping = {})
|
47
|
+
return nil if hash.nil?
|
48
|
+
|
49
|
+
fields.map do |it|
|
50
|
+
field = it.to_s.gsub('_', '')
|
51
|
+
extract_field_from_hash(field, hash, mapping)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def hash_to_arr(hash, fields)
|
56
|
+
Creatable.hash_to_arr(hash, fields, @type_mapping.nil? ? {} : @type_mapping)
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.extract_field_from_hash(field, hash, mapping)
|
60
|
+
map = mapping[field]
|
61
|
+
return nil if hash[field].nil? && map.nil?
|
62
|
+
|
63
|
+
return hash[field] if map.nil?
|
64
|
+
|
65
|
+
return map.type.create_list(hash[field]) if map.is_list
|
66
|
+
|
67
|
+
map.type.create(hash[field])
|
68
|
+
end
|
69
|
+
|
70
|
+
def attr_accessor(*args)
|
71
|
+
attr_reader(*args)
|
72
|
+
attr_writer(*args)
|
73
|
+
end
|
74
|
+
|
75
|
+
def attr_reader(*args)
|
76
|
+
@kodi_fields = args.map { |it| it.to_s.gsub('_', '') }
|
77
|
+
|
78
|
+
args.each do |it|
|
79
|
+
inst_variable_name = "@#{it}".to_sym
|
80
|
+
define_method it do
|
81
|
+
instance_variable_get(inst_variable_name)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def attr_writer(*args)
|
87
|
+
args.each do |it|
|
88
|
+
inst_variable_name = "@#{it}".to_sym
|
89
|
+
define_method "#{it}=" do |new_value|
|
90
|
+
instance_variable_set(inst_variable_name, new_value)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# mapping class with the type and if it is a list field or not
|
96
|
+
class CreateMap
|
97
|
+
|
98
|
+
attr_reader :type, :is_list
|
99
|
+
|
100
|
+
def initialize(type, is_list = false)
|
101
|
+
@type = type
|
102
|
+
@is_list = is_list
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/lib/kodi_client.rb
CHANGED
@@ -5,8 +5,10 @@ require 'json'
|
|
5
5
|
|
6
6
|
require 'kodi_client/Chainable'
|
7
7
|
require 'kodi_client/method/addons'
|
8
|
+
require 'kodi_client/method/audio_library'
|
8
9
|
require 'kodi_client/method/application'
|
9
10
|
require 'kodi_client/method/favourites'
|
11
|
+
require 'kodi_client/method/files'
|
10
12
|
require 'kodi_client/method/gui'
|
11
13
|
require 'kodi_client/method/input'
|
12
14
|
require 'kodi_client/method/player'
|
@@ -22,12 +24,14 @@ module KodiClient
|
|
22
24
|
class Client
|
23
25
|
include Chainable
|
24
26
|
|
25
|
-
attr_reader :addons, :application, :
|
27
|
+
attr_reader :audio_library, :addons, :application, :favourites, :files, :gui, :input, :player, :profiles, :system
|
26
28
|
|
27
29
|
def initialize
|
28
30
|
@addons = KodiClient::Modules::Addons.new
|
31
|
+
@audio_library = KodiClient::Modules::AudioLibrary.new
|
29
32
|
@application = KodiClient::Modules::Application.new
|
30
33
|
@favourites = KodiClient::Modules::Favourites.new
|
34
|
+
@files = KodiClient::Modules::Files.new
|
31
35
|
@gui = KodiClient::Modules::GUI.new
|
32
36
|
@input = KodiClient::Modules::Input.new
|
33
37
|
@player = KodiClient::Modules::Player.new
|
@@ -35,15 +39,11 @@ module KodiClient
|
|
35
39
|
@system = KodiClient::Modules::System.new
|
36
40
|
end
|
37
41
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
@player.apply_options(options)
|
44
|
-
@favourites.apply_options(options)
|
45
|
-
@profiles.apply_options(options)
|
46
|
-
@system.apply_options(options)
|
42
|
+
def apply_options_to_methods(options)
|
43
|
+
instance_variables.each do |it|
|
44
|
+
mod = instance_variable_get(it)
|
45
|
+
mod.apply_options(options) if mod.is_a?(KodiClient::KodiModule)
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kodi_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Feier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -25,9 +25,9 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 5.0.4
|
27
27
|
description: A client for the Kodi JSON API v12, currently implemented methods are
|
28
|
-
|
29
|
-
be added with the time). For more information how to use it and how to
|
30
|
-
Remote Control in Kodi, please check the github page https://github.com/cfe86/RubyKodiClient
|
28
|
+
Addons, Application, Favourites, Files, GUI, Input, Player, Profiles and System
|
29
|
+
(more will be added with the time). For more information how to use it and how to
|
30
|
+
activate Remote Control in Kodi, please check the github page https://github.com/cfe86/RubyKodiClient
|
31
31
|
email:
|
32
32
|
- christian.feier@gmail.com
|
33
33
|
executables: []
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/kodi_client/global_types/application_types.rb
|
48
48
|
- lib/kodi_client/global_types/audio_types.rb
|
49
49
|
- lib/kodi_client/global_types/favourites_types.rb
|
50
|
+
- lib/kodi_client/global_types/files_types.rb
|
50
51
|
- lib/kodi_client/global_types/global_types.rb
|
51
52
|
- lib/kodi_client/global_types/gui_types.rb
|
52
53
|
- lib/kodi_client/global_types/input_types.rb
|
@@ -61,7 +62,9 @@ files:
|
|
61
62
|
- lib/kodi_client/kodi_module.rb
|
62
63
|
- lib/kodi_client/method/addons.rb
|
63
64
|
- lib/kodi_client/method/application.rb
|
65
|
+
- lib/kodi_client/method/audio_library.rb
|
64
66
|
- lib/kodi_client/method/favourites.rb
|
67
|
+
- lib/kodi_client/method/files.rb
|
65
68
|
- lib/kodi_client/method/gui.rb
|
66
69
|
- lib/kodi_client/method/input.rb
|
67
70
|
- lib/kodi_client/method/player.rb
|
@@ -69,6 +72,7 @@ files:
|
|
69
72
|
- lib/kodi_client/method/system.rb
|
70
73
|
- lib/kodi_client/options.rb
|
71
74
|
- lib/kodi_client/util/comparable.rb
|
75
|
+
- lib/kodi_client/util/creatable.rb
|
72
76
|
- lib/kodi_client/util/iterable.rb
|
73
77
|
homepage: https://github.com/cfe86/RubyKodiClient
|
74
78
|
licenses:
|