Class: Shortwave::Facade::Library

Inherits:
Remote
  • Object
show all
Defined in:
lib/shortwave/facade/lastfm.rb

Instance Attribute Summary

Attributes inherited from Remote

#session

Instance Method Summary collapse

Methods inherited from Remote

#initialize

Constructor Details

This class inherits a constructor from Shortwave::Facade::Remote

Instance Method Details

#add_album(artist, album) ⇒ Object

Add an album to a user’s Last.fm library

artist

The artist that composed the track

album

The album name you wish to add



619
620
621
# File 'lib/shortwave/facade/lastfm.rb', line 619

def add_album(artist, album)
  post(:session, {:method => "library.addAlbum", :artist => artist, :album => album})
end

#add_artist(artist) ⇒ Object

Add an artist to a user’s Last.fm library

artist

The artist name you wish to add



603
604
605
# File 'lib/shortwave/facade/lastfm.rb', line 603

def add_artist(artist)
  post(:session, {:method => "library.addArtist", :artist => artist})
end

#add_track(artist, track) ⇒ Object

Add a track to a user’s Last.fm library

artist

The artist that composed the track

track

The track name you wish to add



611
612
613
# File 'lib/shortwave/facade/lastfm.rb', line 611

def add_track(artist, track)
  post(:session, {:method => "library.addTrack", :artist => artist, :track => track})
end

#albums(user, options = {}) ⇒ Object

A paginated list of all the albums in a user’s library, with play counts and tag counts.

user

The user whose library you want to fetch.

Options

limit

Limit the amount of albums returned (maximum/default is 50).

page

The page number you wish to scan to.



585
586
587
# File 'lib/shortwave/facade/lastfm.rb', line 585

def albums(user, options={})
  get(:standard, {:method => "library.getAlbums", :user => user}.merge(options))
end

#artists(user, options = {}) ⇒ Object

A paginated list of all the artists in a user’s library, with play counts and tag counts.

user

The user whose library you want to fetch.

Options

limit

Limit the amount of artists returned (maximum/default is 50).

page

The page number you wish to scan to.



596
597
598
# File 'lib/shortwave/facade/lastfm.rb', line 596

def artists(user, options={})
  get(:standard, {:method => "library.getArtists", :user => user}.merge(options))
end

#tracks(user, options = {}) ⇒ Object

A paginated list of all the tracks in a user’s library, with play counts and tag counts.

user

The user whose library you want to fetch.

Options

limit

Limit the amount of tracks returned (maximum/default is 50).

page

The page number you wish to scan to.



630
631
632
# File 'lib/shortwave/facade/lastfm.rb', line 630

def tracks(user, options={})
  get(:standard, {:method => "library.getTracks", :user => user}.merge(options))
end