Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions lib/application/providers/credentials_provider.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../core/config/app_config.dart';
import '../../data/datasources/credentials_local_datasource.dart';
import '../di/injection_container.dart';

Expand Down Expand Up @@ -165,12 +164,9 @@ final credentialsProvider =
return CredentialsNotifier(ref.watch(credentialsLocalDataSourceProvider));
});

/// Derived provider that returns the effective Spotify Client ID
/// (custom > default)
/// Derived provider that returns the user-configured Spotify Client ID.
/// Returns empty string if not configured — login screen guards this.
final effectiveSpotifyClientIdProvider = Provider<String>((ref) {
final creds = ref.watch(credentialsProvider);
final custom = creds.customSpotifyClientId;
return (custom != null && custom.isNotEmpty)
? custom
: AppConfig.spotifyClientId;
return creds.customSpotifyClientId ?? '';
});
3 changes: 0 additions & 3 deletions lib/core/config/app_config.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
class AppConfig {
// Spotify Client ID (public client — safe to embed, PKCE replaces client_secret)
static const String spotifyClientId = '94fcde08534f4025a402cd2bba93e1f0';

// Custom URL scheme for OAuth callback
static const String urlScheme = 'fullstop';

Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@
"description": "Custom Spotify Client ID field label"
},

"customClientIdDescription": "The shared Client ID may be rate-limited by Spotify under heavy usage. You can create your own app on Spotify Developer Dashboard and use your own Client ID.",
"customClientIdDescription": "Spotify requires each developer to use their own Client ID. Create an app on Spotify Developer Dashboard and enter the Client ID below.",
"@customClientIdDescription": {
"description": "Description explaining why custom Client ID may be needed"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@

"customClientId": "カスタム Client ID",

"customClientIdDescription": "共有 Client ID は Spotify のレート制限を受ける可能性があります。Spotify Developer Dashboard で独自のアプリを作成し、自分の Client ID を使用できます。",
"customClientIdDescription": "Spotifyでは各開発者が独自のClient IDを使用する必要があります。Spotify Developer Dashboardでアプリを作成し、以下にClient IDを入力してください。",

"customClientIdHint": "Spotify Client ID を入力",

Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ abstract class AppLocalizations {
/// Description explaining why custom Client ID may be needed
///
/// In en, this message translates to:
/// **'The shared Client ID may be rate-limited by Spotify under heavy usage. You can create your own app on Spotify Developer Dashboard and use your own Client ID.'**
/// **'Spotify requires each developer to use their own Client ID. Create an app on Spotify Developer Dashboard and enter the Client ID below.'**
String get customClientIdDescription;

/// Hint for custom Client ID input
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ class AppLocalizationsEn extends AppLocalizations {

@override
String get customClientIdDescription =>
'The shared Client ID may be rate-limited by Spotify under heavy usage. You can create your own app on Spotify Developer Dashboard and use your own Client ID.';
'Spotify requires each developer to use their own Client ID. Create an app on Spotify Developer Dashboard and enter the Client ID below.';

@override
String get customClientIdHint => 'Enter your Spotify Client ID';
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ class AppLocalizationsJa extends AppLocalizations {

@override
String get customClientIdDescription =>
'共有 Client ID は Spotify のレート制限を受ける可能性があります。Spotify Developer Dashboard で独自のアプリを作成し、自分の Client ID を使用できます。';
'Spotifyでは各開発者が独自のClient IDを使用する必要があります。Spotify Developer Dashboardでアプリを作成し、以下にClient IDを入力してください。';

@override
String get customClientIdHint => 'Spotify Client ID を入力';
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ class AppLocalizationsZh extends AppLocalizations {

@override
String get customClientIdDescription =>
'公用 Client ID 在高频请求时可能被 Spotify 限流。你可以在 Spotify Developer Dashboard 创建自己的应用,使用自己的 Client ID。';
'Spotify 要求每位开发者使用自己的 Client ID。请前往 Spotify Developer Dashboard 创建应用,将 Client ID 填入下方。';

@override
String get customClientIdHint => '输入你的 Spotify Client ID';
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@

"customClientId": "自定义 Client ID",

"customClientIdDescription": "公用 Client ID 在高频请求时可能被 Spotify 限流。你可以在 Spotify Developer Dashboard 创建自己的应用,使用自己的 Client ID。",
"customClientIdDescription": "Spotify 要求每位开发者使用自己的 Client ID。请前往 Spotify Developer Dashboard 创建应用,将 Client ID 填入下方。",

"customClientIdHint": "输入你的 Spotify Client ID",

Expand Down
Loading
Loading