Class: Shortwave::Facade::Album

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_tags(artist, album, tags) ⇒ Object

Tag an album using a list of user supplied tags.

artist

The artist name in question

album

The album name in question

tags

A comma delimited list of user supplied tags to apply to this album. Accepts a maximum of 10 tags.



433
434
435
# File 'lib/shortwave/facade/lastfm.rb', line 433

def add_tags(artist, album, tags)
  post(:session, {:method => "album.addTags", :artist => artist, :album => album, :tags => tags})
end

#info(options = {}) ⇒ Object

Get the metadata for an album on Last.fm using the album name or a musicbrainz id. See playlist.fetch on how to get the album playlist.

Options

artist

The artist name in question

album

The album name in question

mbid

The musicbrainz id for the album

lang

The language to return the biography in, expressed as an ISO 639 alpha-2 code.



444
445
446
# File 'lib/shortwave/facade/lastfm.rb', line 444

def info(options={})
  get(:standard, {:method => "album.getInfo"}.merge(options))
end

#remove_tag(artist, album, tag) ⇒ Object

Remove a user’s tag from an album.

artist

The artist name in question

album

The album name in question

tag

A single user tag to remove from this album.



424
425
426
# File 'lib/shortwave/facade/lastfm.rb', line 424

def remove_tag(artist, album, tag)
  post(:session, {:method => "album.removeTag", :artist => artist, :album => album, :tag => tag})
end

#search(album, options = {}) ⇒ Object

Search for an album by name. Returns album matches sorted by relevance.

album

The album name in question.

Options

limit

Limit the number of albums returned at one time. Default (maximum) is 30.

page

Scan into the results by specifying a page number. Defaults to first page.



463
464
465
# File 'lib/shortwave/facade/lastfm.rb', line 463

def search(album, options={})
  get(:standard, {:method => "album.search", :album => album}.merge(options))
end

#tags(artist, album) ⇒ Object

Get the tags applied by an individual user to an album on Last.fm.

artist

The artist name in question

album

The album name in question



452
453
454
# File 'lib/shortwave/facade/lastfm.rb', line 452

def tags(artist, album)
  get(:session, {:method => "album.getTags", :artist => artist, :album => album})
end