mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Fix caching message when cache is disabled
This commit is contained in:
parent
9d88ac59c6
commit
d18a0d1803
2 changed files with 7 additions and 5 deletions
|
@ -310,10 +310,12 @@ impl AudioFile {
|
|||
let session_ = session.clone();
|
||||
session.spawn(complete_rx.map_ok(move |mut file| {
|
||||
if let Some(cache) = session_.cache() {
|
||||
debug!("File {} complete, saving to cache", file_id);
|
||||
cache.save_file(file_id, &mut file);
|
||||
} else {
|
||||
debug!("File {} complete", file_id);
|
||||
if cache.file_path(file_id).is_some() {
|
||||
cache.save_file(file_id, &mut file);
|
||||
debug!("File {} cached to {:?}", file_id, cache.file(file_id));
|
||||
}
|
||||
|
||||
debug!("Downloading file {} complete", file_id);
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ impl Cache {
|
|||
}
|
||||
}
|
||||
|
||||
fn file_path(&self, file: FileId) -> Option<PathBuf> {
|
||||
pub fn file_path(&self, file: FileId) -> Option<PathBuf> {
|
||||
self.audio_location.as_ref().map(|location| {
|
||||
let name = file.to_base16();
|
||||
let mut path = location.join(&name[0..2]);
|
||||
|
|
Loading…
Reference in a new issue