1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-04 10:19:27 +02:00

Refactored Cache

Proper error handling, and moving the conversion between
{ credentials, volume } and file into the cache module
This commit is contained in:
johannesd3 2021-01-23 22:37:41 +01:00
parent efabb03631
commit 14a004f84c
4 changed files with 112 additions and 82 deletions

View file

@ -429,8 +429,10 @@ impl AudioFile {
complete_rx
.map(move |mut file| {
if let Some(cache) = session_.cache() {
cache.save_file(file_id, &mut file);
debug!("File {} complete, saving to cache", file_id);
if let Err(err) = cache.save_file(file_id, &mut file) {
warn!("Cannot save file to cache: {}", err);
}
} else {
debug!("File {} complete", file_id);
}