vimeta-0.3.0.1: Frontend for video metadata tagging tools
CopyrightThis file is part of the package vimeta. It is subject to the
license terms in the LICENSE file found in the top-level
directory of this distribution and at:

https://github.com/pjones/vimeta

No part of this package including this file may be copied
modified propagated or distributed except according to the terms
contained in the LICENSE file.
LicenseBSD-2-Clause
Safe HaskellNone
LanguageHaskell2010

Vimeta.Core

Description

 
Synopsis

Documentation

class Monad m => MonadIO (m :: Type -> Type) #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Minimal complete definition

liftIO

Instances

Instances details
MonadIO IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.IO.Class

Methods

liftIO :: IO a -> IO a #

MonadIO Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

liftIO :: IO a -> Q a #

MonadIO TheMovieDB 
Instance details

Defined in Network.API.TheMovieDB.Internal.TheMovieDB

Methods

liftIO :: IO a -> TheMovieDB a #

MonadIO m => MonadIO (BylineT m) 
Instance details

Defined in Byline.Internal.Eval

Methods

liftIO :: IO a -> BylineT m a #

MonadIO m => MonadIO (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftIO :: IO a -> MaybeT m a #

MonadIO m => MonadIO (ResourceT m) 
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

liftIO :: IO a -> ResourceT m a #

MonadIO m => MonadIO (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

liftIO :: IO a -> Vimeta m a #

MonadIO m => MonadIO (EvalT m) 
Instance details

Defined in Byline.Internal.Eval

Methods

liftIO :: IO a -> EvalT m a #

MonadIO m => MonadIO (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftIO :: IO a -> IdentityT m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

liftIO :: IO a -> WriterT w m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

liftIO :: IO a -> WriterT w m a #

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

liftIO :: IO a -> ReaderT r m a #

MonadIO m => MonadIO (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftIO :: IO a -> ExceptT e m a #

MonadIO m => MonadIO (FT f m) 
Instance details

Defined in Control.Monad.Trans.Free.Church

Methods

liftIO :: IO a -> FT f m a #

(Functor f, MonadIO m) => MonadIO (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

liftIO :: IO a -> FreeT f m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (ConduitT i o m) 
Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

liftIO :: IO a -> ConduitT i o m a #

MonadIO m => MonadIO (ParsecT s u m) 
Instance details

Defined in Text.Parsec.Prim

Methods

liftIO :: IO a -> ParsecT s u m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

liftIO :: IO a -> RWST r w s m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

liftIO :: IO a -> RWST r w s m a #

MonadIO m => MonadIO (Pipe l i o u m) 
Instance details

Defined in Data.Conduit.Internal.Pipe

Methods

liftIO :: IO a -> Pipe l i o u m a #

throwError :: MonadError e m => e -> m a #

Is used within a monadic computation to begin exception processing.

type FormatTable = Map Char (Maybe Text) Source #

Mapping of format characters to their possible replacement text.

fromFormatString Source #

Arguments

:: FormatTable

Format character mapping.

-> String

Name of format string.

-> Text

Input text.

-> Either String Text

Output text or error.

Replace format characters prefixed with a % with the replacement text found in the given Map.

formatFullDate :: Maybe Day -> Maybe Text Source #

Format a Day using the XML schema notation.

formatYear :: Maybe Day -> Maybe Text Source #

Format a Day displaying just the year.

data Tagger Source #

Constructors

AtomicParsley 

data Config Source #

Vimeta configuration.

Instances

Instances details
ToJSON Config Source # 
Instance details

Defined in Vimeta.Core.Config

FromJSON Config Source # 
Instance details

Defined in Vimeta.Core.Config

configFileName :: IO FilePath Source #

Get the name of the configuration file.

readConfig :: MonadIO m => ExceptT String m Config Source #

Read the configuration file and return a Config value or an error.

data Vimeta m a Source #

Instances

Instances details
MonadReader Context (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

ask :: Vimeta m Context #

local :: (Context -> Context) -> Vimeta m a -> Vimeta m a #

reader :: (Context -> a) -> Vimeta m a #

Monad m => MonadError String (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

throwError :: String -> Vimeta m a #

catchError :: Vimeta m a -> (String -> Vimeta m a) -> Vimeta m a #

Monad (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

(>>=) :: Vimeta m a -> (a -> Vimeta m b) -> Vimeta m b #

(>>) :: Vimeta m a -> Vimeta m b -> Vimeta m b #

return :: a -> Vimeta m a #

Functor (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

fmap :: (a -> b) -> Vimeta m a -> Vimeta m b #

(<$) :: a -> Vimeta m b -> Vimeta m a #

Applicative (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

pure :: a -> Vimeta m a #

(<*>) :: Vimeta m (a -> b) -> Vimeta m a -> Vimeta m b #

liftA2 :: (a -> b -> c) -> Vimeta m a -> Vimeta m b -> Vimeta m c #

(*>) :: Vimeta m a -> Vimeta m b -> Vimeta m b #

(<*) :: Vimeta m a -> Vimeta m b -> Vimeta m a #

MonadIO m => MonadIO (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

liftIO :: IO a -> Vimeta m a #

MonadByline (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

liftByline :: F PrimF a -> Vimeta m a

data Context Source #

Instances

Instances details
MonadReader Context (Vimeta m) Source # 
Instance details

Defined in Vimeta.Core.Vimeta

Methods

ask :: Vimeta m Context #

local :: (Context -> Context) -> Vimeta m a -> Vimeta m a #

reader :: (Context -> a) -> Vimeta m a #

runIO :: MonadIO m => IO a -> Vimeta m a Source #

tmdb :: MonadIO m => TheMovieDB a -> Vimeta m a Source #

Run a TheMovieDB operation.

verbose :: MonadIO m => Text -> Vimeta m () Source #

execVimetaWithContext :: (MonadIO m, MonadMask m) => Context -> Vimeta m a -> m (Either String a) Source #

Very primitive way of running a Vimeta value with the given Context. Mostly useful for running vimeta action within another vimeta action.

execVimeta Source #

Arguments

:: (MonadIO m, MonadMask m) 
=> (Config -> Config)

Modify configuration before running.

-> Vimeta m a

The Vimeta value to execute.

-> m (Either String a)

The result.

Run a Vimeta operation after loading the configuration file from disk.

runVimeta :: (MonadIO m, MonadMask m) => Vimeta m a -> m (Either String a) Source #

Simple wrapper around execVimeta.

tagFile :: Text -> Vimeta IO () Source #

Run the tagging command unless dry-run mode is in effect.

parseMappingFile Source #

Arguments

:: MonadIO m 
=> FilePath

File name for the mapping file.

-> Parser a

Parser for the second column.

-> Vimeta m [(FilePath, a)] 

Parse a mapping file.

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.