-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Frontend for video metadata tagging tools -- -- Vimeta is a tool to fetch video metadata from the interwebs and update -- video files using a tagging tool. @package vimeta @version 0.3.1 -- | Caching functions. module Vimeta.Core.Cache -- | Produce a cached version of TheMovieDB.Configuration or use -- the given action to create a cache a new value. cacheTMDBConfig :: MonadIO m => m (Either e Configuration) -> m (Either e Configuration) module Vimeta.Core.Format -- | Mapping of format characters to their possible replacement text. type FormatTable = Map Char (Maybe Text) -- | Replace format characters prefixed with a % with the -- replacement text found in the given Map. fromFormatString :: FormatTable -> String -> Text -> Either String Text -- | Format a Day displaying just the year. formatYear :: Maybe Day -> Maybe Text -- | Format a Day using the XML schema notation. formatFullDate :: Maybe Day -> Maybe Text module Vimeta.Core.Tagger data Tagger AtomicParsley :: Tagger formatStringsForTagger :: Tagger -> (Text, Text) -- | The configuration file. module Vimeta.Core.Config -- | Vimeta configuration. data Config Config :: Key -> Text -> Text -> Bool -> Bool -> Config [configTMDBKey] :: Config -> Key [configFormatMovie] :: Config -> Text [configFormatTV] :: Config -> Text [configVerbose] :: Config -> Bool [configDryRun] :: Config -> Bool defaultConfig :: Tagger -> Config -- | Get the name of the configuration file. configFileName :: IO FilePath -- | Read the configuration file and return a Config value or an -- error. readConfig :: MonadIO m => ExceptT String m Config writeConfig :: MonadIO m => Config -> ExceptT String m FilePath instance Data.Aeson.Types.FromJSON.FromJSON Vimeta.Core.Config.Config instance Data.Aeson.Types.ToJSON.ToJSON Vimeta.Core.Config.Config module Vimeta.Core.Vimeta newtype Vimeta m a Vimeta :: ReaderT Context (BylineT (ExceptT String m)) a -> Vimeta m a [unV] :: Vimeta m a -> ReaderT Context (BylineT (ExceptT String m)) a data Context Context :: Manager -> Config -> Configuration -> Handle -> Context [ctxManager] :: Context -> Manager [ctxConfig] :: Context -> Config [ctxTMDBCfg] :: Context -> Configuration [ctxVerboseH] :: Context -> Handle -- | 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: -- --
class Monad m => MonadIO (m :: Type -> Type) -- | Is used within a monadic computation to begin exception processing. throwError :: MonadError e m => e -> m a runIO :: MonadIO m => IO a -> Vimeta m a runIOE :: MonadIO m => IO (Either String a) -> Vimeta m a -- | Run a TheMovieDB operation. tmdb :: MonadIO m => TheMovieDB a -> Vimeta m a verbose :: MonadIO m => Text -> Vimeta m () -- | Very primitive way of running a Vimeta value with the given -- Context. Mostly useful for running vimeta action within another -- vimeta action. execVimetaWithContext :: (MonadIO m, MonadMask m) => Context -> Vimeta m a -> m (Either String a) -- | Run a Vimeta operation after loading the configuration file -- from disk. execVimeta :: (MonadIO m, MonadMask m) => (Config -> Config) -> Vimeta m a -> m (Either String a) -- | Simple wrapper around execVimeta. runVimeta :: (MonadIO m, MonadMask m) => Vimeta m a -> m (Either String a) instance Byline.Internal.Eval.MonadByline (Vimeta.Core.Vimeta.Vimeta m) instance GHC.Base.Monad m => Control.Monad.Error.Class.MonadError GHC.Base.String (Vimeta.Core.Vimeta.Vimeta m) instance Control.Monad.Reader.Class.MonadReader Vimeta.Core.Vimeta.Context (Vimeta.Core.Vimeta.Vimeta m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Vimeta.Core.Vimeta.Vimeta m) instance GHC.Base.Monad (Vimeta.Core.Vimeta.Vimeta m) instance GHC.Base.Applicative (Vimeta.Core.Vimeta.Vimeta m) instance GHC.Base.Functor (Vimeta.Core.Vimeta.Vimeta m) -- | | Utility functions for running external commands. module Vimeta.Core.Process -- | Run the tagging command unless dry-run mode is in effect. tagFile :: Text -> Vimeta IO () -- | | Mapping files can be used to map file names to other information. module Vimeta.Core.MappingFile -- | Parser type. type Parser a = ParsecT Text () Identity a -- | Parse a mapping file. parseMappingFile :: MonadIO m => FilePath -> Parser a -> Vimeta m [(FilePath, a)] -- | Utility functions for downloading files. module Vimeta.Core.Download -- | 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. withArtwork :: MonadIO m => [Text] -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a -- | 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. withDownload :: MonadIO m => Maybe Text -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a module Vimeta.Core -- | 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: -- -- class Monad m => MonadIO (m :: Type -> Type) -- | Is used within a monadic computation to begin exception processing. throwError :: MonadError e m => e -> m a -- | Mapping of format characters to their possible replacement text. type FormatTable = Map Char (Maybe Text) -- | Replace format characters prefixed with a % with the -- replacement text found in the given Map. fromFormatString :: FormatTable -> String -> Text -> Either String Text -- | Format a Day using the XML schema notation. formatFullDate :: Maybe Day -> Maybe Text -- | Format a Day displaying just the year. formatYear :: Maybe Day -> Maybe Text data Tagger AtomicParsley :: Tagger formatStringsForTagger :: Tagger -> (Text, Text) -- | Vimeta configuration. data Config Config :: Key -> Text -> Text -> Bool -> Bool -> Config [configTMDBKey] :: Config -> Key [configFormatMovie] :: Config -> Text [configFormatTV] :: Config -> Text [configVerbose] :: Config -> Bool [configDryRun] :: Config -> Bool defaultConfig :: Tagger -> Config -- | Get the name of the configuration file. configFileName :: IO FilePath -- | Read the configuration file and return a Config value or an -- error. readConfig :: MonadIO m => ExceptT String m Config writeConfig :: MonadIO m => Config -> ExceptT String m FilePath data Vimeta m a data Context Context :: Manager -> Config -> Configuration -> Handle -> Context [ctxManager] :: Context -> Manager [ctxConfig] :: Context -> Config [ctxTMDBCfg] :: Context -> Configuration [ctxVerboseH] :: Context -> Handle runIO :: MonadIO m => IO a -> Vimeta m a runIOE :: MonadIO m => IO (Either String a) -> Vimeta m a -- | Run a TheMovieDB operation. tmdb :: MonadIO m => TheMovieDB a -> Vimeta m a verbose :: MonadIO m => Text -> Vimeta m () -- | Very primitive way of running a Vimeta value with the given -- Context. Mostly useful for running vimeta action within another -- vimeta action. execVimetaWithContext :: (MonadIO m, MonadMask m) => Context -> Vimeta m a -> m (Either String a) -- | Run a Vimeta operation after loading the configuration file -- from disk. execVimeta :: (MonadIO m, MonadMask m) => (Config -> Config) -> Vimeta m a -> m (Either String a) -- | Simple wrapper around execVimeta. runVimeta :: (MonadIO m, MonadMask m) => Vimeta m a -> m (Either String a) -- | Run the tagging command unless dry-run mode is in effect. tagFile :: Text -> Vimeta IO () -- | Parse a mapping file. parseMappingFile :: MonadIO m => FilePath -> Parser a -> Vimeta m [(FilePath, a)] -- | 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. withArtwork :: MonadIO m => [Text] -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a -- | 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. withDownload :: MonadIO m => Maybe Text -> (Maybe FilePath -> Vimeta IO a) -> Vimeta m a -- | | Common types/functions used in the command line interface. module Vimeta.UI.CommandLine.Common -- | Common command line options among all of the apps. data CommonOptions -- | Common option parser. commonOptions :: Parser CommonOptions -- | Update the configuration file base on the common command line options. updateConfig :: CommonOptions -> Config -> Config module Vimeta.UI.CommandLine.Config data Options optionsParser :: Parser Options run :: Options -> IO () module Vimeta.UI.Common.Movie -- | Run the tagger for the given file/movie combo. tagMovie :: MonadIO m => FilePath -> Movie -> Vimeta m () module Vimeta.UI.Common.TV -- | A simple way to specify a single episode. data EpisodeSpec EpisodeSpec :: Int -> Int -> EpisodeSpec -- | Handy tagging function using mapping files. tagWithMappingFile :: MonadIO m => TV -> FilePath -> Vimeta m () -- | Tag all of the given files with their matching EpisodeSpec. tagWithSpec :: MonadIO m => TV -> [(FilePath, EpisodeSpec)] -> Vimeta m () -- | Tag the given files, starting at the given EpisodeSpec. tagWithFileOrder :: MonadIO m => TV -> EpisodeSpec -> [FilePath] -> Vimeta m () -- | Create an EpisodeSpec from an Episode. episodeSpec :: Episode -> EpisodeSpec instance GHC.Classes.Ord Vimeta.UI.Common.TV.EpisodeSpec instance GHC.Classes.Eq Vimeta.UI.Common.TV.EpisodeSpec instance GHC.Show.Show Vimeta.UI.Common.TV.EpisodeSpec instance GHC.Classes.Ord Vimeta.UI.Common.TV.EpisodeCtx instance GHC.Classes.Eq Vimeta.UI.Common.TV.EpisodeCtx instance GHC.Show.Show Vimeta.UI.Common.TV.EpisodeCtx module Vimeta.UI.Common.Util -- | Wrap some text with parenthesis. parens :: Text -> Text -- | Format a 'Maybe Day' as a year (Text). dayAsYear :: Maybe Day -> Text -- | Given a start Day and an end Day, produce a string -- representing a range. dayRange :: Maybe Day -> Maybe Day -> Text module Vimeta.UI.Term.Common -- | Check the input text to see if it is blank. If it is, return the given -- error message in Left. notBlank :: Stylized Text -> Text -> Either (Stylized Text) Text -- | Search for a movie and interact with the user through the terminal. module Vimeta.UI.Term.Movie -- | Search for a movie and interact with the user through the terminal. movieSearch :: MonadIO m => Text -> Vimeta m Movie instance Byline.Internal.Stylized.ToStylizedText Vimeta.UI.Term.Movie.MovieItem module Vimeta.UI.CommandLine.Movie data Options optionsParser :: Parser Options run :: Options -> IO (Either String ()) -- | Search for a TV series by interacting with the user through the -- terminal. module Vimeta.UI.Term.TV tvSearch :: MonadIO m => Vimeta m TV instance Byline.Internal.Stylized.ToStylizedText Vimeta.UI.Term.TV.TVItem module Vimeta.UI.CommandLine.TV data Options optionsParser :: Parser Options run :: Options -> IO (Either String ()) module Vimeta.UI.CommandLine run :: IO ()