-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --disable-audio-cache startup parameter #204
Conversation
Disable caching of downloaded audio files at runtime. Comes in handy when running librespot on a small device with SD card or other small storage.
Thanks! I am using this now, and I hope it will make it upstream. |
Using this now as well, +1 for upstream :) |
Thanks @michaelherger Could you move the logic to the |
I put it in the player code as I don't want to disable all (potential) file caching. It's really about caching the audio data. There could be other code using the cache. (FWICT there's none right now, is there?) |
Yes |
Ok, will update my change. (argh... at some point I have to have a better strategy to separate my pro from my personal GitHub account...) |
Hmm... credentials is using the same cache object all over the place. Not initializing cache for files only, but use it for credentials looks like a much more complicated change, dealing with multiple cache instances etc. Am I totally wrong? |
BTW: is cache/default_cache even used anywhere? |
My point was to make
|
Take 2. |
src/main.rs
Outdated
@@ -135,7 +136,7 @@ fn setup(args: &[String]) -> Setup { | |||
let device_id = librespot::session::device_id(&name); | |||
|
|||
let cache = matches.opt_str("c").map(|cache_location| { | |||
Cache::new(PathBuf::from(cache_location)) | |||
Cache::new(PathBuf::from(cache_location), !matches.opt_present("disable-audio-cache")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit, could you extract !matches.opt_present("disable-audio-cache")
to a separate variable ?
Awesome thanks ! |
Disable caching of downloaded audio files at runtime. Comes in handy when running librespot on a small device with SD card or other small storage.
Disable caching of downloaded audio files at runtime. Comes in handy when running librespot on a small device with SD card or other small storage.