mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +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();
|
let session_ = session.clone();
|
||||||
session.spawn(complete_rx.map_ok(move |mut file| {
|
session.spawn(complete_rx.map_ok(move |mut file| {
|
||||||
if let Some(cache) = session_.cache() {
|
if let Some(cache) = session_.cache() {
|
||||||
debug!("File {} complete, saving to cache", file_id);
|
if cache.file_path(file_id).is_some() {
|
||||||
cache.save_file(file_id, &mut file);
|
cache.save_file(file_id, &mut file);
|
||||||
} else {
|
debug!("File {} cached to {:?}", file_id, cache.file(file_id));
|
||||||
debug!("File {} complete", 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| {
|
self.audio_location.as_ref().map(|location| {
|
||||||
let name = file.to_base16();
|
let name = file.to_base16();
|
||||||
let mut path = location.join(&name[0..2]);
|
let mut path = location.join(&name[0..2]);
|
||||||
|
|
Loading…
Reference in a new issue