vimeta-0.2.3.0: Frontend for video metadata tagging tools

Safe HaskellNone
LanguageHaskell2010

Vimeta.Core.Download

Description

Utility functions for downloading files.

Synopsis

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.

withDownload Source #

Arguments

:: 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.