Minor bug fix.
If a channel in a search query doesn't provide a video count it will default to -1. Fix #184
This commit is contained in:
parent
4a1243e8db
commit
6dad4d6776
|
@ -210,17 +210,18 @@ class _InitialData extends InitialData {
|
|||
}
|
||||
if (content['channelRenderer'] != null) {
|
||||
var renderer = content.get('channelRenderer')!;
|
||||
|
||||
return SearchChannel(
|
||||
ChannelId(renderer.getT<String>('channelId')!),
|
||||
renderer.get('title')!.getT<String>('simpleText')!,
|
||||
renderer.get('descriptionSnippet')?.getList('runs')?.parseRuns() ??
|
||||
'',
|
||||
renderer
|
||||
.get('videoCountText')!
|
||||
.getList('runs')!
|
||||
.first
|
||||
.getT<String>('text')!
|
||||
.parseInt()!);
|
||||
.get('videoCountText')
|
||||
?.getList('runs')
|
||||
?.first
|
||||
.getT<String>('text')
|
||||
?.parseInt() ?? -1);
|
||||
}
|
||||
// Here ignore 'horizontalCardListRenderer' & 'shelfRenderer'
|
||||
return null;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/// This i can either be a [SearchVideo] or [SearchPlaylist]
|
||||
/// This can either be a [SearchVideo] or [SearchPlaylist]
|
||||
mixin BaseSearchContent {}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
name: youtube_explode_dart
|
||||
description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
|
||||
version: 1.10.9
|
||||
version: 1.10.9+1
|
||||
|
||||
homepage: ^0.13.4
|
||||
homepage: https://github.com/Hexer10/youtube_explode_dart
|
||||
|
||||
environment:
|
||||
sdk: '>=2.14.0 <3.0.0'
|
||||
|
@ -25,3 +25,7 @@ dev_dependencies:
|
|||
json_serializable: ^6.1.1
|
||||
lint: ^1.8.1
|
||||
test: ^1.19.5
|
||||
|
||||
false_secrets:
|
||||
- "lib/src/reverse_engineering/youtube_http_client.dart"
|
||||
- "lib/src/reverse_engineering/clients/embedded_player_client.dart"
|
||||
|
|
Loading…
Reference in New Issue