Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility functions for downloading files.
Documentation
withArtwork :: MonadIO m => [Text] -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a Source #
Try to download artwork and run the given function. The
function will be passed a FilePath
if the artwork was downloaded.
See the withDownload
function for more details.
:: MonadIO m | |
=> Maybe Text | URL. |
-> (Maybe FilePath -> Vimeta IO a) | Function to call and pass the file name to. |
-> Vimeta m a | Result of above function. |
Download the given URL to a temporary file and pass the file name to the given function.
The reason a function needs to be passed to withDownload
is the
result of using withSystemTempFile
to store the downloaded file.
The file will be automatically removed after the given function
completes.