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