Module: VkMusic::Utility::WallLoader

Defined in:
lib/vk_music/utility/wall_loader.rb

Overview

Load wall audios

Class Method Summary collapse

Class Method Details

.call(agent, client_id, owner_id, post_id) ⇒ Playlist?

Parameters:

  • agent (Mechanize)
  • client_id (Integer)
  • owner_id (Integer)
  • post_id (Integer)
  • up_to (Integer)

Returns:



13
14
15
16
17
18
19
20
21
22
# File 'lib/vk_music/utility/wall_loader.rb', line 13

def self.call(agent, client_id, owner_id, post_id)
  page = Request::WallSection.new(owner_id, post_id, client_id)
  page.call(agent)
  audios = page.audios
  return if audios.nil? || audios.empty?

  Playlist.new(audios, id: 0, owner_id: owner_id, access_hash: '',
                       title: page.title, subtitle: page.subtitle,
                       real_size: audios.size)
end