feat(tv-admin): fix action/focus flows, update app title, randomize unsplash, bump 1.0.9+10
This commit is contained in:
@@ -10,12 +10,22 @@ class UnsplashService {
|
||||
UnsplashService._();
|
||||
|
||||
/// Fetches a list of highly compressed landscape URLs based on the given keyword.
|
||||
Future<List<String>> fetchLandscapeBackgrounds(String keyword) async {
|
||||
Future<List<String>> fetchLandscapeBackgrounds(
|
||||
String keyword, {
|
||||
int page = 1,
|
||||
}) async {
|
||||
// Trim keyword and default to 'mosque' if empty
|
||||
final query = keyword.trim().isEmpty ? 'mosque' : keyword.trim();
|
||||
|
||||
|
||||
// Specifically requesting 'regular' size to fit 1080p elegantly while minimizing RAM overhead.
|
||||
final url = Uri.parse('$_baseUrl/search/photos?query=$query&orientation=landscape&per_page=20');
|
||||
final url = Uri.parse('$_baseUrl/search/photos').replace(
|
||||
queryParameters: {
|
||||
'query': query,
|
||||
'orientation': 'landscape',
|
||||
'per_page': '20',
|
||||
'page': page.clamp(1, 1000).toString(),
|
||||
},
|
||||
);
|
||||
|
||||
try {
|
||||
final response = await http.get(
|
||||
|
||||
Reference in New Issue
Block a user