vk_music 2.1.3 → 2.1.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/lib/vk_music/client.rb +2 -2
- data/test/test_from_id.rb +8 -0
- data/vk_music.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78762df4d72ae1bdb007f992aab2b77ea10d16a9481784323585d9539a0b04c7
|
|
4
|
+
data.tar.gz: 7d4eb4eb4be42f3c2252a687cbd6f995877326461200bb08dad0a073d1aa0c8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b71584b7a5cea3b2f13e7c0965784a9be8e2e40f7c20ee118b73a53e6dc37c89c562620144ac84432049d3365e505d0710e916a68b0d859fc64bc79db787634e
|
|
7
|
+
data.tar.gz: f5865b1f21529cf8701b1876a83cc4c3d43df02142f78b42d25780cd09209e6d670b29a2ac6708af949d66e3f75fce5cfaddbbb586928f8b96ad14879bb057e6
|
data/lib/vk_music/client.rb
CHANGED
|
@@ -310,7 +310,7 @@ module VkMusic
|
|
|
310
310
|
# @return [Array<Audio>] array of audios with download URLs.
|
|
311
311
|
def from_id(args)
|
|
312
312
|
begin
|
|
313
|
-
args.map
|
|
313
|
+
args_formatted = args.map do |el|
|
|
314
314
|
case el
|
|
315
315
|
when Array
|
|
316
316
|
el.join("_")
|
|
@@ -327,7 +327,7 @@ module VkMusic
|
|
|
327
327
|
end
|
|
328
328
|
|
|
329
329
|
result = []
|
|
330
|
-
|
|
330
|
+
args_formatted.each_slice(10) do |subarray|
|
|
331
331
|
json = load__json__audios_by_id(subarray)
|
|
332
332
|
subresult = audios__from_data(json["data"][0].to_a)
|
|
333
333
|
raise Exceptions::ParseError, "Result size don't match: excepected #{subarray.size}, got #{subresult.size}", caller if subresult.size != subarray.size
|
data/test/test_from_id.rb
CHANGED
|
@@ -57,5 +57,13 @@ class TestVkMusic < MiniTest::Test
|
|
|
57
57
|
])
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
|
+
|
|
61
|
+
def test_initial_array_not_changed
|
|
62
|
+
init = [
|
|
63
|
+
["2000023175", "456242595", "addd832f78d7c61b6d", "b6b14f49280d4d55f0"]
|
|
64
|
+
]
|
|
65
|
+
CLIENT.from_id(init)
|
|
66
|
+
assert_instance_of(Array, init[0], "Function must not change initial array")
|
|
67
|
+
end
|
|
60
68
|
|
|
61
69
|
end
|
data/vk_music.gemspec
CHANGED
|
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
|
2
2
|
s.name = "vk_music"
|
|
3
3
|
s.summary = "Provides interface to work with VK music via HTTP requests"
|
|
4
4
|
s.description = "Library to work with audios on popular Russian social network vk.com. VK disabled their public API for audios, so it is now necessary to use parsers instead."
|
|
5
|
-
s.version = "2.1.
|
|
5
|
+
s.version = "2.1.4"
|
|
6
6
|
s.author = "Kuznetsov Vladislav"
|
|
7
7
|
s.email = "fizvlad@mail.ru"
|
|
8
8
|
s.homepage = "https://github.com/fizvlad/vk-music-rb"
|