Lastex.Album (Lastex v0.1.0)

Copy Markdown View Source

Functions for the Last.fm Album API methods.

Read functions take the artist name first and the album name second. Write functions additionally take a session key obtained via Lastex.Auth.

Summary

Functions

Tags an album with one or more tags (album.addTags).

Fetches metadata and the tracklist for an album (album.getInfo).

Removes a single tag from an album (album.removeTag). Requires a session key.

Searches for albums by name (album.search).

Fetches the tags a user has applied to an album (album.getTags).

Fetches the most popular tags for an album (album.getTopTags).

Functions

add_tags(artist, album, tags, sk)

Tags an album with one or more tags (album.addTags).

tags is a comma-separated string of up to 10 tags. Requires a session key.

Lastex.Album.add_tags("Opeth", "Blackwater Park", "progressive metal", session_key)

info(artist, album, opts \\ [])

Fetches metadata and the tracklist for an album (album.getInfo).

Pass username: "name" to include that user's playcount, or autocorrect: 1 to correct a misspelled artist name.

Lastex.Album.info("Opeth", "Blackwater Park")

remove_tag(artist, album, tag, sk)

Removes a single tag from an album (album.removeTag). Requires a session key.

Lastex.Album.remove_tag("Opeth", "Blackwater Park", "progressive metal", session_key)

search(album, opts \\ [])

Searches for albums by name (album.search).

Returns a Lastex.Page. Supports limit and page.

Lastex.Album.search("Blackwater Park", limit: 5)

tags(artist, album, opts \\ [])

Fetches the tags a user has applied to an album (album.getTags).

Returns a Lastex.Page. Pass user: "name" to read another user's tags, or a session key via sk to read your own.

Lastex.Album.tags("Opeth", "Blackwater Park", user: "rj")

top_tags(artist, album, opts \\ [])

Fetches the most popular tags for an album (album.getTopTags).

Returns a Lastex.Page.

Lastex.Album.top_tags("Opeth", "Blackwater Park")