Add playlist name and track limit environment config
This commit is contained in:
@ -16,6 +16,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let redirect_uri = std::env::var("SPOTIFY_REDIRECT_URI")
|
let redirect_uri = std::env::var("SPOTIFY_REDIRECT_URI")
|
||||||
.unwrap_or("http://127.0.0.1:8888/callback".to_string());
|
.unwrap_or("http://127.0.0.1:8888/callback".to_string());
|
||||||
|
|
||||||
|
let playlist_name = std::env::var("PLAYLIST_NAME")
|
||||||
|
.unwrap_or("My Current Top Tracks".to_string());
|
||||||
|
|
||||||
|
let track_limit: usize = std::env::var("PLAYLIST_TRACK_LIMIT")
|
||||||
|
.unwrap_or("25".to_string())
|
||||||
|
.parse()
|
||||||
|
.expect("SPOTIFY_TRACK_LIMIT must be a valid number");
|
||||||
|
|
||||||
let credentials = Credentials::new(&client_id, &client_secret);
|
let credentials = Credentials::new(&client_id, &client_secret);
|
||||||
|
|
||||||
let oauth = OAuth {
|
let oauth = OAuth {
|
||||||
|
Reference in New Issue
Block a user