Add uploaded field.

This commit is contained in:
FireMasterK 2022-02-15 07:28:32 +00:00
parent f9be9522e9
commit 4ab4098c9a
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
3 changed files with 33 additions and 3 deletions

View file

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**duration** | **int** | The duration of the video in seconds. |
**thumbnail** | **String** | The thumbnail of the video. |
**title** | **String** | The title of the video. |
**uploaded** | **int** | The date in unix epoch the video was uploaded. | [optional]
**uploadedDate** | **String** | The relative date the video was uploaded on. | [optional]
**uploaderAvatar** | **String** | The avatar of the channel of the video. | [optional]
**uploaderName** | **String** | The name of the channel of the video. | [optional]

View file

@ -13,6 +13,7 @@ part 'stream_item.g.dart';
/// * [duration] - The duration of the video in seconds.
/// * [thumbnail] - The thumbnail of the video.
/// * [title] - The title of the video.
/// * [uploaded] - The date in unix epoch the video was uploaded.
/// * [uploadedDate] - The relative date the video was uploaded on.
/// * [uploaderAvatar] - The avatar of the channel of the video.
/// * [uploaderName] - The name of the channel of the video.
@ -33,6 +34,10 @@ abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
@BuiltValueField(wireName: r'title')
String get title;
/// The date in unix epoch the video was uploaded.
@BuiltValueField(wireName: r'uploaded')
int? get uploaded;
/// The relative date the video was uploaded on.
@BuiltValueField(wireName: r'uploadedDate')
String? get uploadedDate;
@ -95,6 +100,12 @@ class _$StreamItemSerializer implements StructuredSerializer<StreamItem> {
..add(r'title')
..add(serializers.serialize(object.title,
specifiedType: const FullType(String)));
if (object.uploaded != null) {
result
..add(r'uploaded')
..add(serializers.serialize(object.uploaded,
specifiedType: const FullType(int)));
}
if (object.uploadedDate != null) {
result
..add(r'uploadedDate')
@ -165,6 +176,11 @@ class _$StreamItemSerializer implements StructuredSerializer<StreamItem> {
specifiedType: const FullType(String)) as String;
result.title = valueDes;
break;
case r'uploaded':
final valueDes = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
result.uploaded = valueDes;
break;
case r'uploadedDate':
final valueDes = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;

View file

@ -14,6 +14,8 @@ class _$StreamItem extends StreamItem {
@override
final String title;
@override
final int? uploaded;
@override
final String? uploadedDate;
@override
final String? uploaderAvatar;
@ -35,6 +37,7 @@ class _$StreamItem extends StreamItem {
{required this.duration,
required this.thumbnail,
required this.title,
this.uploaded,
this.uploadedDate,
this.uploaderAvatar,
this.uploaderName,
@ -63,6 +66,7 @@ class _$StreamItem extends StreamItem {
duration == other.duration &&
thumbnail == other.thumbnail &&
title == other.title &&
uploaded == other.uploaded &&
uploadedDate == other.uploadedDate &&
uploaderAvatar == other.uploaderAvatar &&
uploaderName == other.uploaderName &&
@ -82,9 +86,11 @@ class _$StreamItem extends StreamItem {
$jc(
$jc(
$jc(
$jc($jc(0, duration.hashCode),
thumbnail.hashCode),
title.hashCode),
$jc(
$jc($jc(0, duration.hashCode),
thumbnail.hashCode),
title.hashCode),
uploaded.hashCode),
uploadedDate.hashCode),
uploaderAvatar.hashCode),
uploaderName.hashCode),
@ -100,6 +106,7 @@ class _$StreamItem extends StreamItem {
..add('duration', duration)
..add('thumbnail', thumbnail)
..add('title', title)
..add('uploaded', uploaded)
..add('uploadedDate', uploadedDate)
..add('uploaderAvatar', uploaderAvatar)
..add('uploaderName', uploaderName)
@ -126,6 +133,10 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
String? get title => _$this._title;
set title(String? title) => _$this._title = title;
int? _uploaded;
int? get uploaded => _$this._uploaded;
set uploaded(int? uploaded) => _$this._uploaded = uploaded;
String? _uploadedDate;
String? get uploadedDate => _$this._uploadedDate;
set uploadedDate(String? uploadedDate) => _$this._uploadedDate = uploadedDate;
@ -166,6 +177,7 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
_duration = $v.duration;
_thumbnail = $v.thumbnail;
_title = $v.title;
_uploaded = $v.uploaded;
_uploadedDate = $v.uploadedDate;
_uploaderAvatar = $v.uploaderAvatar;
_uploaderName = $v.uploaderName;
@ -199,6 +211,7 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
thumbnail, 'StreamItem', 'thumbnail'),
title: BuiltValueNullFieldError.checkNotNull(
title, 'StreamItem', 'title'),
uploaded: uploaded,
uploadedDate: uploadedDate,
uploaderAvatar: uploaderAvatar,
uploaderName: uploaderName,