From c72953df05259b20a7fc87117aefbbe284a376a1 Mon Sep 17 00:00:00 2001 From: Carlos Sosa Date: Sat, 18 Apr 2020 20:08:00 -0700 Subject: Initial commit v0.1.0 --- test/Sound/MusicDirTrans/Test/Util.hs | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 test/Sound/MusicDirTrans/Test/Util.hs (limited to 'test/Sound/MusicDirTrans/Test') diff --git a/test/Sound/MusicDirTrans/Test/Util.hs b/test/Sound/MusicDirTrans/Test/Util.hs new file mode 100644 index 0000000..743ce99 --- /dev/null +++ b/test/Sound/MusicDirTrans/Test/Util.hs @@ -0,0 +1,89 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Sound.MusicDirTrans.Test.Util + ( artistPath + , artistPathStr + , artistPathWithoutYear + , metadata + , metadataArtistPath + , metadataWithoutYear + , sampleMetadata + , sampleMetadataStr + , patterns + , origPath + , audioTracks + ) +where + +import Data.Text +import Sound.HTagLib +import Sound.MusicDirTrans +import System.FilePath.Glob + +patterns :: [Pattern] +patterns = + [ compile "*.flac" + , compile "*.wav" + , compile "*.mp3" + , compile "*.mp4" + , compile "*.asf" + , compile "*.aiff" + , compile "*.mpc" + , compile "*.spx" + , compile "*.tt" + , compile "*.wv" + ] + +sampleMetadata :: Metadata +sampleMetadata = Metadata (mkArtist $ pack "artist") + (mkAlbum $ pack "album") + (mkYear 2055) + +sampleMetadataStr :: String +sampleMetadataStr = "Metadata {mArtist = Artist \"artist\"," + ++ " mAlbum = Album \"album\", mYear = Just (Year 2055)}" + +metadata :: [Metadata] +metadata = + (Prelude.replicate 5 $ Metadata + (mkArtist $ pack "Mono") + (mkAlbum $ pack "Requiem for Hell") + (mkYear 2019) + ) + ++ [ Metadata + (mkArtist $ pack "artist") + (mkAlbum $ pack "album") + (mkYear 2055) + ] +metadataWithoutYear :: [Metadata] +metadataWithoutYear = + (Prelude.replicate 5 $ Metadata + (mkArtist $ pack "Mono") + (mkAlbum $ pack "Requiem for Hell") + Nothing + ) + ++ [ Metadata + (mkArtist $ pack "artist") + (mkAlbum $ pack "album") + (mkYear 2055) + ] + +origPath :: FilePath +origPath = "Mono - Requiem for Hell (2019) JP [FLAC] Vinyl" + +artistPath :: ArtistPath +artistPath = ArtistPath origPath "Mono" "Requiem for Hell (2019)" + +artistPathStr :: String +artistPathStr = "ArtistPath {rootPath = \"Mono - Requiem for Hell (2019) JP [FLAC] Vinyl\"" + ++ ", parentPath = \"Mono\", childPath = \"Requiem for Hell (2019)\"}" + +artistPathWithoutYear :: ArtistPath +artistPathWithoutYear = ArtistPath origPath "Mono" "Requiem for Hell" + +audioTracks :: [AudioTrack] +audioTracks = [ AudioTrack "audio-samples/sample.flac" + , AudioTrack "audio-samples/sample.mp3"] + +metadataArtistPath :: ArtistPath +metadataArtistPath = ArtistPath "audio-samples" "artist" "album (2055)" -- cgit v1.3-2-g0d8e