hotfix on assets_folder issue by increasing the depth to 3.

This commit is contained in:
Sheldon Knuth 2019-07-02 19:43:38 +08:00
parent ee32f752a6
commit cdda20a1e8
2 changed files with 10 additions and 2 deletions

View File

@ -119,11 +119,11 @@ fn assets_folder() -> PathBuf {
match std::env::current_exe() {
Ok(mut exe_path) => {
exe_path.pop();
find_folder::Search::Parents(2)
find_folder::Search::Parents(3)
.of(exe_path)
.for_folder("assets")
}
Err(_) => find_folder::Search::Parents(2).for_folder("assets"),
Err(_) => find_folder::Search::Parents(3).for_folder("assets"),
}
.expect("Could not find assets folder")
}

View File

@ -426,3 +426,11 @@ fn send_msg(tx: &mut Sender<AudioPlayerMsg>, msg: AudioPlayerMsg) {
fn list_devices_raw() -> Vec<Device> {
rodio::output_devices().collect()
}
#[test]
fn test_load_soundtracks() {
use crate::audio::base::{load_soundtracks, Genre};
for entry in load_soundtracks(&Genre::Bgm).iter() {
println!("{}", entry)
}
}