fix for keys

This commit is contained in:
chrisk325 2026-03-01 18:23:28 +05:30 committed by GitHub
parent 9a4face265
commit 2eea341578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -259,6 +259,17 @@ export class TMDBService {
}
}
/**
* Returns the resolved TMDB API key (custom user key if set, otherwise default).
* Always awaits key loading so callers get the correct value.
*/
async getApiKey(): Promise<string> {
if (!this.apiKeyLoaded) {
await this.loadApiKey();
}
return this.apiKey;
}
private async getHeaders() {
// Ensure API key is loaded before returning headers
if (!this.apiKeyLoaded) {
@ -1658,4 +1669,4 @@ export class TMDBService {
}
export const tmdbService = TMDBService.getInstance();
export default tmdbService;
export default tmdbService;