mirror of
https://github.com/TeamPiped/piped_dart.git
synced 2024-08-14 22:27:49 +00:00
Regenerate and update.
This commit is contained in:
parent
4ab4098c9a
commit
8d3d6d14b0
21 changed files with 2130 additions and 83 deletions
191
lib/model/channel_info.dart
Normal file
191
lib/model/channel_info.dart
Normal file
|
@ -0,0 +1,191 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/model/stream_item.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'channel_info.g.dart';
|
||||
|
||||
abstract class ChannelInfo implements Built<ChannelInfo, ChannelInfoBuilder> {
|
||||
|
||||
/// The URL of the channel's avatar.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'avatarUrl')
|
||||
String get avatarUrl;
|
||||
|
||||
/// The URL of the channel's banner.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'bannerUrl')
|
||||
String get bannerUrl;
|
||||
|
||||
/// The channel's description.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String get description;
|
||||
|
||||
/// The ID of the channel.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'id')
|
||||
String get id;
|
||||
|
||||
/// The name of the channel.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String get name;
|
||||
|
||||
/// The parameter used to get the next page of related videos.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String get nextpage;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem> get relatedStreams;
|
||||
|
||||
/// The number of subscribers the channel has.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'subscriberCount')
|
||||
int get subscriberCount;
|
||||
|
||||
/// Whether the channel is verified.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool get verified;
|
||||
|
||||
ChannelInfo._();
|
||||
|
||||
static void _initializeBuilder(ChannelInfoBuilder b) => b;
|
||||
|
||||
factory ChannelInfo([void updates(ChannelInfoBuilder b)]) = _$ChannelInfo;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChannelInfo> get serializer => _$ChannelInfoSerializer();
|
||||
}
|
||||
|
||||
class _$ChannelInfoSerializer implements StructuredSerializer<ChannelInfo> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [ChannelInfo, _$ChannelInfo];
|
||||
@override
|
||||
final String wireName = r'ChannelInfo';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, ChannelInfo object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.avatarUrl != null) {
|
||||
result
|
||||
..add(r'avatarUrl')
|
||||
..add(serializers.serialize(object.avatarUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.bannerUrl != null) {
|
||||
result
|
||||
..add(r'bannerUrl')
|
||||
..add(serializers.serialize(object.bannerUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
..add(r'id')
|
||||
..add(serializers.serialize(object.id,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.name != null) {
|
||||
result
|
||||
..add(r'name')
|
||||
..add(serializers.serialize(object.name,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
result
|
||||
..add(r'nextpage')
|
||||
..add(serializers.serialize(object.nextpage,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
result
|
||||
..add(r'relatedStreams')
|
||||
..add(serializers.serialize(object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])));
|
||||
}
|
||||
if (object.subscriberCount != null) {
|
||||
result
|
||||
..add(r'subscriberCount')
|
||||
..add(serializers.serialize(object.subscriberCount,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.verified != null) {
|
||||
result
|
||||
..add(r'verified')
|
||||
..add(serializers.serialize(object.verified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
ChannelInfo deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = ChannelInfoBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'avatarUrl':
|
||||
result.avatarUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'bannerUrl':
|
||||
result.bannerUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'description':
|
||||
result.description = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'name':
|
||||
result.name = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'nextpage':
|
||||
result.nextpage = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
result.relatedStreams.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])) as BuiltList<StreamItem>);
|
||||
break;
|
||||
case r'subscriberCount':
|
||||
result.subscriberCount = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'verified':
|
||||
result.verified = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
79
lib/model/exception_error.dart
Normal file
79
lib/model/exception_error.dart
Normal file
|
@ -0,0 +1,79 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'exception_error.g.dart';
|
||||
|
||||
abstract class ExceptionError implements Built<ExceptionError, ExceptionErrorBuilder> {
|
||||
|
||||
/// The stacktrace provided by the server.
|
||||
@BuiltValueField(wireName: r'error')
|
||||
String get error;
|
||||
|
||||
/// The error message from the stacktrace.
|
||||
@BuiltValueField(wireName: r'message')
|
||||
String get message;
|
||||
|
||||
ExceptionError._();
|
||||
|
||||
static void _initializeBuilder(ExceptionErrorBuilder b) => b;
|
||||
|
||||
factory ExceptionError([void updates(ExceptionErrorBuilder b)]) = _$ExceptionError;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ExceptionError> get serializer => _$ExceptionErrorSerializer();
|
||||
}
|
||||
|
||||
class _$ExceptionErrorSerializer implements StructuredSerializer<ExceptionError> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [ExceptionError, _$ExceptionError];
|
||||
@override
|
||||
final String wireName = r'ExceptionError';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, ExceptionError object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
result
|
||||
..add(r'error')
|
||||
..add(serializers.serialize(object.error,
|
||||
specifiedType: const FullType(String)));
|
||||
result
|
||||
..add(r'message')
|
||||
..add(serializers.serialize(object.message,
|
||||
specifiedType: const FullType(String)));
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
ExceptionError deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = ExceptionErrorBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'error':
|
||||
result.error = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'message':
|
||||
result.message = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
246
lib/model/regions.dart
Normal file
246
lib/model/regions.dart
Normal file
|
@ -0,0 +1,246 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'regions.g.dart';
|
||||
|
||||
class Regions extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'DZ')
|
||||
static const Regions DZ = _$DZ;
|
||||
@BuiltValueEnumConst(wireName: r'AR')
|
||||
static const Regions AR = _$AR;
|
||||
@BuiltValueEnumConst(wireName: r'AU')
|
||||
static const Regions AU = _$AU;
|
||||
@BuiltValueEnumConst(wireName: r'AT')
|
||||
static const Regions AT = _$AT;
|
||||
@BuiltValueEnumConst(wireName: r'AZ')
|
||||
static const Regions AZ = _$AZ;
|
||||
@BuiltValueEnumConst(wireName: r'BH')
|
||||
static const Regions BH = _$BH;
|
||||
@BuiltValueEnumConst(wireName: r'BD')
|
||||
static const Regions BD = _$BD;
|
||||
@BuiltValueEnumConst(wireName: r'BY')
|
||||
static const Regions BY = _$BY;
|
||||
@BuiltValueEnumConst(wireName: r'BE')
|
||||
static const Regions BE = _$BE;
|
||||
@BuiltValueEnumConst(wireName: r'BO')
|
||||
static const Regions BO = _$BO;
|
||||
@BuiltValueEnumConst(wireName: r'BA')
|
||||
static const Regions BA = _$BA;
|
||||
@BuiltValueEnumConst(wireName: r'BR')
|
||||
static const Regions BR = _$BR;
|
||||
@BuiltValueEnumConst(wireName: r'BG')
|
||||
static const Regions BG = _$BG;
|
||||
@BuiltValueEnumConst(wireName: r'CA')
|
||||
static const Regions CA = _$CA;
|
||||
@BuiltValueEnumConst(wireName: r'CL')
|
||||
static const Regions CL = _$CL;
|
||||
@BuiltValueEnumConst(wireName: r'CO')
|
||||
static const Regions CO = _$CO;
|
||||
@BuiltValueEnumConst(wireName: r'CR')
|
||||
static const Regions CR = _$CR;
|
||||
@BuiltValueEnumConst(wireName: r'HR')
|
||||
static const Regions HR = _$HR;
|
||||
@BuiltValueEnumConst(wireName: r'CY')
|
||||
static const Regions CY = _$CY;
|
||||
@BuiltValueEnumConst(wireName: r'CZ')
|
||||
static const Regions CZ = _$CZ;
|
||||
@BuiltValueEnumConst(wireName: r'DK')
|
||||
static const Regions DK = _$DK;
|
||||
@BuiltValueEnumConst(wireName: r'DO')
|
||||
static const Regions DO = _$DO;
|
||||
@BuiltValueEnumConst(wireName: r'EC')
|
||||
static const Regions EC = _$EC;
|
||||
@BuiltValueEnumConst(wireName: r'EG')
|
||||
static const Regions EG = _$EG;
|
||||
@BuiltValueEnumConst(wireName: r'SV')
|
||||
static const Regions SV = _$SV;
|
||||
@BuiltValueEnumConst(wireName: r'EE')
|
||||
static const Regions EE = _$EE;
|
||||
@BuiltValueEnumConst(wireName: r'FI')
|
||||
static const Regions FI = _$FI;
|
||||
@BuiltValueEnumConst(wireName: r'FR')
|
||||
static const Regions FR = _$FR;
|
||||
@BuiltValueEnumConst(wireName: r'GE')
|
||||
static const Regions GE = _$GE;
|
||||
@BuiltValueEnumConst(wireName: r'DE')
|
||||
static const Regions DE = _$DE;
|
||||
@BuiltValueEnumConst(wireName: r'GH')
|
||||
static const Regions GH = _$GH;
|
||||
@BuiltValueEnumConst(wireName: r'GR')
|
||||
static const Regions GR = _$GR;
|
||||
@BuiltValueEnumConst(wireName: r'GT')
|
||||
static const Regions GT = _$GT;
|
||||
@BuiltValueEnumConst(wireName: r'HN')
|
||||
static const Regions HN = _$HN;
|
||||
@BuiltValueEnumConst(wireName: r'HK')
|
||||
static const Regions HK = _$HK;
|
||||
@BuiltValueEnumConst(wireName: r'HU')
|
||||
static const Regions HU = _$HU;
|
||||
@BuiltValueEnumConst(wireName: r'IS')
|
||||
static const Regions IS = _$IS;
|
||||
@BuiltValueEnumConst(wireName: r'IN')
|
||||
static const Regions IN = _$IN;
|
||||
@BuiltValueEnumConst(wireName: r'ID')
|
||||
static const Regions ID = _$ID;
|
||||
@BuiltValueEnumConst(wireName: r'IQ')
|
||||
static const Regions IQ = _$IQ;
|
||||
@BuiltValueEnumConst(wireName: r'IE')
|
||||
static const Regions IE = _$IE;
|
||||
@BuiltValueEnumConst(wireName: r'IL')
|
||||
static const Regions IL = _$IL;
|
||||
@BuiltValueEnumConst(wireName: r'IT')
|
||||
static const Regions IT = _$IT;
|
||||
@BuiltValueEnumConst(wireName: r'JM')
|
||||
static const Regions JM = _$JM;
|
||||
@BuiltValueEnumConst(wireName: r'JP')
|
||||
static const Regions JP = _$JP;
|
||||
@BuiltValueEnumConst(wireName: r'JO')
|
||||
static const Regions JO = _$JO;
|
||||
@BuiltValueEnumConst(wireName: r'KZ')
|
||||
static const Regions KZ = _$KZ;
|
||||
@BuiltValueEnumConst(wireName: r'KE')
|
||||
static const Regions KE = _$KE;
|
||||
@BuiltValueEnumConst(wireName: r'KW')
|
||||
static const Regions KW = _$KW;
|
||||
@BuiltValueEnumConst(wireName: r'LV')
|
||||
static const Regions LV = _$LV;
|
||||
@BuiltValueEnumConst(wireName: r'LB')
|
||||
static const Regions LB = _$LB;
|
||||
@BuiltValueEnumConst(wireName: r'LY')
|
||||
static const Regions LY = _$LY;
|
||||
@BuiltValueEnumConst(wireName: r'LI')
|
||||
static const Regions LI = _$LI;
|
||||
@BuiltValueEnumConst(wireName: r'LT')
|
||||
static const Regions LT = _$LT;
|
||||
@BuiltValueEnumConst(wireName: r'LU')
|
||||
static const Regions LU = _$LU;
|
||||
@BuiltValueEnumConst(wireName: r'MY')
|
||||
static const Regions MY = _$MY;
|
||||
@BuiltValueEnumConst(wireName: r'MT')
|
||||
static const Regions MT = _$MT;
|
||||
@BuiltValueEnumConst(wireName: r'MX')
|
||||
static const Regions MX = _$MX;
|
||||
@BuiltValueEnumConst(wireName: r'ME')
|
||||
static const Regions ME = _$ME;
|
||||
@BuiltValueEnumConst(wireName: r'MA')
|
||||
static const Regions MA = _$MA;
|
||||
@BuiltValueEnumConst(wireName: r'NP')
|
||||
static const Regions NP = _$NP;
|
||||
@BuiltValueEnumConst(wireName: r'NL')
|
||||
static const Regions NL = _$NL;
|
||||
@BuiltValueEnumConst(wireName: r'NZ')
|
||||
static const Regions NZ = _$NZ;
|
||||
@BuiltValueEnumConst(wireName: r'NI')
|
||||
static const Regions NI = _$NI;
|
||||
@BuiltValueEnumConst(wireName: r'NG')
|
||||
static const Regions NG = _$NG;
|
||||
@BuiltValueEnumConst(wireName: r'MK')
|
||||
static const Regions MK = _$MK;
|
||||
@BuiltValueEnumConst(wireName: r'NO')
|
||||
static const Regions NO = _$NO;
|
||||
@BuiltValueEnumConst(wireName: r'OM')
|
||||
static const Regions OM = _$OM;
|
||||
@BuiltValueEnumConst(wireName: r'PK')
|
||||
static const Regions PK = _$PK;
|
||||
@BuiltValueEnumConst(wireName: r'PA')
|
||||
static const Regions PA = _$PA;
|
||||
@BuiltValueEnumConst(wireName: r'PG')
|
||||
static const Regions PG = _$PG;
|
||||
@BuiltValueEnumConst(wireName: r'PY')
|
||||
static const Regions PY = _$PY;
|
||||
@BuiltValueEnumConst(wireName: r'PE')
|
||||
static const Regions PE = _$PE;
|
||||
@BuiltValueEnumConst(wireName: r'PH')
|
||||
static const Regions PH = _$PH;
|
||||
@BuiltValueEnumConst(wireName: r'PL')
|
||||
static const Regions PL = _$PL;
|
||||
@BuiltValueEnumConst(wireName: r'PT')
|
||||
static const Regions PT = _$PT;
|
||||
@BuiltValueEnumConst(wireName: r'PR')
|
||||
static const Regions PR = _$PR;
|
||||
@BuiltValueEnumConst(wireName: r'QA')
|
||||
static const Regions QA = _$QA;
|
||||
@BuiltValueEnumConst(wireName: r'RO')
|
||||
static const Regions RO = _$RO;
|
||||
@BuiltValueEnumConst(wireName: r'RU')
|
||||
static const Regions RU = _$RU;
|
||||
@BuiltValueEnumConst(wireName: r'SA')
|
||||
static const Regions SA = _$SA;
|
||||
@BuiltValueEnumConst(wireName: r'SN')
|
||||
static const Regions SN = _$SN;
|
||||
@BuiltValueEnumConst(wireName: r'RS')
|
||||
static const Regions RS = _$RS;
|
||||
@BuiltValueEnumConst(wireName: r'SG')
|
||||
static const Regions SG = _$SG;
|
||||
@BuiltValueEnumConst(wireName: r'SK')
|
||||
static const Regions SK = _$SK;
|
||||
@BuiltValueEnumConst(wireName: r'SI')
|
||||
static const Regions SI = _$SI;
|
||||
@BuiltValueEnumConst(wireName: r'ZA')
|
||||
static const Regions ZA = _$ZA;
|
||||
@BuiltValueEnumConst(wireName: r'KR')
|
||||
static const Regions KR = _$KR;
|
||||
@BuiltValueEnumConst(wireName: r'ES')
|
||||
static const Regions ES = _$ES;
|
||||
@BuiltValueEnumConst(wireName: r'LK')
|
||||
static const Regions LK = _$LK;
|
||||
@BuiltValueEnumConst(wireName: r'SE')
|
||||
static const Regions SE = _$SE;
|
||||
@BuiltValueEnumConst(wireName: r'CH')
|
||||
static const Regions CH = _$CH;
|
||||
@BuiltValueEnumConst(wireName: r'TW')
|
||||
static const Regions TW = _$TW;
|
||||
@BuiltValueEnumConst(wireName: r'TZ')
|
||||
static const Regions TZ = _$TZ;
|
||||
@BuiltValueEnumConst(wireName: r'TH')
|
||||
static const Regions TH = _$TH;
|
||||
@BuiltValueEnumConst(wireName: r'TN')
|
||||
static const Regions TN = _$TN;
|
||||
@BuiltValueEnumConst(wireName: r'TR')
|
||||
static const Regions TR = _$TR;
|
||||
@BuiltValueEnumConst(wireName: r'UG')
|
||||
static const Regions UG = _$UG;
|
||||
@BuiltValueEnumConst(wireName: r'UA')
|
||||
static const Regions UA = _$UA;
|
||||
@BuiltValueEnumConst(wireName: r'AE')
|
||||
static const Regions AE = _$AE;
|
||||
@BuiltValueEnumConst(wireName: r'GB')
|
||||
static const Regions GB = _$GB;
|
||||
@BuiltValueEnumConst(wireName: r'US')
|
||||
static const Regions US = _$US;
|
||||
@BuiltValueEnumConst(wireName: r'UY')
|
||||
static const Regions UY = _$UY;
|
||||
@BuiltValueEnumConst(wireName: r'VE')
|
||||
static const Regions VE = _$VE;
|
||||
@BuiltValueEnumConst(wireName: r'VN')
|
||||
static const Regions VN = _$VN;
|
||||
@BuiltValueEnumConst(wireName: r'YE')
|
||||
static const Regions YE = _$YE;
|
||||
@BuiltValueEnumConst(wireName: r'ZW')
|
||||
static const Regions ZW = _$ZW;
|
||||
|
||||
static Serializer<Regions> get serializer => _$regionsSerializer;
|
||||
|
||||
const Regions._(String name): super(name);
|
||||
|
||||
static BuiltSet<Regions> get values => _$values;
|
||||
static Regions valueOf(String name) => _$valueOf(name);
|
||||
}
|
||||
|
||||
/// Optionally, enum_class can generate a mixin to go with your enum for use
|
||||
/// with Angular. It exposes your enum constants as getters. So, if you mix it
|
||||
/// in to your Dart component class, the values become available to the
|
||||
/// corresponding Angular template.
|
||||
///
|
||||
/// Trigger mixin generation by writing a line like this one next to your enum.
|
||||
abstract class RegionsMixin = Object with _$RegionsMixin;
|
||||
|
284
lib/model/stream.dart
Normal file
284
lib/model/stream.dart
Normal file
|
@ -0,0 +1,284 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'stream.g.dart';
|
||||
|
||||
abstract class Stream implements Built<Stream, StreamBuilder> {
|
||||
|
||||
/// The URL of the stream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
|
||||
/// The format of the stream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'format')
|
||||
StreamFormatEnum get format;
|
||||
// enum formatEnum { MPEG_4, v3GPP, WEBM, M4A, WEBMA_OPUS, };
|
||||
|
||||
/// The quality of the stream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'quality')
|
||||
String get quality;
|
||||
|
||||
/// The mime type of the stream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String get mimeType;
|
||||
|
||||
/// The codec of the stream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'codec')
|
||||
String get codec;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'videoOnly')
|
||||
bool get videoOnly;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'bitrate')
|
||||
int get bitrate;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'initStart')
|
||||
int get initStart;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'initEnd')
|
||||
int get initEnd;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'indexStart')
|
||||
int get indexStart;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'indexEnd')
|
||||
int get indexEnd;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'width')
|
||||
int get width;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'height')
|
||||
int get height;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'fps')
|
||||
int get fps;
|
||||
|
||||
Stream._();
|
||||
|
||||
static void _initializeBuilder(StreamBuilder b) => b;
|
||||
|
||||
factory Stream([void updates(StreamBuilder b)]) = _$Stream;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Stream> get serializer => _$StreamSerializer();
|
||||
}
|
||||
|
||||
class _$StreamSerializer implements StructuredSerializer<Stream> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [Stream, _$Stream];
|
||||
@override
|
||||
final String wireName = r'Stream';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, Stream object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.format != null) {
|
||||
result
|
||||
..add(r'format')
|
||||
..add(serializers.serialize(object.format,
|
||||
specifiedType: const FullType(StreamFormatEnum)));
|
||||
}
|
||||
if (object.quality != null) {
|
||||
result
|
||||
..add(r'quality')
|
||||
..add(serializers.serialize(object.quality,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
result
|
||||
..add(r'mimeType')
|
||||
..add(serializers.serialize(object.mimeType,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.codec != null) {
|
||||
result
|
||||
..add(r'codec')
|
||||
..add(serializers.serialize(object.codec,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.videoOnly != null) {
|
||||
result
|
||||
..add(r'videoOnly')
|
||||
..add(serializers.serialize(object.videoOnly,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.bitrate != null) {
|
||||
result
|
||||
..add(r'bitrate')
|
||||
..add(serializers.serialize(object.bitrate,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.initStart != null) {
|
||||
result
|
||||
..add(r'initStart')
|
||||
..add(serializers.serialize(object.initStart,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.initEnd != null) {
|
||||
result
|
||||
..add(r'initEnd')
|
||||
..add(serializers.serialize(object.initEnd,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.indexStart != null) {
|
||||
result
|
||||
..add(r'indexStart')
|
||||
..add(serializers.serialize(object.indexStart,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.indexEnd != null) {
|
||||
result
|
||||
..add(r'indexEnd')
|
||||
..add(serializers.serialize(object.indexEnd,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.width != null) {
|
||||
result
|
||||
..add(r'width')
|
||||
..add(serializers.serialize(object.width,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.height != null) {
|
||||
result
|
||||
..add(r'height')
|
||||
..add(serializers.serialize(object.height,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.fps != null) {
|
||||
result
|
||||
..add(r'fps')
|
||||
..add(serializers.serialize(object.fps,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
Stream deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = StreamBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'url':
|
||||
result.url = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'format':
|
||||
result.format = serializers.deserialize(value,
|
||||
specifiedType: const FullType(StreamFormatEnum)) as StreamFormatEnum;
|
||||
break;
|
||||
case r'quality':
|
||||
result.quality = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'mimeType':
|
||||
result.mimeType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'codec':
|
||||
result.codec = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'videoOnly':
|
||||
result.videoOnly = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case r'bitrate':
|
||||
result.bitrate = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'initStart':
|
||||
result.initStart = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'initEnd':
|
||||
result.initEnd = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'indexStart':
|
||||
result.indexStart = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'indexEnd':
|
||||
result.indexEnd = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'width':
|
||||
result.width = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'height':
|
||||
result.height = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'fps':
|
||||
result.fps = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class StreamFormatEnum extends EnumClass {
|
||||
|
||||
/// The format of the stream.
|
||||
@BuiltValueEnumConst(wireName: r'MPEG_4')
|
||||
static const StreamFormatEnum mPEG4 = _$streamFormatEnum_mPEG4;
|
||||
/// The format of the stream.
|
||||
@BuiltValueEnumConst(wireName: r'v3GPP')
|
||||
static const StreamFormatEnum v3GPP = _$streamFormatEnum_v3GPP;
|
||||
/// The format of the stream.
|
||||
@BuiltValueEnumConst(wireName: r'WEBM')
|
||||
static const StreamFormatEnum WEBM = _$streamFormatEnum_WEBM;
|
||||
/// The format of the stream.
|
||||
@BuiltValueEnumConst(wireName: r'M4A')
|
||||
static const StreamFormatEnum m4A = _$streamFormatEnum_m4A;
|
||||
/// The format of the stream.
|
||||
@BuiltValueEnumConst(wireName: r'WEBMA_OPUS')
|
||||
static const StreamFormatEnum WEBMA_OPUS = _$streamFormatEnum_WEBMA_OPUS;
|
||||
|
||||
static Serializer<StreamFormatEnum> get serializer => _$streamFormatEnumSerializer;
|
||||
|
||||
const StreamFormatEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<StreamFormatEnum> get values => _$streamFormatEnumValues;
|
||||
static StreamFormatEnum valueOf(String name) => _$streamFormatEnumValueOf(name);
|
||||
}
|
||||
|
208
lib/model/stream_item.dart
Normal file
208
lib/model/stream_item.dart
Normal file
|
@ -0,0 +1,208 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'stream_item.g.dart';
|
||||
|
||||
abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
|
||||
|
||||
/// The duration of the video in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int get duration;
|
||||
|
||||
/// The thumbnail of the video.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String get thumbnail;
|
||||
|
||||
/// The title of the video.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String get title;
|
||||
|
||||
/// The date in unix epoch the video was uploaded.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaded')
|
||||
int get uploaded;
|
||||
|
||||
/// The relative date the video was uploaded on.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploadedDate')
|
||||
String get uploadedDate;
|
||||
|
||||
/// The avatar of the channel of the video.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String get uploaderAvatar;
|
||||
|
||||
/// The name of the channel of the video.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderName')
|
||||
String get uploaderName;
|
||||
|
||||
/// The relative URL of the channel of the video.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String get uploaderUrl;
|
||||
|
||||
/// Whether or not the channel has a verified badge.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool get uploaderVerified;
|
||||
|
||||
/// The relative URL to the video.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
|
||||
/// The number of views the video has.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int get views;
|
||||
|
||||
StreamItem._();
|
||||
|
||||
static void _initializeBuilder(StreamItemBuilder b) => b;
|
||||
|
||||
factory StreamItem([void updates(StreamItemBuilder b)]) = _$StreamItem;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<StreamItem> get serializer => _$StreamItemSerializer();
|
||||
}
|
||||
|
||||
class _$StreamItemSerializer implements StructuredSerializer<StreamItem> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [StreamItem, _$StreamItem];
|
||||
@override
|
||||
final String wireName = r'StreamItem';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, StreamItem object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
result
|
||||
..add(r'duration')
|
||||
..add(serializers.serialize(object.duration,
|
||||
specifiedType: const FullType(int)));
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
result
|
||||
..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')
|
||||
..add(serializers.serialize(object.uploadedDate,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
result
|
||||
..add(r'uploaderAvatar')
|
||||
..add(serializers.serialize(object.uploaderAvatar,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderName != null) {
|
||||
result
|
||||
..add(r'uploaderName')
|
||||
..add(serializers.serialize(object.uploaderName,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
result
|
||||
..add(r'uploaderUrl')
|
||||
..add(serializers.serialize(object.uploaderUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
result
|
||||
..add(r'uploaderVerified')
|
||||
..add(serializers.serialize(object.uploaderVerified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
if (object.views != null) {
|
||||
result
|
||||
..add(r'views')
|
||||
..add(serializers.serialize(object.views,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
StreamItem deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = StreamItemBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'duration':
|
||||
result.duration = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
result.thumbnail = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'title':
|
||||
result.title = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaded':
|
||||
result.uploaded = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'uploadedDate':
|
||||
result.uploadedDate = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
result.uploaderAvatar = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderName':
|
||||
result.uploaderName = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
result.uploaderUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
result.uploaderVerified = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case r'url':
|
||||
result.url = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'views':
|
||||
result.views = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
115
lib/model/subtitle.dart
Normal file
115
lib/model/subtitle.dart
Normal file
|
@ -0,0 +1,115 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'subtitle.g.dart';
|
||||
|
||||
abstract class Subtitle implements Built<Subtitle, SubtitleBuilder> {
|
||||
|
||||
/// Whether the subtitle is auto generated.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'autoGenerated')
|
||||
bool get autoGenerated;
|
||||
|
||||
/// The language code of the subtitle.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'code')
|
||||
String get code;
|
||||
|
||||
/// The mime type of the subtitle.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String get mimeType;
|
||||
|
||||
/// The URL of the subtitle.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
|
||||
Subtitle._();
|
||||
|
||||
static void _initializeBuilder(SubtitleBuilder b) => b;
|
||||
|
||||
factory Subtitle([void updates(SubtitleBuilder b)]) = _$Subtitle;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Subtitle> get serializer => _$SubtitleSerializer();
|
||||
}
|
||||
|
||||
class _$SubtitleSerializer implements StructuredSerializer<Subtitle> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [Subtitle, _$Subtitle];
|
||||
@override
|
||||
final String wireName = r'Subtitle';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, Subtitle object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.autoGenerated != null) {
|
||||
result
|
||||
..add(r'autoGenerated')
|
||||
..add(serializers.serialize(object.autoGenerated,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.code != null) {
|
||||
result
|
||||
..add(r'code')
|
||||
..add(serializers.serialize(object.code,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
result
|
||||
..add(r'mimeType')
|
||||
..add(serializers.serialize(object.mimeType,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
Subtitle deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = SubtitleBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'autoGenerated':
|
||||
result.autoGenerated = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case r'code':
|
||||
result.code = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'mimeType':
|
||||
result.mimeType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'url':
|
||||
result.url = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
355
lib/model/video_info.dart
Normal file
355
lib/model/video_info.dart
Normal file
|
@ -0,0 +1,355 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.7
|
||||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/model/stream_item.dart';
|
||||
import 'package:piped_api/model/subtitle.dart';
|
||||
import 'package:piped_api/model/stream.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'video_info.g.dart';
|
||||
|
||||
abstract class VideoInfo implements Built<VideoInfo, VideoInfoBuilder> {
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'audioStreams')
|
||||
BuiltList<Stream> get audioStreams;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'videoStreams')
|
||||
BuiltList<Stream> get videoStreams;
|
||||
|
||||
/// The video's description.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String get description;
|
||||
|
||||
/// The number of dislikes the video has.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'dislikes')
|
||||
int get dislikes;
|
||||
|
||||
/// The video's duration in seconds.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int get duration;
|
||||
|
||||
/// The stream of the video in a HLS manifest.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'hls')
|
||||
String get hls;
|
||||
|
||||
/// The LBRY ID of the video.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'lbryId')
|
||||
String get lbryId;
|
||||
|
||||
/// The number of likes the video has.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'likes')
|
||||
int get likes;
|
||||
|
||||
/// Whether the video is a livestream.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'livestream')
|
||||
bool get livestream;
|
||||
|
||||
/// The base URL of the backend instance's proxy.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'proxyUrl')
|
||||
String get proxyUrl;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'subtitles')
|
||||
BuiltList<Subtitle> get subtitles;
|
||||
|
||||
/// The URL of the DASH manifest.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'dash')
|
||||
String get dash;
|
||||
|
||||
/// The URL of the video's thumbnail.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'thumbnailUrl')
|
||||
String get thumbnailUrl;
|
||||
|
||||
/// The video's title.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String get title;
|
||||
|
||||
/// The date the video was uploaded.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploadDate')
|
||||
String get uploadDate;
|
||||
|
||||
/// The video's uploader.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploader')
|
||||
String get uploader;
|
||||
|
||||
/// The URL of the video's uploader's avatar.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String get uploaderAvatar;
|
||||
|
||||
/// The relative URL of the video's uploader.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String get uploaderUrl;
|
||||
|
||||
/// Whether the video's uploader is verified.
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool get uploaderVerified;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem> get relatedStreams;
|
||||
|
||||
VideoInfo._();
|
||||
|
||||
static void _initializeBuilder(VideoInfoBuilder b) => b;
|
||||
|
||||
factory VideoInfo([void updates(VideoInfoBuilder b)]) = _$VideoInfo;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<VideoInfo> get serializer => _$VideoInfoSerializer();
|
||||
}
|
||||
|
||||
class _$VideoInfoSerializer implements StructuredSerializer<VideoInfo> {
|
||||
|
||||
@override
|
||||
final Iterable<Type> types = const [VideoInfo, _$VideoInfo];
|
||||
@override
|
||||
final String wireName = r'VideoInfo';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(Serializers serializers, VideoInfo object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[];
|
||||
if (object.audioStreams != null) {
|
||||
result
|
||||
..add(r'audioStreams')
|
||||
..add(serializers.serialize(object.audioStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])));
|
||||
}
|
||||
if (object.videoStreams != null) {
|
||||
result
|
||||
..add(r'videoStreams')
|
||||
..add(serializers.serialize(object.videoStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])));
|
||||
}
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.dislikes != null) {
|
||||
result
|
||||
..add(r'dislikes')
|
||||
..add(serializers.serialize(object.dislikes,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.duration != null) {
|
||||
result
|
||||
..add(r'duration')
|
||||
..add(serializers.serialize(object.duration,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.hls != null) {
|
||||
result
|
||||
..add(r'hls')
|
||||
..add(serializers.serialize(object.hls,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.lbryId != null) {
|
||||
result
|
||||
..add(r'lbryId')
|
||||
..add(serializers.serialize(object.lbryId,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.likes != null) {
|
||||
result
|
||||
..add(r'likes')
|
||||
..add(serializers.serialize(object.likes,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.livestream != null) {
|
||||
result
|
||||
..add(r'livestream')
|
||||
..add(serializers.serialize(object.livestream,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.proxyUrl != null) {
|
||||
result
|
||||
..add(r'proxyUrl')
|
||||
..add(serializers.serialize(object.proxyUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.subtitles != null) {
|
||||
result
|
||||
..add(r'subtitles')
|
||||
..add(serializers.serialize(object.subtitles,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)])));
|
||||
}
|
||||
if (object.dash != null) {
|
||||
result
|
||||
..add(r'dash')
|
||||
..add(serializers.serialize(object.dash,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.thumbnailUrl != null) {
|
||||
result
|
||||
..add(r'thumbnailUrl')
|
||||
..add(serializers.serialize(object.thumbnailUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.title != null) {
|
||||
result
|
||||
..add(r'title')
|
||||
..add(serializers.serialize(object.title,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploadDate != null) {
|
||||
result
|
||||
..add(r'uploadDate')
|
||||
..add(serializers.serialize(object.uploadDate,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploader != null) {
|
||||
result
|
||||
..add(r'uploader')
|
||||
..add(serializers.serialize(object.uploader,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
result
|
||||
..add(r'uploaderAvatar')
|
||||
..add(serializers.serialize(object.uploaderAvatar,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
result
|
||||
..add(r'uploaderUrl')
|
||||
..add(serializers.serialize(object.uploaderUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
result
|
||||
..add(r'uploaderVerified')
|
||||
..add(serializers.serialize(object.uploaderVerified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
result
|
||||
..add(r'relatedStreams')
|
||||
..add(serializers.serialize(object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
VideoInfo deserialize(Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = VideoInfoBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case r'audioStreams':
|
||||
result.audioStreams.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])) as BuiltList<Stream>);
|
||||
break;
|
||||
case r'videoStreams':
|
||||
result.videoStreams.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])) as BuiltList<Stream>);
|
||||
break;
|
||||
case r'description':
|
||||
result.description = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'dislikes':
|
||||
result.dislikes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'duration':
|
||||
result.duration = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'hls':
|
||||
result.hls = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'lbryId':
|
||||
result.lbryId = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'likes':
|
||||
result.likes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
break;
|
||||
case r'livestream':
|
||||
result.livestream = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case r'proxyUrl':
|
||||
result.proxyUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'subtitles':
|
||||
result.subtitles.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)])) as BuiltList<Subtitle>);
|
||||
break;
|
||||
case r'dash':
|
||||
result.dash = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'thumbnailUrl':
|
||||
result.thumbnailUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'title':
|
||||
result.title = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploadDate':
|
||||
result.uploadDate = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploader':
|
||||
result.uploader = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
result.uploaderAvatar = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
result.uploaderUrl = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
result.uploaderVerified = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
result.relatedStreams.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])) as BuiltList<StreamItem>);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue