Adds video.publishDate
This commit is contained in:
parent
4dc635678e
commit
e1e3fec37d
|
@ -58,6 +58,7 @@ class PlaylistClient {
|
||||||
video.author,
|
video.author,
|
||||||
ChannelId(video.channelId),
|
ChannelId(video.channelId),
|
||||||
null,
|
null,
|
||||||
|
null,
|
||||||
video.description,
|
video.description,
|
||||||
video.duration,
|
video.duration,
|
||||||
ThumbnailSet(videoId),
|
ThumbnailSet(videoId),
|
||||||
|
|
|
@ -34,6 +34,13 @@ class PlayerResponse {
|
||||||
.getT<String>('uploadDate')!
|
.getT<String>('uploadDate')!
|
||||||
.parseDateTime();
|
.parseDateTime();
|
||||||
|
|
||||||
|
///
|
||||||
|
DateTime get videoPublishDate => root
|
||||||
|
.get('microformat')!
|
||||||
|
.get('playerMicroformatRenderer')!
|
||||||
|
.getT<String>('publishDate')!
|
||||||
|
.parseDateTime();
|
||||||
|
|
||||||
///
|
///
|
||||||
String get videoChannelId =>
|
String get videoChannelId =>
|
||||||
root.get('videoDetails')!.getT<String>('channelId')!;
|
root.get('videoDetails')!.getT<String>('channelId')!;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class SearchClient {
|
||||||
return SearchList(
|
return SearchList(
|
||||||
page.initialData.searchContent
|
page.initialData.searchContent
|
||||||
.whereType<SearchVideo>()
|
.whereType<SearchVideo>()
|
||||||
.map((e) => Video(e.id, e.title, e.author, null, e.uploadDate?.toDateTime(), e.description, e.duration.toDuration(),
|
.map((e) => Video(e.id, e.title, e.author, null, e.uploadDate?.toDateTime(), null, e.description, e.duration.toDuration(),
|
||||||
ThumbnailSet(e.id.value), null, Engagement(e.viewCount, null, null), e.isLive))
|
ThumbnailSet(e.id.value), null, Engagement(e.viewCount, null, null), e.isLive))
|
||||||
.toList(),
|
.toList(),
|
||||||
page,
|
page,
|
||||||
|
|
|
@ -23,8 +23,19 @@ class SearchList extends DelegatingList<Video> {
|
||||||
return SearchList(
|
return SearchList(
|
||||||
page.initialData.searchContent
|
page.initialData.searchContent
|
||||||
.whereType<SearchVideo>()
|
.whereType<SearchVideo>()
|
||||||
.map((e) => Video(e.id, e.title, e.author, null, e.uploadDate.toDateTime(), e.description, e.duration.toDuration(),
|
.map((e) => Video(
|
||||||
ThumbnailSet(e.id.value), null, Engagement(e.viewCount, null, null), e.isLive))
|
e.id,
|
||||||
|
e.title,
|
||||||
|
e.author,
|
||||||
|
null,
|
||||||
|
e.uploadDate.toDateTime(),
|
||||||
|
null,
|
||||||
|
e.description,
|
||||||
|
e.duration.toDuration(),
|
||||||
|
ThumbnailSet(e.id.value),
|
||||||
|
null,
|
||||||
|
Engagement(e.viewCount, null, null),
|
||||||
|
e.isLive))
|
||||||
.toList(),
|
.toList(),
|
||||||
page,
|
page,
|
||||||
_httpClient);
|
_httpClient);
|
||||||
|
|
|
@ -30,6 +30,9 @@ class Video with EquatableMixin {
|
||||||
/// DateTime.now() - how much time is was published.
|
/// DateTime.now() - how much time is was published.
|
||||||
final DateTime? uploadDate;
|
final DateTime? uploadDate;
|
||||||
|
|
||||||
|
/// Video publish date.
|
||||||
|
final DateTime? publishDate;
|
||||||
|
|
||||||
/// Video description.
|
/// Video description.
|
||||||
final String description;
|
final String description;
|
||||||
|
|
||||||
|
@ -62,6 +65,7 @@ class Video with EquatableMixin {
|
||||||
this.author,
|
this.author,
|
||||||
this.channelId,
|
this.channelId,
|
||||||
this.uploadDate,
|
this.uploadDate,
|
||||||
|
this.publishDate,
|
||||||
this.description,
|
this.description,
|
||||||
this.duration,
|
this.duration,
|
||||||
this.thumbnails,
|
this.thumbnails,
|
||||||
|
|
|
@ -38,6 +38,7 @@ class VideoClient {
|
||||||
playerResponse.videoAuthor,
|
playerResponse.videoAuthor,
|
||||||
ChannelId(playerResponse.videoChannelId),
|
ChannelId(playerResponse.videoChannelId),
|
||||||
playerResponse.videoUploadDate,
|
playerResponse.videoUploadDate,
|
||||||
|
playerResponse.videoPublishDate,
|
||||||
playerResponse.videoDescription,
|
playerResponse.videoDescription,
|
||||||
playerResponse.videoDuration,
|
playerResponse.videoDuration,
|
||||||
ThumbnailSet(videoId.value),
|
ThumbnailSet(videoId.value),
|
||||||
|
|
Loading…
Reference in New Issue