[GH-ISSUE #135] Consider making the cache file a feature #48

Closed
opened 2026-02-27 20:22:47 +03:00 by kerem · 6 comments
Owner

Originally created by @marioortizmanero on GitHub (Oct 10, 2020).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/135

The cache file feature is something I'm not sure how I feel about. While it's definitely useful, I'm not sure if it should be the default behaviour. It could be moved into a feature, which when activated, would use the cache file anywhere possible. Or instead of having do_something and do_something_without_cache, it could be do_something and do_something_with_cache.

What do you think? I need some opinions on this. I don't actually plan on changing anything but I want to propose any breaking changes before the next release.

Originally created by @marioortizmanero on GitHub (Oct 10, 2020). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/135 The cache file feature is something I'm not sure how I feel about. While it's definitely useful, I'm not sure if it should be the default behaviour. It could be moved into a feature, which when activated, would use the cache file anywhere possible. Or instead of having `do_something` and `do_something_without_cache`, it could be `do_something` and `do_something_with_cache`. What do you think? I need some opinions on this. I don't actually plan on changing anything but I want to propose any breaking changes before the next release.
kerem 2026-02-27 20:22:47 +03:00
Author
Owner

@ramsayleung commented on GitHub (Oct 11, 2020):

Yes, I think it's more proper to have a switch to control how does it work. My original thought was using cache_path as a trigger, as what I commented in #129:

    #[builder(default = "PathBuf::from(\".spotify_token_cache.json\")")]
    pub cache_path: PathBuf,
	// I am thinking about whether it's better to make cache_path optional
    // so we can decide to whether save the token into file or not by checking 
    // if cache_path exists, so we can remove function get_token_without_cache

Now, probably it's more suitable to make it as a feature, switching on compile time instead of runtime, as what you suggests.

<!-- gh-comment-id:706633543 --> @ramsayleung commented on GitHub (Oct 11, 2020): Yes, I think it's more proper to have a switch to control how does it work. My original thought was using `cache_path` as a trigger, as what I commented in #129: ```rust #[builder(default = "PathBuf::from(\".spotify_token_cache.json\")")] pub cache_path: PathBuf, // I am thinking about whether it's better to make cache_path optional // so we can decide to whether save the token into file or not by checking // if cache_path exists, so we can remove function get_token_without_cache ``` Now, probably it's more suitable to make it as a feature, switching on compile time instead of runtime, as what you suggests.
Author
Owner

@ramsayleung commented on GitHub (Oct 24, 2020):

Any other proposals? I am gonna to start to work on this feature on this weekend as what @marioortizmanero suggests, makes cache file as a new feature.

<!-- gh-comment-id:715878625 --> @ramsayleung commented on GitHub (Oct 24, 2020): Any other proposals? I am gonna to start to work on this feature on this weekend as what @marioortizmanero suggests, makes cache file as a new feature.
Author
Owner

@marioortizmanero commented on GitHub (Oct 24, 2020):

Can you cross off more things from the meta issue before this? I would wait a bit more before this, let's see if anyone opposes the idea.

<!-- gh-comment-id:715880752 --> @marioortizmanero commented on GitHub (Oct 24, 2020): Can you cross off more things from the meta issue before this? I would wait a bit more before this, let's see if anyone opposes the idea.
Author
Owner

@ramsayleung commented on GitHub (Oct 24, 2020):

Sure! We could leave this issue alone for a while.

<!-- gh-comment-id:715883738 --> @ramsayleung commented on GitHub (Oct 24, 2020): Sure! We could leave this issue alone for a while.
Author
Owner

@marioortizmanero commented on GitHub (Dec 28, 2020):

This has been inactive for a while and noone has left their opinion so I would say we can introduce the cache-file feature. Should it be activated by default?

Also, do you still want to work on it @ramsayleung?

<!-- gh-comment-id:751742724 --> @marioortizmanero commented on GitHub (Dec 28, 2020): This has been inactive for a while and noone has left their opinion so I would say we can introduce the `cache-file` feature. Should it be activated by default? Also, do you still want to work on it @ramsayleung?
Author
Owner

@ramsayleung commented on GitHub (Dec 30, 2020):

Should it be activated by default?

I think it would be good to active this feature by default, just makes rspotify work as before.

Also, do you still want to work on it @ramsayleung?

Not yet, I am working on this issue: https://github.com/ramsayleung/rspotify/issues/163, I would like to work on this feature after merging the PR of #163, and we could say we have crossed off most of TODO items in #127

<!-- gh-comment-id:752633018 --> @ramsayleung commented on GitHub (Dec 30, 2020): > Should it be activated by default? I think it would be good to active this feature by default, just makes `rspotify` work as before. > Also, do you still want to work on it @ramsayleung? Not yet, I am working on this issue: https://github.com/ramsayleung/rspotify/issues/163, I would like to work on this feature after merging the PR of #163, and we could say we have crossed off most of TODO items in #127
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#48
No description provided.