Add ability to pin channels in "Following" tab (#395)

* add pinned channels list global config setting

* add ability to pin streams

* ensure that all pinned streams are fetched

* rename

* tweak padding

* fix typo
This commit is contained in:
Tommy Chow 2024-09-09 22:09:20 -07:00 • committed by GitHub
parent 0d503935df
commit 3a4cd449f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 380 additions and 81 deletions

View file

@ -291,6 +291,23 @@ class TwitchApi {
}
}
Future<StreamsTwitch> getStreamsByIds({
required List<String> userIds,
required Map<String, String> headers,
}) async {
final uri = Uri.parse(
'https://api.twitch.tv/helix/streams?${userIds.map((e) => 'user_id=$e').join('&')}&first=100',
);
final response = await _client.get(uri, headers: headers);
if (response.statusCode == 200) {
final decoded = jsonDecode(response.body);
return StreamsTwitch.fromJson(decoded);
} else {
return Future.error('Failed to get stream info');
}
}
/// Returns a [UserTwitch] object containing the user info associated with the given [userLogin].
Future<UserTwitch> getUser({
String? userLogin,