added edit panel and fixed bug where Modify* command would be decoded as Add* command by the server

This commit is contained in:
Mark
2023-08-27 21:53:00 +02:00
parent 55590a1549
commit 0e5e33367d
11 changed files with 661 additions and 15 deletions

View File

@@ -48,8 +48,16 @@ impl Song {
cached_data: Arc::new(Mutex::new(None)),
}
}
pub fn uncache_data(&self) {
*self.cached_data.lock().unwrap() = None;
pub fn uncache_data(&self) -> Result<(), ()> {
let mut cached = self.cached_data.lock().unwrap();
match cached.as_ref() {
Some(Ok(_data)) => {
*cached = None;
Ok(())
}
Some(Err(_thread)) => Err(()),
None => Ok(()),
}
}
/// If no data is cached yet and no caching thread is running, starts a thread to cache the data.
pub fn cache_data_start_thread(&self, db: &Database) -> bool {