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:
parent
0d503935df
commit
3a4cd449f7
11 changed files with 380 additions and 81 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue