module GoogleMusicApi::Library

Holds all the library related methods

Public Instance Methods

add_tracks_to_library(song_ids = []) click to toggle source
# File lib/google_music_api/library.rb, line 30
def add_tracks_to_library(song_ids = [])
  #TODO: Implement after adding Hashie support as this needs an extra call
  url = 'trackbatch'

  throw NotImplementedError.new
end
get_all_tracks() click to toggle source

Gets all tracks in the library#

@return [Array] of hashes describing tracks
# File lib/google_music_api/library.rb, line 7
def get_all_tracks
  url = 'trackfeed'

  make_post_request(url)['data']['items']
end
get_listen_now_items() click to toggle source

Gets all listen now items return [Array] of hashes, each hash can describe a different kind of item Station/Track/Album

# File lib/google_music_api/library.rb, line 23
def get_listen_now_items
  url = 'listennow/getlistennowitems'
  options = {'alt': 'json'}

  make_get_request(url)['listennow_items']
end
get_promoted_songs() click to toggle source

Gets the promoted songs

@return [Array] of hashes describing tracks
# File lib/google_music_api/library.rb, line 15
def get_promoted_songs
  url = 'ephemeral/top'

  make_post_request(url)['data']['items']
end