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:
parent
efabb03631
commit
14a004f84c
4 changed files with 112 additions and 82 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue