module Network.Lastfm.API.Artist
( addTags, getCorrection, getEvents, getImages, getInfo
, getPastEvents, getPodcast, getShouts, getSimilar, getTags, getTopAlbums
, getTopFans, getTopTags, getTopTracks, removeTag, search, share, shout
) where
import Control.Arrow ((|||))
import Network.Lastfm
addTags :: Artist -> [Tag] -> APIKey -> SessionKey -> Secret -> Lastfm Response
addTags artist tags apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "artist.addTags")
, (#) artist
, (#) tags
, (#) apiKey
, (#) sessionKey
]
getCorrection :: Artist -> APIKey -> Lastfm Response
getCorrection artist apiKey = callAPI
[ (#) (Method "artist.getCorrection")
, (#) artist
, (#) apiKey
]
getEvents :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> Maybe FestivalsOnly -> APIKey -> Lastfm Response
getEvents a autocorrect page limit festivalsOnly apiKey = callAPI $
target a ++
[ (#) (Method "artist.getEvents")
, (#) autocorrect
, (#) page
, (#) limit
, (#) festivalsOnly
, (#) apiKey
]
getImages :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> Maybe Order -> APIKey -> Lastfm Response
getImages a autocorrect page limit order apiKey = callAPI $
target a ++
[ (#) (Method "artist.getImages")
, (#) autocorrect
, (#) page
, (#) limit
, (#) order
, (#) apiKey
]
getInfo :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Language -> Maybe Username -> APIKey -> Lastfm Response
getInfo a autocorrect language username apiKey = callAPI $
target a ++
[ (#) (Method "artist.getInfo")
, (#) autocorrect
, (#) language
, (#) username
, (#) apiKey
]
getPastEvents :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getPastEvents a autocorrect page limit apiKey = callAPI $
target a ++
[ (#) (Method "artist.getPastEvents")
, (#) autocorrect
, (#) page
, (#) limit
, (#) apiKey
]
getPodcast :: Either Artist Mbid -> Maybe Autocorrect -> APIKey -> Lastfm Response
getPodcast a autocorrect apiKey = callAPI $
target a ++
[ (#) (Method "artist.getPodcast")
, (#) autocorrect
, (#) apiKey
]
getShouts :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getShouts a autocorrect page limit apiKey = callAPI $
target a ++
[ (#) (Method "artist.getShouts")
, (#) autocorrect
, (#) page
, (#) limit
, (#) apiKey
]
getSimilar :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Limit -> APIKey -> Lastfm Response
getSimilar a autocorrect limit apiKey = callAPI $
target a ++
[ (#) (Method "artist.getSimilar")
, (#) autocorrect
, (#) limit
, (#) apiKey
]
getTags :: Either Artist Mbid -> Maybe Autocorrect -> Either User (SessionKey, Secret) -> APIKey -> Lastfm Response
getTags a autocorrect b apiKey = case b of
Left user -> callAPI $ target a ++ [(#) user] ++ args
Right (sessionKey, secret) -> callAPIsigned secret $ target a ++ [(#) sessionKey] ++ args
where args =
[ (#) (Method "artist.getTags")
, (#) autocorrect
, (#) apiKey
]
getTopAlbums :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getTopAlbums a autocorrect page limit apiKey = callAPI $
target a ++
[ (#) (Method "artist.getTopAlbums")
, (#) autocorrect
, (#) page
, (#) limit
, (#) apiKey
]
getTopFans :: Either Artist Mbid -> Maybe Autocorrect -> APIKey -> Lastfm Response
getTopFans a autocorrect apiKey = callAPI $
target a ++
[ (#) (Method "artist.getTopFans")
, (#) autocorrect
, (#) apiKey
]
getTopTags :: Either Artist Mbid -> Maybe Autocorrect -> APIKey -> Lastfm Response
getTopTags a autocorrect apiKey = callAPI $
target a ++
[ (#) (Method "artist.getTopTags")
, (#) autocorrect
, (#) apiKey
]
getTopTracks :: Either Artist Mbid -> Maybe Autocorrect -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getTopTracks a autocorrect page limit apiKey = callAPI $
target a ++
[ (#) (Method "artist.getTopTracks")
, (#) autocorrect
, (#) page
, (#) limit
, (#) apiKey
]
removeTag :: Artist -> Tag -> APIKey -> SessionKey -> Secret -> Lastfm Response
removeTag artist tag apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "artist.removeTag")
, (#) artist
, (#) tag
, (#) apiKey
, (#) sessionKey
]
search :: Artist -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
search artist page limit apiKey = callAPI
[ (#) (Method "artist.search")
, (#) artist
, (#) apiKey
, (#) page
, (#) limit
]
share :: Artist -> Recipient -> Maybe Message -> Maybe Public -> APIKey -> SessionKey -> Secret -> Lastfm Response
share artist recipient message public apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "artist.share")
, (#) artist
, (#) recipient
, (#) apiKey
, (#) sessionKey
, (#) public
, (#) message
]
shout :: Artist -> Message -> APIKey -> SessionKey -> Secret -> Lastfm Response
shout artist message apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "artist.shout")
, (#) artist
, (#) message
, (#) apiKey
, (#) sessionKey
]
target :: Either Artist Mbid -> [(String, String)]
target = return . (#) ||| return . (#)