frontend fixes & db rewrite with serde

This commit is contained in:
Priler 2026-01-04 09:00:51 +05:00
parent 61b7a79455
commit 091a41ac33
37 changed files with 910 additions and 663 deletions

View file

@ -68,8 +68,12 @@ pub fn play_sound(filename: &PathBuf) {
}
pub fn get_sound_directory() -> Option<PathBuf> {
let voice = DB.get().unwrap().voice.as_str();
let voice_path = SOUND_DIR.join(voice);
let db = DB.get()?;
let voice_path = {
let s = db.read();
SOUND_DIR.join(&s.voice)
};
match voice_path.exists() && voice_path.cmp(&SOUND_DIR) != Ordering::Equal {
true => Some(voice_path),