Minor changes
This commit is contained in:
parent
b3ee180b6a
commit
1a4bbfcc75
|
@ -67,6 +67,7 @@ Future<void> download(String id) async {
|
|||
// Listen for data received.
|
||||
var progressBar = ProgressBar();
|
||||
await for (var data in audioStream) {
|
||||
|
||||
// Keep track of the current downloaded data.
|
||||
count += data.length;
|
||||
|
||||
|
|
|
@ -222,9 +222,9 @@ class _PlayerConfig {
|
|||
|
||||
class _InitialData {
|
||||
// Json parsed map
|
||||
final Map<String, dynamic> _root;
|
||||
final Map<String, dynamic> root;
|
||||
|
||||
_InitialData(this._root);
|
||||
_InitialData(this.root);
|
||||
|
||||
/* Cache results */
|
||||
|
||||
|
@ -232,16 +232,16 @@ class _InitialData {
|
|||
String _clickTrackingParams;
|
||||
|
||||
Map<String, dynamic> getContinuationContext(Map<String, dynamic> root) {
|
||||
if (_root['contents'] != null) {
|
||||
return (_root['contents']['twoColumnWatchNextResults']['results']
|
||||
if (root['contents'] != null) {
|
||||
return (root['contents']['twoColumnWatchNextResults']['results']
|
||||
['results']['contents'] as List<dynamic>)
|
||||
?.firstWhere((e) => e.containsKey('itemSectionRenderer'))[
|
||||
'itemSectionRenderer']['continuations']
|
||||
?.first['nextContinuationData']
|
||||
?.cast<String, dynamic>();
|
||||
}
|
||||
if (_root['response'] != null) {
|
||||
return _root['response']['itemSectionContinuation']['continuations']
|
||||
if (root['response'] != null) {
|
||||
return root['response']['itemSectionContinuation']['continuations']
|
||||
?.first['nextContinuationData']
|
||||
?.cast<String, dynamic>();
|
||||
}
|
||||
|
@ -249,8 +249,8 @@ class _InitialData {
|
|||
}
|
||||
|
||||
String get continuation => _continuation ??=
|
||||
getContinuationContext(_root)?.getValue('continuation') ?? '';
|
||||
getContinuationContext(root)?.getValue('continuation') ?? '';
|
||||
|
||||
String get clickTrackingParams => _clickTrackingParams ??=
|
||||
getContinuationContext(_root)?.getValue('clickTrackingParams') ?? '';
|
||||
getContinuationContext(root)?.getValue('clickTrackingParams') ?? '';
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export 'comment.dart';
|
||||
export 'comments_client.dart';
|
Loading…
Reference in New Issue