Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Added missed case for last release
Browse files Browse the repository at this point in the history
  • Loading branch information
fizvlad committed Aug 20, 2019
1 parent c8eecf1 commit 6bb6ab0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vk_music/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module Regex

##
# Playlist URL regular expression.
VK_PLAYLIST_URL_POSTFIX = /.*(?:audio_playlist|album\/)(-?\d+)_(\d+)(?:(?:(?:.*(?=&access_hash=)&access_hash=)|\/|%2F)([\da-z]+))?/
VK_PLAYLIST_URL_POSTFIX = /.*(?:audio_playlist|album\/)(-?\d+)_(\d+)(?:(?:(?:.*(?=&access_hash=)&access_hash=)|\/|%2F|_)([\da-z]+))?/

##
# Post URL regular expression #1.
Expand Down
8 changes: 8 additions & 0 deletions test/test_playlist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ def test_playlist_small_2
refute_empty(pl[-1].url, "Audio must have download url")
end

def test_playlist_small_3
pl = CLIENT.playlist("https://vk.com/music/album/-2000637322_637322_e677ea2eab62dc17a8")
refute_empty(pl, "This playlist must not be empty")
assert_instance_of(VkMusic::Audio, pl[0], "Playlist members must be of class Audio")
refute_empty(pl[0].url, "Audio must have download url")
refute_empty(pl[-1].url, "Audio must have download url")
end

def test_big_url
pl = CLIENT.playlist("https://m.vk.com/audio?act=audio_playlist256492540_83617715&from=search_owned_playlist&access_hash=b8d408241bcfb60583&back_url=%2Faudios-39786657%3Fq%3Dmashup%26tab%3Downed&back_hash=76ef9186ac6f248a27")
refute_empty(pl, "This playlist must not be empty")
Expand Down
2 changes: 1 addition & 1 deletion vk_music.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = "vk_music"
s.summary = "Provides interface to work with VK music via HTTP requests"
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."
s.version = "2.1.1"
s.version = "2.1.2"
s.author = "Kuznetsov Vladislav"
s.email = "fizvlad@mail.ru"
s.homepage = "https://github.com/fizvlad/vk-music-rb"
Expand Down

0 comments on commit 6bb6ab0

Please sign in to comment.