Add playlist name and track limit environment config

This commit is contained in:
2025-06-23 20:41:57 -04:00
parent a8b07a792d
commit a353da83bb

View File

@ -16,6 +16,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let redirect_uri = std::env::var("SPOTIFY_REDIRECT_URI")
.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 oauth = OAuth {