Class: Shortwave::Facade::Library
- Defined in:
- lib/shortwave/facade/lastfm.rb
Instance Attribute Summary
Attributes inherited from Remote
Instance Method Summary collapse
-
#add_album(artist, album) ⇒ Object
Add an album to a user’s Last.fm library.
-
#add_artist(artist) ⇒ Object
Add an artist to a user’s Last.fm library.
-
#add_track(artist, track) ⇒ Object
Add a track to a user’s Last.fm library.
-
#albums(user, options = {}) ⇒ Object
A paginated list of all the albums in a user’s library, with play counts and tag counts.
-
#artists(user, options = {}) ⇒ Object
A paginated list of all the artists in a user’s library, with play counts and tag counts.
-
#tracks(user, options = {}) ⇒ Object
A paginated list of all the tracks in a user’s library, with play counts and tag counts.
Methods inherited from Remote
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, ={}) get(:standard, {:method => "library.getAlbums", :user => user}.merge()) 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, ={}) get(:standard, {:method => "library.getArtists", :user => user}.merge()) 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, ={}) get(:standard, {:method => "library.getTracks", :user => user}.merge()) end |