@@ -12,6 +12,7 @@ struct MpdConfig {
12
12
db_file : PathBuf ,
13
13
music_directory : PathBuf ,
14
14
playlist_directory : PathBuf ,
15
+ sticker_file : PathBuf ,
15
16
config_path : PathBuf ,
16
17
sock_path : PathBuf ,
17
18
}
@@ -25,6 +26,7 @@ impl MpdConfig {
25
26
db_file : base. join ( "db" ) ,
26
27
music_directory : base. join ( "music" ) ,
27
28
playlist_directory : base. join ( "playlists" ) ,
29
+ sticker_file : base. join ( "sticker_file" ) ,
28
30
config_path : base. join ( "config" ) ,
29
31
sock_path : base. join ( "sock" ) ,
30
32
}
@@ -36,6 +38,7 @@ db_file "{db_file}"
36
38
log_file "/dev/null"
37
39
music_directory "{music_directory}"
38
40
playlist_directory "{playlist_directory}"
41
+ sticker_file "{sticker_file}"
39
42
bind_to_address "{sock_path}"
40
43
audio_output {{
41
44
type "null"
@@ -45,6 +48,7 @@ audio_output {{
45
48
db_file=self . db_file. display( ) ,
46
49
music_directory=self . music_directory. display( ) ,
47
50
playlist_directory=self . playlist_directory. display( ) ,
51
+ sticker_file=self . sticker_file. display( ) ,
48
52
sock_path=self . sock_path. display( ) ,
49
53
)
50
54
}
@@ -83,11 +87,19 @@ fn sleep() {
83
87
thread:: sleep ( ten_millis) ;
84
88
}
85
89
90
+ static EMPTY_FLAC_BYTES : & ' static [ u8 ] = include_bytes ! ( "../data/empty.flac" ) ;
91
+
86
92
impl Daemon {
87
93
pub fn start ( ) -> Daemon {
88
94
let temp_dir = TempDir :: new ( "mpd-test" ) . unwrap ( ) ;
89
95
let config = MpdConfig :: new ( & temp_dir) ;
90
96
config. generate ( ) ;
97
+
98
+ File :: create ( config. music_directory . join ( "empty.flac" ) )
99
+ . unwrap ( )
100
+ . write_all ( EMPTY_FLAC_BYTES )
101
+ . unwrap ( ) ;
102
+
91
103
let process = Command :: new ( "mpd" )
92
104
. arg ( "--no-daemon" )
93
105
. arg ( & config. config_path )
0 commit comments