mirror of
https://github.com/TeamPiped/piped_dart.git
synced 2024-08-14 22:27:49 +00:00
Add replyCount in comments and unauthenticated feed api.
This commit is contained in:
parent
7407348212
commit
fd20ae95b1
22 changed files with 1743 additions and 22 deletions
|
@ -9,7 +9,11 @@ export 'package:piped_api/src/auth/oauth.dart';
|
|||
export 'package:piped_api/src/serializers.dart';
|
||||
export 'package:piped_api/src/model/date.dart';
|
||||
|
||||
export 'package:piped_api/src/api/channel_api.dart';
|
||||
export 'package:piped_api/src/api/feed_api.dart';
|
||||
export 'package:piped_api/src/api/search_api.dart';
|
||||
export 'package:piped_api/src/api/unauthenticated_api.dart';
|
||||
export 'package:piped_api/src/api/video_api.dart';
|
||||
|
||||
export 'package:piped_api/src/model/channel_info.dart';
|
||||
export 'package:piped_api/src/model/channel_item.dart';
|
||||
|
|
|
@ -9,7 +9,11 @@ import 'package:piped_api/src/auth/api_key_auth.dart';
|
|||
import 'package:piped_api/src/auth/basic_auth.dart';
|
||||
import 'package:piped_api/src/auth/bearer_auth.dart';
|
||||
import 'package:piped_api/src/auth/oauth.dart';
|
||||
import 'package:piped_api/src/api/channel_api.dart';
|
||||
import 'package:piped_api/src/api/feed_api.dart';
|
||||
import 'package:piped_api/src/api/search_api.dart';
|
||||
import 'package:piped_api/src/api/unauthenticated_api.dart';
|
||||
import 'package:piped_api/src/api/video_api.dart';
|
||||
|
||||
class PipedApi {
|
||||
static const String basePath = r'https://pipedapi.kavin.rocks';
|
||||
|
@ -65,9 +69,33 @@ class PipedApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Get ChannelApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
ChannelApi getChannelApi() {
|
||||
return ChannelApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get FeedApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
FeedApi getFeedApi() {
|
||||
return FeedApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get SearchApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
SearchApi getSearchApi() {
|
||||
return SearchApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get UnauthenticatedApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
UnauthenticatedApi getUnauthenticatedApi() {
|
||||
return UnauthenticatedApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get VideoApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
VideoApi getVideoApi() {
|
||||
return VideoApi(dio, serializers);
|
||||
}
|
||||
}
|
||||
|
|
326
lib/src/api/channel_api.dart
Normal file
326
lib/src/api/channel_api.dart
Normal file
|
@ -0,0 +1,326 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:piped_api/src/api_util.dart';
|
||||
import 'package:piped_api/src/model/channel_info.dart';
|
||||
import 'package:piped_api/src/model/exception_error.dart';
|
||||
import 'package:piped_api/src/model/streams_page.dart';
|
||||
|
||||
class ChannelApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const ChannelApi(this._dio, this._serializers);
|
||||
|
||||
/// Gets Channel Information from ID.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [channelId] - The channel ID of the YouTube channel you want to get information about.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ChannelInfo] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<ChannelInfo>> channelInfoId({
|
||||
required String channelId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/channel/{channelId}'.replaceAll('{' r'channelId' '}', channelId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ChannelInfo _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(ChannelInfo);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as ChannelInfo;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<ChannelInfo>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets Channel Information from name.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [name] - The name of the YouTube channel you want to get information about.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ChannelInfo] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<ChannelInfo>> channelInfoName({
|
||||
required String name,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/c/{name}'.replaceAll('{' r'name' '}', name.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ChannelInfo _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(ChannelInfo);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as ChannelInfo;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<ChannelInfo>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets Channel Information from username.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [username] - The username of the YouTube channel you want to get information about.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ChannelInfo] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<ChannelInfo>> channelInfoUsername({
|
||||
required String username,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ChannelInfo _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(ChannelInfo);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as ChannelInfo;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<ChannelInfo>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets more channel videos
|
||||
/// Gets more channel videos.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [channelId] - The channel ID of the YouTube channel you want to get more videos from.
|
||||
/// * [nextpage] - The next page token to get more videos from.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [StreamsPage] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<StreamsPage>> channelNextPage({
|
||||
required String channelId,
|
||||
required String nextpage,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/nextpage/channel/{channelId}'.replaceAll('{' r'channelId' '}', channelId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'nextpage': encodeQueryParameter(_serializers, nextpage, const FullType(String)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
StreamsPage _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(StreamsPage);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as StreamsPage;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<StreamsPage>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
102
lib/src/api/feed_api.dart
Normal file
102
lib/src/api/feed_api.dart
Normal file
|
@ -0,0 +1,102 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/src/api_util.dart';
|
||||
import 'package:piped_api/src/model/exception_error.dart';
|
||||
import 'package:piped_api/src/model/stream_item.dart';
|
||||
|
||||
class FeedApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const FeedApi(this._dio, this._serializers);
|
||||
|
||||
/// Generate a feed while unauthenticated, from a list of channelIds.
|
||||
/// Generates a user feed while unauthenticated.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [channels] - A list of channelIds to generate a feed from.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BuiltList<StreamItem>] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<BuiltList<StreamItem>>> feedUnauthenticated({
|
||||
required BuiltList<String> channels,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/feed/unauthenticated';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'channels': encodeCollectionQueryParameter<String>(_serializers, channels, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BuiltList<StreamItem> _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(BuiltList, [FullType(StreamItem)]);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as BuiltList<StreamItem>;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<BuiltList<StreamItem>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
190
lib/src/api/search_api.dart
Normal file
190
lib/src/api/search_api.dart
Normal file
|
@ -0,0 +1,190 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:piped_api/src/api_util.dart';
|
||||
import 'package:piped_api/src/model/exception_error.dart';
|
||||
import 'package:piped_api/src/model/search_filter.dart';
|
||||
import 'package:piped_api/src/model/search_page.dart';
|
||||
|
||||
class SearchApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const SearchApi(this._dio, this._serializers);
|
||||
|
||||
/// Searches for videos, channels, and playlists.
|
||||
/// Searches for videos, channels, and playlists.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [q] - The search query string.
|
||||
/// * [filter] - The filter parameter specifies a filter query that restricts the results to items that match the filter.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [SearchPage] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<SearchPage>> search({
|
||||
required String q,
|
||||
required SearchFilter filter,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/search';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'q': encodeQueryParameter(_serializers, q, const FullType(String)),
|
||||
r'filter': encodeQueryParameter(_serializers, filter, const FullType(SearchFilter)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
SearchPage _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(SearchPage);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as SearchPage;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<SearchPage>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets more search results
|
||||
/// Gets more search results.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [nextpage] - The next page token to get more search results from.
|
||||
/// * [q] - The search query string.
|
||||
/// * [filter] - The filter parameter specifies a filter query that restricts the results to items that match the filter.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [SearchPage] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<SearchPage>> searchNextPage({
|
||||
required String nextpage,
|
||||
required String q,
|
||||
required SearchFilter filter,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/nextpage/search';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'nextpage': encodeQueryParameter(_serializers, nextpage, const FullType(String)),
|
||||
r'q': encodeQueryParameter(_serializers, q, const FullType(String)),
|
||||
r'filter': encodeQueryParameter(_serializers, filter, const FullType(SearchFilter)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
SearchPage _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(SearchPage);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as SearchPage;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<SearchPage>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -27,7 +27,7 @@ class UnauthenticatedApi {
|
|||
|
||||
const UnauthenticatedApi(this._dio, this._serializers);
|
||||
|
||||
/// Gets Channel Information
|
||||
/// Gets Channel Information from ID.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
|
@ -101,7 +101,7 @@ class UnauthenticatedApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Gets Channel Information
|
||||
/// Gets Channel Information from name.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
|
@ -175,7 +175,7 @@ class UnauthenticatedApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Gets Channel Information
|
||||
/// Gets Channel Information from username.
|
||||
/// Gets all available Channel information about a channel.
|
||||
///
|
||||
/// Parameters:
|
||||
|
@ -485,6 +485,85 @@ class UnauthenticatedApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// Generate a feed while unauthenticated, from a list of channelIds.
|
||||
/// Generates a user feed while unauthenticated.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [channels] - A list of channelIds to generate a feed from.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BuiltList<StreamItem>] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<BuiltList<StreamItem>>> feedUnauthenticated({
|
||||
required BuiltList<String> channels,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/feed/unauthenticated';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'channels': encodeCollectionQueryParameter<String>(_serializers, channels, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BuiltList<StreamItem> _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(BuiltList, [FullType(StreamItem)]);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as BuiltList<StreamItem>;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<BuiltList<StreamItem>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Searches for videos, channels, and playlists.
|
||||
/// Searches for videos, channels, and playlists.
|
||||
///
|
||||
|
|
252
lib/src/api/video_api.dart
Normal file
252
lib/src/api/video_api.dart
Normal file
|
@ -0,0 +1,252 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:piped_api/src/api_util.dart';
|
||||
import 'package:piped_api/src/model/comments_page.dart';
|
||||
import 'package:piped_api/src/model/exception_error.dart';
|
||||
import 'package:piped_api/src/model/video_info.dart';
|
||||
|
||||
class VideoApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const VideoApi(this._dio, this._serializers);
|
||||
|
||||
/// Gets Comments
|
||||
/// Gets the comments for a video.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [videoId] - The video ID of the YouTube video you want to get comments from.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CommentsPage] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<CommentsPage>> comments({
|
||||
required String videoId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/comments/{videoId}'.replaceAll('{' r'videoId' '}', videoId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CommentsPage _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(CommentsPage);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as CommentsPage;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<CommentsPage>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets more comments
|
||||
/// Gets more comments.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [videoId] - The video ID of the YouTube video you want to get more comments from.
|
||||
/// * [nextpage] - The next page token to get more comments from.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CommentsPage] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<CommentsPage>> commentsNextPage({
|
||||
required String videoId,
|
||||
required String nextpage,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/nextpage/comments/{videoId}'.replaceAll('{' r'videoId' '}', videoId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'nextpage': encodeQueryParameter(_serializers, nextpage, const FullType(String)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CommentsPage _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(CommentsPage);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as CommentsPage;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<CommentsPage>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Gets Video Information
|
||||
/// Gets all available Stream information about a video.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [videoId] - The video ID of the YouTube video you want to get information about.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [VideoInfo] as data
|
||||
/// Throws [DioError] if API call or serialization fails
|
||||
Future<Response<VideoInfo>> streamInfo({
|
||||
required String videoId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/streams/{videoId}'.replaceAll('{' r'videoId' '}', videoId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
VideoInfo _responseData;
|
||||
|
||||
try {
|
||||
const _responseType = FullType(VideoInfo);
|
||||
_responseData = _serializers.deserialize(
|
||||
_response.data!,
|
||||
specifiedType: _responseType,
|
||||
) as VideoInfo;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioError(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioErrorType.other,
|
||||
error: error,
|
||||
)..stackTrace = stackTrace;
|
||||
}
|
||||
|
||||
return Response<VideoInfo>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -19,6 +19,7 @@ part 'comment.g.dart';
|
|||
/// * [commentorUrl] - The relative URL of the author of the comment.
|
||||
/// * [repliesPage] - The parameter used as the nextpage to fetch replies for this comment.
|
||||
/// * [likeCount] - The number of likes the comment has.
|
||||
/// * [replyCount] - The number of replies the comment has.
|
||||
/// * [hearted] - Whether the comment was hearted by the video's uploader.
|
||||
/// * [pinned] - Whether the comment was pinned by the video's uploader.
|
||||
/// * [verified] - Whether the author of the comment is verified.
|
||||
|
@ -56,6 +57,10 @@ abstract class Comment implements Built<Comment, CommentBuilder> {
|
|||
@BuiltValueField(wireName: r'likeCount')
|
||||
int? get likeCount;
|
||||
|
||||
/// The number of replies the comment has.
|
||||
@BuiltValueField(wireName: r'replyCount')
|
||||
int? get replyCount;
|
||||
|
||||
/// Whether the comment was hearted by the video's uploader.
|
||||
@BuiltValueField(wireName: r'hearted')
|
||||
bool? get hearted;
|
||||
|
@ -147,6 +152,13 @@ class _$CommentSerializer implements PrimitiveSerializer<Comment> {
|
|||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.replyCount != null) {
|
||||
yield r'replyCount';
|
||||
yield serializers.serialize(
|
||||
object.replyCount,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.hearted != null) {
|
||||
yield r'hearted';
|
||||
yield serializers.serialize(
|
||||
|
@ -247,6 +259,13 @@ class _$CommentSerializer implements PrimitiveSerializer<Comment> {
|
|||
) as int;
|
||||
result.likeCount = valueDes;
|
||||
break;
|
||||
case r'replyCount':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.replyCount = valueDes;
|
||||
break;
|
||||
case r'hearted':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
|
|
|
@ -24,6 +24,8 @@ class _$Comment extends Comment {
|
|||
@override
|
||||
final int? likeCount;
|
||||
@override
|
||||
final int? replyCount;
|
||||
@override
|
||||
final bool? hearted;
|
||||
@override
|
||||
final bool? pinned;
|
||||
|
@ -42,6 +44,7 @@ class _$Comment extends Comment {
|
|||
this.commentorUrl,
|
||||
this.repliesPage,
|
||||
this.likeCount,
|
||||
this.replyCount,
|
||||
this.hearted,
|
||||
this.pinned,
|
||||
this.verified})
|
||||
|
@ -66,6 +69,7 @@ class _$Comment extends Comment {
|
|||
commentorUrl == other.commentorUrl &&
|
||||
repliesPage == other.repliesPage &&
|
||||
likeCount == other.likeCount &&
|
||||
replyCount == other.replyCount &&
|
||||
hearted == other.hearted &&
|
||||
pinned == other.pinned &&
|
||||
verified == other.verified;
|
||||
|
@ -82,14 +86,16 @@ class _$Comment extends Comment {
|
|||
$jc(
|
||||
$jc(
|
||||
$jc(
|
||||
$jc($jc(0, author.hashCode),
|
||||
thumbnail.hashCode),
|
||||
commentId.hashCode),
|
||||
commentText.hashCode),
|
||||
commentedTime.hashCode),
|
||||
commentorUrl.hashCode),
|
||||
repliesPage.hashCode),
|
||||
likeCount.hashCode),
|
||||
$jc(
|
||||
$jc($jc(0, author.hashCode),
|
||||
thumbnail.hashCode),
|
||||
commentId.hashCode),
|
||||
commentText.hashCode),
|
||||
commentedTime.hashCode),
|
||||
commentorUrl.hashCode),
|
||||
repliesPage.hashCode),
|
||||
likeCount.hashCode),
|
||||
replyCount.hashCode),
|
||||
hearted.hashCode),
|
||||
pinned.hashCode),
|
||||
verified.hashCode));
|
||||
|
@ -106,6 +112,7 @@ class _$Comment extends Comment {
|
|||
..add('commentorUrl', commentorUrl)
|
||||
..add('repliesPage', repliesPage)
|
||||
..add('likeCount', likeCount)
|
||||
..add('replyCount', replyCount)
|
||||
..add('hearted', hearted)
|
||||
..add('pinned', pinned)
|
||||
..add('verified', verified))
|
||||
|
@ -149,6 +156,10 @@ class CommentBuilder implements Builder<Comment, CommentBuilder> {
|
|||
int? get likeCount => _$this._likeCount;
|
||||
set likeCount(int? likeCount) => _$this._likeCount = likeCount;
|
||||
|
||||
int? _replyCount;
|
||||
int? get replyCount => _$this._replyCount;
|
||||
set replyCount(int? replyCount) => _$this._replyCount = replyCount;
|
||||
|
||||
bool? _hearted;
|
||||
bool? get hearted => _$this._hearted;
|
||||
set hearted(bool? hearted) => _$this._hearted = hearted;
|
||||
|
@ -176,6 +187,7 @@ class CommentBuilder implements Builder<Comment, CommentBuilder> {
|
|||
_commentorUrl = $v.commentorUrl;
|
||||
_repliesPage = $v.repliesPage;
|
||||
_likeCount = $v.likeCount;
|
||||
_replyCount = $v.replyCount;
|
||||
_hearted = $v.hearted;
|
||||
_pinned = $v.pinned;
|
||||
_verified = $v.verified;
|
||||
|
@ -209,6 +221,7 @@ class CommentBuilder implements Builder<Comment, CommentBuilder> {
|
|||
commentorUrl: commentorUrl,
|
||||
repliesPage: repliesPage,
|
||||
likeCount: likeCount,
|
||||
replyCount: replyCount,
|
||||
hearted: hearted,
|
||||
pinned: pinned,
|
||||
verified: verified);
|
||||
|
|
|
@ -50,6 +50,10 @@ part 'serializers.g.dart';
|
|||
VideoInfo,
|
||||
])
|
||||
Serializers serializers = (_$serializers.toBuilder()
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, [FullType(String)]),
|
||||
() => ListBuilder<String>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
() => ListBuilder<StreamItem>(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue