1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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)"
|