librespot-org / librespot

Open Source Spotify client library
MIT License
4.52k stars 544 forks source link

Write credentials to cache only if they are changed #1168

Closed beaverking1212 closed 1 year ago

beaverking1212 commented 1 year ago

Is your feature request related to a problem? Please describe. A minor problem. When login with cached credentials and store_credentials is true in call to Session::connect() the file with cached credentials is written every time Session::connect() is called. The contents of the file usually do not change with these writes.

Describe the solution you'd like The file with cached credentials should be written only if cached credentials have changed (have been updated by Spotify).

Describe alternatives you've considered Set store_credentials to false and use code that writes credentials to cache if they are changed. https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/blob/ea26d0d6d50bc0fd394c8934b14d18266671264b/audio/spotify/src/common.rs#L162

Additional context Problem was noticed in: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1195

beaverking1212 commented 1 year ago

@gdesmott