fix api bugs

This commit is contained in:
factory-droid[bot]
2025-10-02 21:40:20 +00:00
parent c30b1b2464
commit fd296d800f
4 changed files with 39 additions and 10 deletions

View File

@@ -31,11 +31,12 @@ class Favorite {
}
String get fullPosterUrl {
final baseUrl = dotenv.env['API_URL']!;
if (posterPath.isEmpty) {
return '$baseUrl/images/w500/placeholder.jpg';
return 'https://via.placeholder.com/500x750.png?text=No+Poster';
}
// TMDB CDN base URL
const tmdbBaseUrl = 'https://image.tmdb.org/t/p';
final cleanPath = posterPath.startsWith('/') ? posterPath.substring(1) : posterPath;
return '$baseUrl/images/w500/$cleanPath';
return '$tmdbBaseUrl/w500/$cleanPath';
}
}