packages feed

liblastfm-0.0.3.0: src/Network/Lastfm/XML/Track.hs

{-# LANGUAGE TemplateHaskell #-}
-- | Track API module
{-# OPTIONS_HADDOCK prune #-}
module Network.Lastfm.XML.Track
  ( addTags, ban, getBuyLinks, getCorrection, getFingerprintMetadata
  , getInfo, getShouts, getSimilar, getTags, getTopFans, getTopTags
  , love, removeTag, scrobble, search, share, unban, unlove, updateNowPlaying
  ) where

import Network.Lastfm
import qualified Network.Lastfm.API.Track as API

$(xml ["addTags", "ban", "getBuyLinks", "getCorrection", "getFingerprintMetadata", "getInfo", "getShouts", "getSimilar", "getTags", "getTopFans", "getTopTags", "love", "removeTag", "scrobble", "search", "share", "unban", "unlove", "updateNowPlaying"])

-- | Tag a track using a list of user supplied tags.
--
-- More: <http://www.last.fm/api/show/track.addTags>
addTags ∷ Artist → Track → [Tag] → APIKey → SessionKey → Secret → Lastfm Response

-- | Ban a track for a given user profile.
--
-- More: <http://www.last.fm/api/show/track.ban>
ban ∷ Artist → Track → APIKey → SessionKey → Secret → Lastfm Response

-- | Get a list of Buy Links for a particular track.
--
-- More: <http://www.last.fm/api/show/track.getBuylinks>
getBuyLinks ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → Country → APIKey → Lastfm Response

-- | Use the last.fm corrections data to check whether the supplied track has a correction to a canonical track.
--
-- More: <http://www.last.fm/api/show/track.getCorrection>
getCorrection ∷ Artist → Track → APIKey → Lastfm Response

-- | Retrieve track metadata associated with a fingerprint id generated by the Last.fm Fingerprinter. Returns track elements, along with a 'rank' value between 0 and 1 reflecting the confidence for each match.
--
-- More: <http://www.last.fm/api/show/track.getFingerprintMetadata>
getFingerprintMetadata ∷ Fingerprint → APIKey → Lastfm Response

-- | Get the metadata for a track on Last.fm.
--
-- More: <http://www.last.fm/api/show/track.getInfo>
getInfo ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → Maybe Username → APIKey → Lastfm Response

-- | Get shouts for this track. Also available as an rss feed.
--
-- More: <http://www.last.fm/api/show/track.getShouts>
getShouts ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → Maybe Page → Maybe Limit → APIKey → Lastfm Response

-- | Get the similar tracks for this track on Last.fm, based on listening data.
--
-- More: <http://www.last.fm/api/show/track.getSimilar>
getSimilar ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → Maybe Limit → APIKey → Lastfm Response

-- | Get the tags applied by an individual user to a track on Last.fm.
--
-- More: <http://www.last.fm/api/show/track.getTags>
getTags ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → Either User (SessionKey, Secret) → APIKey → Lastfm Response

-- | Get the top fans for this track on Last.fm, based on listening data.
--
-- More: <http://www.last.fm/api/show/track.getTopFans>
getTopFans ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → APIKey → Lastfm Response

-- | Get the top tags for this track on Last.fm, ordered by tag count.
--
-- More: <http://www.last.fm/api/show/track.getTopTags>
getTopTags ∷ Either (Artist, Track) Mbid → Maybe Autocorrect → APIKey → Lastfm Response

-- | Love a track for a user profile.
--
-- More: <http://www.last.fm/api/show/track.love>
love ∷ Artist → Track → APIKey → SessionKey → Secret → Lastfm Response

-- | Remove a user's tag from a track.
--
-- More: <http://www.last.fm/api/show/track.removeTag>
removeTag ∷ Artist → Track → Tag → APIKey → SessionKey → Secret → Lastfm Response

-- | Used to add a track-play to a user's profile.
--
-- More: <http://www.last.fm/api/show/track.scrobble>
scrobble ∷ ( Timestamp, Maybe Album, Artist, Track, Maybe AlbumArtist
           , Maybe Duration, Maybe StreamId, Maybe ChosenByUser
           , Maybe Context, Maybe TrackNumber, Maybe Mbid )
         → APIKey
         → SessionKey
         → Secret
         → Lastfm Response

-- | Search for a track by track name. Returns track matches sorted by relevance.
--
-- More: <http://www.last.fm/api/show/track.search>
search ∷ Track → Maybe Page → Maybe Limit → Maybe Artist → APIKey → Lastfm Response

-- | Share a track twith one or more Last.fm users or other friends.
--
-- More: <http://www.last.fm/api/show/track.share>
share ∷ Artist → Track → Recipient → Maybe Message → Maybe Public → APIKey → SessionKey → Secret → Lastfm Response

-- | Unban a track for a user profile.
--
-- More: <http://www.last.fm/api/show/track.unban>
unban ∷ Artist → Track → APIKey → SessionKey → Secret → Lastfm Response

-- | Unlove a track for a user profile.
--
-- More: <http://www.last.fm/api/show/track.unlove>
unlove ∷ Artist → Track → APIKey → SessionKey → Secret → Lastfm Response


-- | Used to notify Last.fm that a user has started listening to a track. Parameter names are case sensitive.
--
-- More: <http://www.last.fm/api/show/track.updateNowPlaying>
updateNowPlaying ∷ Artist
                 → Track
                 → Maybe Album
                 → Maybe AlbumArtist
                 → Maybe Context
                 → Maybe TrackNumber
                 → Maybe Mbid
                 → Maybe Duration
                 → APIKey
                 → SessionKey
                 → Secret
                 → Lastfm Response