{-# LANGUAGE OverloadedStrings #-} module Main where import System.Posix.Directory ( getWorkingDirectory ) import System.Directory.Extra ( listFiles ) import Control.Monad ( (<=<), filterM ) import Turtle ( Alternative(empty), shell, ExitCode ) import Turtle.Format import Data.Text ( Text, pack ) fetchLocalAudio :: FilePath -> IO [FilePath] fetchLocalAudio = filterM isAudioVideo <=< listFiles isAudioVideo :: FilePath -> IO Bool isAudioVideo = undefined -- TODO: Make run in background and without stdout -- TODO: Find alternative due to comment on https://hackage.haskell.org/package/turtle-1.6.2/docs/Turtle-Prelude.html#g:6 playHeadless :: FilePath -> IO ExitCode playHeadless = flip shell empty . format ("mpv --vid=auto \""%s%"\"") . pack main :: IO () main = getWorkingDirectory >>= \a -> pure ()