dart format
This commit is contained in:
parent
e1bee8c6d9
commit
51ba543deb
|
@ -34,8 +34,8 @@ class ChannelClient {
|
||||||
Future<Channel> getByUsername(dynamic username) async {
|
Future<Channel> getByUsername(dynamic username) async {
|
||||||
username = Username.fromString(username);
|
username = Username.fromString(username);
|
||||||
|
|
||||||
var channelPage =
|
var channelPage = await ChannelPage.getByUsername(
|
||||||
await ChannelPage.getByUsername(_httpClient, (username as Username).value);
|
_httpClient, (username as Username).value);
|
||||||
return Channel(
|
return Channel(
|
||||||
ChannelId(channelPage.channelId),
|
ChannelId(channelPage.channelId),
|
||||||
channelPage.channelTitle,
|
channelPage.channelTitle,
|
||||||
|
|
|
@ -18,7 +18,8 @@ class PlaylistClient {
|
||||||
Future<Playlist> get(dynamic id) async {
|
Future<Playlist> get(dynamic id) async {
|
||||||
id = PlaylistId.fromString(id);
|
id = PlaylistId.fromString(id);
|
||||||
|
|
||||||
var response = await PlaylistPage.get(_httpClient, (id as PlaylistId).value);
|
var response =
|
||||||
|
await PlaylistPage.get(_httpClient, (id as PlaylistId).value);
|
||||||
return Playlist(
|
return Playlist(
|
||||||
id,
|
id,
|
||||||
response.title ?? '',
|
response.title ?? '',
|
||||||
|
|
|
@ -110,10 +110,8 @@ class _InitialData extends InitialData {
|
||||||
.toList() ??
|
.toList() ??
|
||||||
[];
|
[];
|
||||||
|
|
||||||
late final int? viewCount = content
|
late final int? viewCount =
|
||||||
.get('viewCountText')
|
content.get('viewCountText')?.getT<String>('simpleText')?.parseInt();
|
||||||
?.getT<String>('simpleText')
|
|
||||||
?.parseInt();
|
|
||||||
|
|
||||||
late final String? joinDate =
|
late final String? joinDate =
|
||||||
content.get('joinedDateText')?.getList('runs')?[1].getT<String>('text');
|
content.get('joinedDateText')?.getList('runs')?[1].getT<String>('text');
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ extension VideoStreamInfoExtension<T extends VideoStreamInfo> on Iterable<T> {
|
||||||
Set<String> getAllVideoQualitiesLabel() => map((e) => e.qualityLabel).toSet();
|
Set<String> getAllVideoQualitiesLabel() => map((e) => e.qualityLabel).toSet();
|
||||||
|
|
||||||
/// Gets the stream with best video quality.
|
/// Gets the stream with best video quality.
|
||||||
@Deprecated('This is actually a typo, and actually returns the videos sorted by the best *video quality*. Now use the `bestQuality` getter ')
|
@Deprecated(
|
||||||
|
'This is actually a typo, and actually returns the videos sorted by the best *video quality*. Now use the `bestQuality` getter ')
|
||||||
T withHighestBitrate() => sortByVideoQuality().last;
|
T withHighestBitrate() => sortByVideoQuality().last;
|
||||||
|
|
||||||
T get bestQuality => sortByVideoQuality().last;
|
T get bestQuality => sortByVideoQuality().last;
|
||||||
|
|
Loading…
Reference in New Issue