module Network.Lastfm.API.Library
( addAlbum, addArtist, addTrack, getAlbums, getArtists, getTracks
, removeAlbum, removeArtist, removeScrobble, removeTrack
) where
import Control.Monad.Error (runErrorT)
import Network.Lastfm
addAlbum :: Artist -> Album -> APIKey -> SessionKey -> Secret -> Lastfm Response
addAlbum artist album apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.addAlbum")
, (#) artist
, (#) album
, (#) apiKey
, (#) sessionKey
]
addArtist :: Artist -> APIKey -> SessionKey -> Secret -> Lastfm Response
addArtist artist apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.addArtist")
, (#) artist
, (#) apiKey
, (#) sessionKey
]
addTrack :: Artist -> Track -> APIKey -> SessionKey -> Secret -> Lastfm Response
addTrack artist track apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.addTrack")
, (#) artist
, (#) track
, (#) apiKey
, (#) sessionKey
]
getAlbums :: User -> Maybe Artist -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getAlbums user artist page limit apiKey = callAPI
[ (#) (Method "library.getAlbums")
, (#) user
, (#) artist
, (#) page
, (#) limit
, (#) apiKey
]
getArtists :: User -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getArtists user page limit apiKey = callAPI
[ (#) (Method "library.getArtists")
, (#) user
, (#) page
, (#) limit
, (#) apiKey
]
getTracks :: User -> Maybe Artist -> Maybe Album -> Maybe Page -> Maybe Limit -> APIKey -> Lastfm Response
getTracks user artist album page limit apiKey = callAPI
[ (#) (Method "library.getTracks")
, (#) user
, (#) artist
, (#) album
, (#) page
, (#) limit
, (#) apiKey
]
removeAlbum :: Artist -> Album -> APIKey -> SessionKey -> Secret -> Lastfm Response
removeAlbum artist album apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.removeAlbum")
, (#) artist
, (#) album
, (#) apiKey
, (#) sessionKey
]
removeArtist :: Artist -> APIKey -> SessionKey -> Secret -> Lastfm Response
removeArtist artist apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.removeArtist")
, (#) artist
, (#) apiKey
, (#) sessionKey
]
removeScrobble :: Artist -> Track -> Timestamp -> APIKey -> SessionKey -> Secret -> Lastfm Response
removeScrobble artist track timestamp apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.removeScrobble")
, (#) artist
, (#) track
, (#) timestamp
, (#) apiKey
, (#) sessionKey
]
removeTrack :: Artist -> Track -> APIKey -> SessionKey -> Secret -> Lastfm Response
removeTrack artist track apiKey sessionKey secret = callAPIsigned secret
[ (#) (Method "library.removeTrack")
, (#) artist
, (#) track
, (#) apiKey
, (#) sessionKey
]