snaus/exe/Main.hs

27 lines
854 B
Haskell
Raw Permalink Normal View History

2024-03-04 22:00:45 +00:00
{-# LANGUAGE OverloadedStrings #-}
2024-03-03 18:01:26 +00:00
module Main where
2024-03-04 11:26:37 +00:00
import System.Posix.Directory ( getWorkingDirectory )
2024-03-04 22:00:45 +00:00
import System.Directory.Extra ( listFiles )
2024-03-04 11:26:37 +00:00
import Control.Monad ( (<=<), filterM )
2024-03-04 22:00:45 +00:00
import Turtle ( Alternative(empty), shell, ExitCode )
import Turtle.Format
import Data.Text ( Text, pack )
2024-03-04 11:26:37 +00:00
fetchLocalAudio :: FilePath -> IO [FilePath]
2024-03-04 22:00:45 +00:00
fetchLocalAudio = filterM isAudioVideo <=< listFiles
2024-03-04 11:26:37 +00:00
isAudioVideo :: FilePath -> IO Bool
isAudioVideo = undefined
2024-03-04 22:00:45 +00:00
-- 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
2024-03-04 11:26:37 +00:00
2024-03-03 18:01:26 +00:00
main :: IO ()
2024-03-04 11:26:37 +00:00
main =
getWorkingDirectory >>= \a ->
pure ()