Fix video title when fetching from the channel page
This commit is contained in:
parent
865880504b
commit
a582d88a63
|
@ -98,7 +98,7 @@ class _InitialData {
|
|||
String _continuation;
|
||||
String _clickTrackingParams;
|
||||
|
||||
List<GridContinuationItem> getContentContext() {
|
||||
List<GridRendererItem> getContentContext() {
|
||||
if (root.contents != null) {
|
||||
return root.contents.twoColumnBrowseResultsRenderer.tabs
|
||||
.map((e) => e.tabRenderer)
|
||||
|
@ -146,8 +146,7 @@ class _InitialData {
|
|||
List<ChannelVideo> get uploads => _uploads ??= getContentContext()
|
||||
?.map(_parseContent)
|
||||
?.where((e) => e != null)
|
||||
?.toList()
|
||||
?.cast<ChannelVideo>();
|
||||
?.toList();
|
||||
|
||||
String get continuation =>
|
||||
_continuation ??= getContinuationContext().continuation ?? '';
|
||||
|
@ -155,11 +154,15 @@ class _InitialData {
|
|||
String get clickTrackingParams => _clickTrackingParams ??=
|
||||
getContinuationContext()?.clickTrackingParams ?? '';
|
||||
|
||||
dynamic _parseContent(GridContinuationItem content) {
|
||||
ChannelVideo _parseContent(GridRendererItem content) {
|
||||
if (content == null || content.gridVideoRenderer == null) {
|
||||
return null;
|
||||
}
|
||||
var video = content.gridVideoRenderer;
|
||||
return ChannelVideo(VideoId(video.videoId), video.title.simpleText);
|
||||
return ChannelVideo(
|
||||
VideoId(video.videoId),
|
||||
video.title?.simpleText ??
|
||||
video.title?.runs?.map((e) => e.text)?.join() ??
|
||||
'');
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue