Remove unused API Keys UI and infrastructure

All API requests now go through Cloudflare Workers proxy.
User-provided credentials were collected but never used.

Removed:
- src-tauri/src/api_keys.rs (entire module)
- API Keys section from Settings UI
- ApiKeysState and related commands
- User credential parameters from providers
- Simplified DiscogsClient (removed with_user_credentials)
- Cleaned up imports and translations

Moved documentation:
- CHANGELOG-api-keys-refactor.md
- HANDOFF-MERGE.md
- MERGE-PREP.md
- POST-MERGE-CLEANUP.md
Moved to: qbz-nix-docs/feature-api-keys-refactor/

This cleanup reduces codebase by ~715 lines and removes
confusing UI that promised functionality that didn't work.
This commit is contained in:
vicrodh committed 2026-01-17 17:09:49 -06:00
1 parent 7631462522
commit cac5a0c173
15 files changed
+24 -2420

No files matched your search

@@ -40,21 +40,19 @@ pub fn detect_provider(url: &str) -> Result<ProviderKind, PlaylistImportError> {
Err(PlaylistImportError::UnsupportedProvider(url.to_string()))
}
/// Fetch playlist with optional user-provided credentials
/// Fetch playlist (proxy handles credentials)
pub async fn fetch_playlist(
kind: ProviderKind,
spotify_creds: Option<ProviderCredentials>,
tidal_creds: Option<ProviderCredentials>,
) -> Result<ImportPlaylist, PlaylistImportError> {
match kind {
ProviderKind::Spotify { playlist_id } => {
spotify::fetch_playlist(&playlist_id, spotify_creds).await
spotify::fetch_playlist(&playlist_id).await
}
ProviderKind::AppleMusic { storefront, playlist_id } => {
apple::fetch_playlist(&storefront, &playlist_id).await
}
ProviderKind::Tidal { playlist_id } => {
tidal::fetch_playlist(&playlist_id, tidal_creds).await
tidal::fetch_playlist(&playlist_id).await
}
ProviderKind::Deezer { playlist_id } => deezer::fetch_playlist(&playlist_id).await,
}
@@ -38,9 +38,8 @@ pub fn parse_playlist_id(url: &str) -> Option<String> {
pub async fn fetch_playlist(
playlist_id: &str,
user_creds: Option<ProviderCredentials>,
) -> Result<ImportPlaylist, PlaylistImportError> {
if let Ok(token) = get_app_token(user_creds).await {
if let Ok(token) = get_app_token().await {
if let Ok(playlist) = fetch_playlist_with_token(playlist_id, &token).await {
return Ok(playlist);
}
@@ -249,8 +248,8 @@ async fn fetch_playlist_from_embed(playlist_id: &str) -> Result<ImportPlaylist,
})
}
async fn get_app_token(_user_creds: Option<ProviderCredentials>) -> Result<String, PlaylistImportError> {
// Proxy handles credentials - user_creds ignored (compatibility)
async fn get_app_token() -> Result<String, PlaylistImportError> {
// Proxy handles credentials
let url = format!("{}/token", SPOTIFY_PROXY_URL);
let response: Value = reqwest::Client::builder()
@@ -39,9 +39,8 @@ pub fn parse_playlist_id(url: &str) -> Option<String> {
pub async fn fetch_playlist(
playlist_id: &str,
user_creds: Option<ProviderCredentials>,
) -> Result<ImportPlaylist, PlaylistImportError> {
let token = get_app_token(user_creds).await?;
let token = get_app_token().await?;
let country_code = env::var("TIDAL_COUNTRY_CODE").unwrap_or_else(|_| "US".to_string());
let client = reqwest::Client::new();
@@ -331,8 +330,8 @@ fn parse_duration_ms(value: &str) -> Option<u64> {
}
}
async fn get_app_token(_user_creds: Option<ProviderCredentials>) -> Result<String, PlaylistImportError> {
// Proxy handles credentials - user_creds ignored (compatibility)
async fn get_app_token() -> Result<String, PlaylistImportError> {
// Proxy handles credentials
let url = format!("{}/token", TIDAL_PROXY_URL);
let response: Value = reqwest::Client::builder()