Update to latest openapi code.

This commit is contained in:
Kavin 2023-06-09 19:59:12 +01:00
parent fd20ae95b1
commit 26f755fc52
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
49 changed files with 1224 additions and 452 deletions

View File

@ -53,7 +53,3 @@ lib/src/model/subtitle.dart
lib/src/model/video_info.dart lib/src/model/video_info.dart
lib/src/serializers.dart lib/src/serializers.dart
pubspec.yaml pubspec.yaml
test/channel_api_test.dart
test/feed_api_test.dart
test/search_api_test.dart
test/video_api_test.dart

View File

@ -1 +1 @@
6.2.0 6.6.0

View File

@ -9,8 +9,8 @@ For more information, please visit [https://github.com/TeamPiped/Piped/issues](h
## Requirements ## Requirements
* Dart 2.12.0 or later OR Flutter 1.26.0 or later * Dart 2.15.0+ or Flutter 2.8.0+
* Dio 4.0.0+ * Dio 5.0.0+ (https://pub.dev/packages/dio)
## Installation & Usage ## Installation & Usage
@ -109,7 +109,7 @@ Class | Method | HTTP request | Description
## Documentation For Authorization ## Documentation For Authorization
All endpoints do not require authorization. Endpoints do not require authorization.
## Author ## Author

View File

@ -7,3 +7,5 @@ analyzer:
implicit-casts: false implicit-casts: false
exclude: exclude:
- test/*.dart - test/*.dart
errors:
deprecated_member_use_from_same_package: ignore

View File

@ -8,6 +8,7 @@ import 'package:piped_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**type** | **String** | The type of the channel item. Always channel. | [optional]
**description** | **String** | The description of the channel. | [optional] **description** | **String** | The description of the channel. | [optional]
**name** | **String** | The name of the channel. | [optional] **name** | **String** | The name of the channel. | [optional]
**subscribers** | **int** | The number of subscribers the channel has. | [optional] **subscribers** | **int** | The number of subscribers the channel has. | [optional]

33
doc/ContentItem.md Normal file
View File

@ -0,0 +1,33 @@
# piped_api.model.ContentItem
## Load the model package
```dart
import 'package:piped_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **String** | The type of the content item. |
**duration** | **int** | The duration of the video in seconds. |
**thumbnail** | **String** | The thumbnail of the playlist. |
**title** | **String** | The title of the video. |
**uploaded** | **int** | The date in unix epoch the video was uploaded. | [optional]
**uploadedDate** | **String** | The relative date the video was uploaded on. | [optional]
**uploaderAvatar** | **String** | The avatar of the channel of the video. | [optional]
**uploaderName** | **String** | The name of the channel of the video. | [optional]
**uploaderUrl** | **String** | The relative URL of the channel of the video. | [optional]
**uploaderVerified** | **bool** | Whether or not the channel has a verified badge. | [optional]
**url** | **String** | The relative URL of the playlist. |
**views** | **int** | The number of views the video has. | [optional]
**isShort** | **bool** | Whether or not the video is a short video. | [optional]
**shortDescription** | **String** | The short description of the video. | [optional]
**description** | **String** | The description of the channel. | [optional]
**name** | **String** | The name of the playlist. | [optional]
**subscribers** | **int** | The number of subscribers the channel has. | [optional]
**verified** | **bool** | Whether the channel is verified. | [optional]
**videos** | **int** | The number of videos in the playlist. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -8,6 +8,7 @@ import 'package:piped_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**type** | **String** | The type of the playlist item. Always playlist. | [optional]
**name** | **String** | The name of the playlist. | [optional] **name** | **String** | The name of the playlist. | [optional]
**thumbnail** | **String** | The thumbnail of the playlist. | [optional] **thumbnail** | **String** | The thumbnail of the playlist. | [optional]
**url** | **String** | The relative URL of the playlist. | [optional] **url** | **String** | The relative URL of the playlist. | [optional]

View File

@ -8,6 +8,7 @@ import 'package:piped_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**type** | **String** | The type of the playlist item. Always playlist. | [optional]
**duration** | **int** | The duration of the video in seconds. | **duration** | **int** | The duration of the video in seconds. |
**thumbnail** | **String** | The thumbnail of the playlist. | **thumbnail** | **String** | The thumbnail of the playlist. |
**title** | **String** | The title of the video. | **title** | **String** | The title of the video. |
@ -19,6 +20,8 @@ Name | Type | Description | Notes
**uploaderVerified** | **bool** | Whether or not the channel has a verified badge. | [optional] **uploaderVerified** | **bool** | Whether or not the channel has a verified badge. | [optional]
**url** | **String** | The relative URL of the playlist. | **url** | **String** | The relative URL of the playlist. |
**views** | **int** | The number of views the video has. | [optional] **views** | **int** | The number of views the video has. | [optional]
**isShort** | **bool** | Whether or not the video is a short video. | [optional]
**shortDescription** | **String** | The short description of the video. | [optional]
**description** | **String** | The description of the channel. | [optional] **description** | **String** | The description of the channel. | [optional]
**name** | **String** | The name of the playlist. | [optional] **name** | **String** | The name of the playlist. | [optional]
**subscribers** | **int** | The number of subscribers the channel has. | [optional] **subscribers** | **int** | The number of subscribers the channel has. | [optional]

View File

@ -8,6 +8,7 @@ import 'package:piped_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**type** | **String** | The type of the stream item. Always stream. | [optional]
**duration** | **int** | The duration of the video in seconds. | **duration** | **int** | The duration of the video in seconds. |
**thumbnail** | **String** | The thumbnail of the video. | **thumbnail** | **String** | The thumbnail of the video. |
**title** | **String** | The title of the video. | **title** | **String** | The title of the video. |
@ -19,6 +20,8 @@ Name | Type | Description | Notes
**uploaderVerified** | **bool** | Whether or not the channel has a verified badge. | [optional] **uploaderVerified** | **bool** | Whether or not the channel has a verified badge. | [optional]
**url** | **String** | The relative URL to the video. | **url** | **String** | The relative URL to the video. |
**views** | **int** | The number of views the video has. | [optional] **views** | **int** | The number of views the video has. | [optional]
**isShort** | **bool** | Whether or not the video is a short video. | [optional]
**shortDescription** | **String** | The short description of the video. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -66,22 +66,18 @@ class _$ChannelInfo extends ChannelInfo {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, avatarUrl.hashCode);
$jc( _$hash = $jc(_$hash, bannerUrl.hashCode);
$jc( _$hash = $jc(_$hash, description.hashCode);
$jc( _$hash = $jc(_$hash, id.hashCode);
$jc( _$hash = $jc(_$hash, name.hashCode);
$jc( _$hash = $jc(_$hash, nextpage.hashCode);
$jc($jc(0, avatarUrl.hashCode), _$hash = $jc(_$hash, relatedStreams.hashCode);
bannerUrl.hashCode), _$hash = $jc(_$hash, subscriberCount.hashCode);
description.hashCode), _$hash = $jc(_$hash, verified.hashCode);
id.hashCode), _$hash = $jf(_$hash);
name.hashCode), return _$hash;
nextpage.hashCode),
relatedStreams.hashCode),
subscriberCount.hashCode),
verified.hashCode));
} }
@override @override
@ -207,4 +203,4 @@ class ChannelInfoBuilder implements Builder<ChannelInfo, ChannelInfoBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -40,7 +40,11 @@ class _$ExceptionError extends ExceptionError {
@override @override
int get hashCode { int get hashCode {
return $jf($jc($jc(0, error.hashCode), message.hashCode)); var _$hash = 0;
_$hash = $jc(_$hash, error.hashCode);
_$hash = $jc(_$hash, message.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -104,4 +108,4 @@ class ExceptionErrorBuilder
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -803,4 +803,4 @@ class _$RegionsSerializer implements PrimitiveSerializer<Regions> {
_fromWire[serialized] ?? (serialized is String ? serialized : '')); _fromWire[serialized] ?? (serialized is String ? serialized : ''));
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -159,32 +159,23 @@ class _$Stream extends Stream {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, url.hashCode);
$jc( _$hash = $jc(_$hash, format.hashCode);
$jc( _$hash = $jc(_$hash, quality.hashCode);
$jc( _$hash = $jc(_$hash, mimeType.hashCode);
$jc( _$hash = $jc(_$hash, codec.hashCode);
$jc( _$hash = $jc(_$hash, videoOnly.hashCode);
$jc( _$hash = $jc(_$hash, bitrate.hashCode);
$jc( _$hash = $jc(_$hash, initStart.hashCode);
$jc( _$hash = $jc(_$hash, initEnd.hashCode);
$jc( _$hash = $jc(_$hash, indexStart.hashCode);
$jc( _$hash = $jc(_$hash, indexEnd.hashCode);
$jc($jc(0, url.hashCode), _$hash = $jc(_$hash, width.hashCode);
format.hashCode), _$hash = $jc(_$hash, height.hashCode);
quality.hashCode), _$hash = $jc(_$hash, fps.hashCode);
mimeType.hashCode), _$hash = $jf(_$hash);
codec.hashCode), return _$hash;
videoOnly.hashCode),
bitrate.hashCode),
initStart.hashCode),
initEnd.hashCode),
indexStart.hashCode),
indexEnd.hashCode),
width.hashCode),
height.hashCode),
fps.hashCode));
} }
@override @override
@ -329,4 +320,4 @@ class StreamBuilder implements Builder<Stream, StreamBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -80,26 +80,20 @@ class _$StreamItem extends StreamItem {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, duration.hashCode);
$jc( _$hash = $jc(_$hash, thumbnail.hashCode);
$jc( _$hash = $jc(_$hash, title.hashCode);
$jc( _$hash = $jc(_$hash, uploaded.hashCode);
$jc( _$hash = $jc(_$hash, uploadedDate.hashCode);
$jc( _$hash = $jc(_$hash, uploaderAvatar.hashCode);
$jc( _$hash = $jc(_$hash, uploaderName.hashCode);
$jc( _$hash = $jc(_$hash, uploaderUrl.hashCode);
$jc($jc(0, duration.hashCode), _$hash = $jc(_$hash, uploaderVerified.hashCode);
thumbnail.hashCode), _$hash = $jc(_$hash, url.hashCode);
title.hashCode), _$hash = $jc(_$hash, views.hashCode);
uploaded.hashCode), _$hash = $jf(_$hash);
uploadedDate.hashCode), return _$hash;
uploaderAvatar.hashCode),
uploaderName.hashCode),
uploaderUrl.hashCode),
uploaderVerified.hashCode),
url.hashCode),
views.hashCode));
} }
@override @override
@ -229,4 +223,4 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -35,7 +35,11 @@ class _$StreamsPage extends StreamsPage {
@override @override
int get hashCode { int get hashCode {
return $jf($jc($jc(0, relatedStreams.hashCode), nextpage.hashCode)); var _$hash = 0;
_$hash = $jc(_$hash, relatedStreams.hashCode);
_$hash = $jc(_$hash, nextpage.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -110,4 +114,4 @@ class StreamsPageBuilder implements Builder<StreamsPage, StreamsPageBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -42,10 +42,13 @@ class _$Subtitle extends Subtitle {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc($jc($jc(0, autoGenerated.hashCode), code.hashCode), _$hash = $jc(_$hash, autoGenerated.hashCode);
mimeType.hashCode), _$hash = $jc(_$hash, code.hashCode);
url.hashCode)); _$hash = $jc(_$hash, mimeType.hashCode);
_$hash = $jc(_$hash, url.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -121,4 +124,4 @@ class SubtitleBuilder implements Builder<Subtitle, SubtitleBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -110,44 +110,29 @@ class _$VideoInfo extends VideoInfo {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, audioStreams.hashCode);
$jc( _$hash = $jc(_$hash, videoStreams.hashCode);
$jc( _$hash = $jc(_$hash, description.hashCode);
$jc( _$hash = $jc(_$hash, dislikes.hashCode);
$jc( _$hash = $jc(_$hash, duration.hashCode);
$jc( _$hash = $jc(_$hash, hls.hashCode);
$jc( _$hash = $jc(_$hash, lbryId.hashCode);
$jc( _$hash = $jc(_$hash, likes.hashCode);
$jc( _$hash = $jc(_$hash, livestream.hashCode);
$jc( _$hash = $jc(_$hash, proxyUrl.hashCode);
$jc( _$hash = $jc(_$hash, subtitles.hashCode);
$jc( _$hash = $jc(_$hash, dash.hashCode);
$jc( _$hash = $jc(_$hash, thumbnailUrl.hashCode);
$jc( _$hash = $jc(_$hash, title.hashCode);
$jc( _$hash = $jc(_$hash, uploadDate.hashCode);
$jc( _$hash = $jc(_$hash, uploader.hashCode);
$jc( _$hash = $jc(_$hash, uploaderAvatar.hashCode);
$jc($jc(0, audioStreams.hashCode), _$hash = $jc(_$hash, uploaderUrl.hashCode);
videoStreams.hashCode), _$hash = $jc(_$hash, uploaderVerified.hashCode);
description.hashCode), _$hash = $jc(_$hash, relatedStreams.hashCode);
dislikes.hashCode), _$hash = $jf(_$hash);
duration.hashCode), return _$hash;
hls.hashCode),
lbryId.hashCode),
likes.hashCode),
livestream.hashCode),
proxyUrl.hashCode),
subtitles.hashCode),
dash.hashCode),
thumbnailUrl.hashCode),
title.hashCode),
uploadDate.hashCode),
uploader.hashCode),
uploaderAvatar.hashCode),
uploaderUrl.hashCode),
uploaderVerified.hashCode),
relatedStreams.hashCode));
} }
@override @override
@ -365,4 +350,4 @@ class VideoInfoBuilder implements Builder<VideoInfo, VideoInfoBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -37,4 +37,4 @@ Serializers _$serializers = (new Serializers().toBuilder()
() => new ListBuilder<StreamItem>())) () => new ListBuilder<StreamItem>()))
.build(); .build();
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -30,8 +30,8 @@ class PipedApi {
this.dio = dio ?? this.dio = dio ??
Dio(BaseOptions( Dio(BaseOptions(
baseUrl: basePathOverride ?? basePath, baseUrl: basePathOverride ?? basePath,
connectTimeout: 5000, connectTimeout: const Duration(milliseconds: 5000),
receiveTimeout: 3000, receiveTimeout: const Duration(milliseconds: 3000),
)) { )) {
if (interceptors == null) { if (interceptors == null) {
this.dio.interceptors.addAll([ this.dio.interceptors.addAll([

View File

@ -64,22 +64,23 @@ class ChannelApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -138,22 +139,23 @@ class ChannelApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -212,22 +214,23 @@ class ChannelApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -293,22 +296,23 @@ class ChannelApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
StreamsPage _responseData; StreamsPage? _responseData;
try { try {
const _responseType = FullType(StreamsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(StreamsPage),
) as StreamsPage; ) as StreamsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<StreamsPage>( return Response<StreamsPage>(

View File

@ -69,22 +69,23 @@ class FeedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
BuiltList<StreamItem> _responseData; BuiltList<StreamItem>? _responseData;
try { try {
const _responseType = FullType(BuiltList, [FullType(StreamItem)]); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
) as BuiltList<StreamItem>; ) as BuiltList<StreamItem>;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<BuiltList<StreamItem>>( return Response<BuiltList<StreamItem>>(

View File

@ -72,22 +72,23 @@ class SearchApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
SearchPage _responseData; SearchPage? _responseData;
try { try {
const _responseType = FullType(SearchPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(SearchPage),
) as SearchPage; ) as SearchPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<SearchPage>( return Response<SearchPage>(
@ -157,22 +158,23 @@ class SearchApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
SearchPage _responseData; SearchPage? _responseData;
try { try {
const _responseType = FullType(SearchPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(SearchPage),
) as SearchPage; ) as SearchPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<SearchPage>( return Response<SearchPage>(

View File

@ -71,22 +71,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -145,22 +146,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -219,22 +221,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
ChannelInfo _responseData; ChannelInfo? _responseData;
try { try {
const _responseType = FullType(ChannelInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(ChannelInfo),
) as ChannelInfo; ) as ChannelInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<ChannelInfo>( return Response<ChannelInfo>(
@ -300,22 +303,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
StreamsPage _responseData; StreamsPage? _responseData;
try { try {
const _responseType = FullType(StreamsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(StreamsPage),
) as StreamsPage; ) as StreamsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<StreamsPage>( return Response<StreamsPage>(
@ -374,22 +378,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
CommentsPage _responseData; CommentsPage? _responseData;
try { try {
const _responseType = FullType(CommentsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(CommentsPage),
) as CommentsPage; ) as CommentsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<CommentsPage>( return Response<CommentsPage>(
@ -455,22 +460,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
CommentsPage _responseData; CommentsPage? _responseData;
try { try {
const _responseType = FullType(CommentsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(CommentsPage),
) as CommentsPage; ) as CommentsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<CommentsPage>( return Response<CommentsPage>(
@ -534,22 +540,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
BuiltList<StreamItem> _responseData; BuiltList<StreamItem>? _responseData;
try { try {
const _responseType = FullType(BuiltList, [FullType(StreamItem)]); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
) as BuiltList<StreamItem>; ) as BuiltList<StreamItem>;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<BuiltList<StreamItem>>( return Response<BuiltList<StreamItem>>(
@ -616,22 +623,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
SearchPage _responseData; SearchPage? _responseData;
try { try {
const _responseType = FullType(SearchPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(SearchPage),
) as SearchPage; ) as SearchPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<SearchPage>( return Response<SearchPage>(
@ -701,22 +709,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
SearchPage _responseData; SearchPage? _responseData;
try { try {
const _responseType = FullType(SearchPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(SearchPage),
) as SearchPage; ) as SearchPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<SearchPage>( return Response<SearchPage>(
@ -775,22 +784,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
VideoInfo _responseData; VideoInfo? _responseData;
try { try {
const _responseType = FullType(VideoInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(VideoInfo),
) as VideoInfo; ) as VideoInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<VideoInfo>( return Response<VideoInfo>(
@ -854,22 +864,23 @@ class UnauthenticatedApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
BuiltList<StreamItem> _responseData; BuiltList<StreamItem>? _responseData;
try { try {
const _responseType = FullType(BuiltList, [FullType(StreamItem)]); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
) as BuiltList<StreamItem>; ) as BuiltList<StreamItem>;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<BuiltList<StreamItem>>( return Response<BuiltList<StreamItem>>(

View File

@ -64,22 +64,23 @@ class VideoApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
CommentsPage _responseData; CommentsPage? _responseData;
try { try {
const _responseType = FullType(CommentsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(CommentsPage),
) as CommentsPage; ) as CommentsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<CommentsPage>( return Response<CommentsPage>(
@ -145,22 +146,23 @@ class VideoApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
CommentsPage _responseData; CommentsPage? _responseData;
try { try {
const _responseType = FullType(CommentsPage); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(CommentsPage),
) as CommentsPage; ) as CommentsPage;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<CommentsPage>( return Response<CommentsPage>(
@ -219,22 +221,23 @@ class VideoApi {
onReceiveProgress: onReceiveProgress, onReceiveProgress: onReceiveProgress,
); );
VideoInfo _responseData; VideoInfo? _responseData;
try { try {
const _responseType = FullType(VideoInfo); final rawResponse = _response.data;
_responseData = _serializers.deserialize( _responseData = rawResponse == null ? null : _serializers.deserialize(
_response.data!, rawResponse,
specifiedType: _responseType, specifiedType: const FullType(VideoInfo),
) as VideoInfo; ) as VideoInfo;
} catch (error, stackTrace) { } catch (error, stackTrace) {
throw DioError( throw DioError(
requestOptions: _response.requestOptions, requestOptions: _response.requestOptions,
response: _response, response: _response,
type: DioErrorType.other, type: DioErrorType.unknown,
error: error, error: error,
)..stackTrace = stackTrace; stackTrace: stackTrace,
);
} }
return Response<VideoInfo>( return Response<VideoInfo>(

View File

@ -65,22 +65,18 @@ class _$ChannelInfo extends ChannelInfo {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, avatarUrl.hashCode);
$jc( _$hash = $jc(_$hash, bannerUrl.hashCode);
$jc( _$hash = $jc(_$hash, description.hashCode);
$jc( _$hash = $jc(_$hash, id.hashCode);
$jc( _$hash = $jc(_$hash, name.hashCode);
$jc( _$hash = $jc(_$hash, nextpage.hashCode);
$jc($jc(0, avatarUrl.hashCode), _$hash = $jc(_$hash, relatedStreams.hashCode);
bannerUrl.hashCode), _$hash = $jc(_$hash, subscriberCount.hashCode);
description.hashCode), _$hash = $jc(_$hash, verified.hashCode);
id.hashCode), _$hash = $jf(_$hash);
name.hashCode), return _$hash;
nextpage.hashCode),
relatedStreams.hashCode),
subscriberCount.hashCode),
verified.hashCode));
} }
@override @override
@ -206,4 +202,4 @@ class ChannelInfoBuilder implements Builder<ChannelInfo, ChannelInfoBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -11,6 +11,7 @@ part 'channel_item.g.dart';
/// ChannelItem /// ChannelItem
/// ///
/// Properties: /// Properties:
/// * [type] - The type of the channel item. Always channel.
/// * [description] - The description of the channel. /// * [description] - The description of the channel.
/// * [name] - The name of the channel. /// * [name] - The name of the channel.
/// * [subscribers] - The number of subscribers the channel has. /// * [subscribers] - The number of subscribers the channel has.
@ -20,6 +21,10 @@ part 'channel_item.g.dart';
/// * [videos] - The number of videos the channel has. /// * [videos] - The number of videos the channel has.
@BuiltValue() @BuiltValue()
abstract class ChannelItem implements Built<ChannelItem, ChannelItemBuilder> { abstract class ChannelItem implements Built<ChannelItem, ChannelItemBuilder> {
/// The type of the channel item. Always channel.
@BuiltValueField(wireName: r'type')
String? get type;
/// The description of the channel. /// The description of the channel.
@BuiltValueField(wireName: r'description') @BuiltValueField(wireName: r'description')
String? get description; String? get description;
@ -71,6 +76,13 @@ class _$ChannelItemSerializer implements PrimitiveSerializer<ChannelItem> {
ChannelItem object, { ChannelItem object, {
FullType specifiedType = FullType.unspecified, FullType specifiedType = FullType.unspecified,
}) sync* { }) sync* {
if (object.type != null) {
yield r'type';
yield serializers.serialize(
object.type,
specifiedType: const FullType(String),
);
}
if (object.description != null) { if (object.description != null) {
yield r'description'; yield r'description';
yield serializers.serialize( yield serializers.serialize(
@ -143,6 +155,13 @@ class _$ChannelItemSerializer implements PrimitiveSerializer<ChannelItem> {
final key = serializedList[i] as String; final key = serializedList[i] as String;
final value = serializedList[i + 1]; final value = serializedList[i + 1];
switch (key) { switch (key) {
case r'type':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(String),
) as String;
result.type = valueDes;
break;
case r'description': case r'description':
final valueDes = serializers.deserialize( final valueDes = serializers.deserialize(
value, value,

View File

@ -7,6 +7,8 @@ part of 'channel_item.dart';
// ************************************************************************** // **************************************************************************
class _$ChannelItem extends ChannelItem { class _$ChannelItem extends ChannelItem {
@override
final String? type;
@override @override
final String? description; final String? description;
@override @override
@ -26,7 +28,8 @@ class _$ChannelItem extends ChannelItem {
(new ChannelItemBuilder()..update(updates))._build(); (new ChannelItemBuilder()..update(updates))._build();
_$ChannelItem._( _$ChannelItem._(
{this.description, {this.type,
this.description,
this.name, this.name,
this.subscribers, this.subscribers,
this.thumbnail, this.thumbnail,
@ -46,6 +49,7 @@ class _$ChannelItem extends ChannelItem {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
return other is ChannelItem && return other is ChannelItem &&
type == other.type &&
description == other.description && description == other.description &&
name == other.name && name == other.name &&
subscribers == other.subscribers && subscribers == other.subscribers &&
@ -57,21 +61,23 @@ class _$ChannelItem extends ChannelItem {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, type.hashCode);
$jc( _$hash = $jc(_$hash, description.hashCode);
$jc( _$hash = $jc(_$hash, name.hashCode);
$jc($jc($jc(0, description.hashCode), name.hashCode), _$hash = $jc(_$hash, subscribers.hashCode);
subscribers.hashCode), _$hash = $jc(_$hash, thumbnail.hashCode);
thumbnail.hashCode), _$hash = $jc(_$hash, url.hashCode);
url.hashCode), _$hash = $jc(_$hash, verified.hashCode);
verified.hashCode), _$hash = $jc(_$hash, videos.hashCode);
videos.hashCode)); _$hash = $jf(_$hash);
return _$hash;
} }
@override @override
String toString() { String toString() {
return (newBuiltValueToStringHelper(r'ChannelItem') return (newBuiltValueToStringHelper(r'ChannelItem')
..add('type', type)
..add('description', description) ..add('description', description)
..add('name', name) ..add('name', name)
..add('subscribers', subscribers) ..add('subscribers', subscribers)
@ -86,6 +92,10 @@ class _$ChannelItem extends ChannelItem {
class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> { class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> {
_$ChannelItem? _$v; _$ChannelItem? _$v;
String? _type;
String? get type => _$this._type;
set type(String? type) => _$this._type = type;
String? _description; String? _description;
String? get description => _$this._description; String? get description => _$this._description;
set description(String? description) => _$this._description = description; set description(String? description) => _$this._description = description;
@ -121,6 +131,7 @@ class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> {
ChannelItemBuilder get _$this { ChannelItemBuilder get _$this {
final $v = _$v; final $v = _$v;
if ($v != null) { if ($v != null) {
_type = $v.type;
_description = $v.description; _description = $v.description;
_name = $v.name; _name = $v.name;
_subscribers = $v.subscribers; _subscribers = $v.subscribers;
@ -150,6 +161,7 @@ class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> {
_$ChannelItem _build() { _$ChannelItem _build() {
final _$result = _$v ?? final _$result = _$v ??
new _$ChannelItem._( new _$ChannelItem._(
type: type,
description: description, description: description,
name: name, name: name,
subscribers: subscribers, subscribers: subscribers,
@ -162,4 +174,4 @@ class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -77,28 +77,21 @@ class _$Comment extends Comment {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, author.hashCode);
$jc( _$hash = $jc(_$hash, thumbnail.hashCode);
$jc( _$hash = $jc(_$hash, commentId.hashCode);
$jc( _$hash = $jc(_$hash, commentText.hashCode);
$jc( _$hash = $jc(_$hash, commentedTime.hashCode);
$jc( _$hash = $jc(_$hash, commentorUrl.hashCode);
$jc( _$hash = $jc(_$hash, repliesPage.hashCode);
$jc( _$hash = $jc(_$hash, likeCount.hashCode);
$jc( _$hash = $jc(_$hash, replyCount.hashCode);
$jc($jc(0, author.hashCode), _$hash = $jc(_$hash, hearted.hashCode);
thumbnail.hashCode), _$hash = $jc(_$hash, pinned.hashCode);
commentId.hashCode), _$hash = $jc(_$hash, verified.hashCode);
commentText.hashCode), _$hash = $jf(_$hash);
commentedTime.hashCode), return _$hash;
commentorUrl.hashCode),
repliesPage.hashCode),
likeCount.hashCode),
replyCount.hashCode),
hearted.hashCode),
pinned.hashCode),
verified.hashCode));
} }
@override @override
@ -230,4 +223,4 @@ class CommentBuilder implements Builder<Comment, CommentBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -37,8 +37,12 @@ class _$CommentsPage extends CommentsPage {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc($jc(0, comments.hashCode), nextpage.hashCode), disabled.hashCode)); _$hash = $jc(_$hash, comments.hashCode);
_$hash = $jc(_$hash, nextpage.hashCode);
_$hash = $jc(_$hash, disabled.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -121,4 +125,4 @@ class CommentsPageBuilder
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -0,0 +1,227 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:piped_api/src/model/stream_item.dart';
import 'package:built_collection/built_collection.dart';
import 'package:piped_api/src/model/channel_item.dart';
import 'package:piped_api/src/model/playlist_item.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:one_of/one_of.dart';
part 'content_item.g.dart';
/// ContentItem
///
/// Properties:
/// * [type] - The type of the content item.
/// * [duration] - The duration of the video in seconds.
/// * [thumbnail] - The thumbnail of the playlist.
/// * [title] - The title of the video.
/// * [uploaded] - The date in unix epoch the video was uploaded.
/// * [uploadedDate] - The relative date the video was uploaded on.
/// * [uploaderAvatar] - The avatar of the channel of the video.
/// * [uploaderName] - The name of the channel of the video.
/// * [uploaderUrl] - The relative URL of the channel of the video.
/// * [uploaderVerified] - Whether or not the channel has a verified badge.
/// * [url] - The relative URL of the playlist.
/// * [views] - The number of views the video has.
/// * [isShort] - Whether or not the video is a short video.
/// * [shortDescription] - The short description of the video.
/// * [description] - The description of the channel.
/// * [name] - The name of the playlist.
/// * [subscribers] - The number of subscribers the channel has.
/// * [verified] - Whether the channel is verified.
/// * [videos] - The number of videos in the playlist.
@BuiltValue()
abstract class ContentItem implements Built<ContentItem, ContentItemBuilder> {
/// The type of the content item.
@BuiltValueField(wireName: r'type')
ContentItemTypeEnum get type;
// enum typeEnum { stream, channel, playlist, };
/// One Of [ChannelItem], [PlaylistItem], [StreamItem]
OneOf get oneOf;
static const String discriminatorFieldName = r'type';
static const Map<String, Type> discriminatorMapping = {
r'channel': ChannelItem,
r'playlist': PlaylistItem,
r'stream': StreamItem,
};
ContentItem._();
factory ContentItem([void updates(ContentItemBuilder b)]) = _$ContentItem;
@BuiltValueHook(initializeBuilder: true)
static void _defaults(ContentItemBuilder b) => b;
@BuiltValueSerializer(custom: true)
static Serializer<ContentItem> get serializer => _$ContentItemSerializer();
}
extension ContentItemDiscriminatorExt on ContentItem {
String? get discriminatorValue {
if (this is ChannelItem) {
return r'channel';
}
if (this is PlaylistItem) {
return r'playlist';
}
if (this is StreamItem) {
return r'stream';
}
return null;
}
}
extension ContentItemBuilderDiscriminatorExt on ContentItemBuilder {
String? get discriminatorValue {
if (this is ChannelItemBuilder) {
return r'channel';
}
if (this is PlaylistItemBuilder) {
return r'playlist';
}
if (this is StreamItemBuilder) {
return r'stream';
}
return null;
}
}
class _$ContentItemSerializer implements PrimitiveSerializer<ContentItem> {
@override
final Iterable<Type> types = const [ContentItem, _$ContentItem];
@override
final String wireName = r'ContentItem';
Iterable<Object?> _serializeProperties(
Serializers serializers,
ContentItem object, {
FullType specifiedType = FullType.unspecified,
}) sync* {
yield r'type';
yield serializers.serialize(
object.type,
specifiedType: const FullType(ContentItemTypeEnum),
);
}
@override
Object serialize(
Serializers serializers,
ContentItem object, {
FullType specifiedType = FullType.unspecified,
}) {
final oneOf = object.oneOf;
final result = _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
result.addAll(serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType)) as Iterable<Object?>);
return result;
}
void _deserializeProperties(
Serializers serializers,
Object serialized, {
FullType specifiedType = FullType.unspecified,
required List<Object?> serializedList,
required ContentItemBuilder result,
required List<Object?> unhandled,
}) {
for (var i = 0; i < serializedList.length; i += 2) {
final key = serializedList[i] as String;
final value = serializedList[i + 1];
switch (key) {
case r'type':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(ContentItemTypeEnum),
) as ContentItemTypeEnum;
result.type = valueDes;
break;
default:
unhandled.add(key);
unhandled.add(value);
break;
}
}
}
@override
ContentItem deserialize(
Serializers serializers,
Object serialized, {
FullType specifiedType = FullType.unspecified,
}) {
final result = ContentItemBuilder();
Object? oneOfDataSrc;
final serializedList = (serialized as Iterable<Object?>).toList();
final discIndex = serializedList.indexOf(ContentItem.discriminatorFieldName) + 1;
final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
final unhandled = <Object?>[];
_deserializeProperties(
serializers,
serialized,
specifiedType: specifiedType,
serializedList: serializedList,
unhandled: unhandled,
result: result
);
oneOfDataSrc = unhandled;
final oneOfTypes = [ChannelItem, PlaylistItem, StreamItem, ];
Object oneOfResult;
Type oneOfType;
switch (discValue) {
case r'channel':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(ChannelItem),
) as ChannelItem;
oneOfType = ChannelItem;
break;
case r'playlist':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(PlaylistItem),
) as PlaylistItem;
oneOfType = PlaylistItem;
break;
case r'stream':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(StreamItem),
) as StreamItem;
oneOfType = StreamItem;
break;
default:
throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}");
}
result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult);
return result.build();
}
}
class ContentItemTypeEnum extends EnumClass {
/// The type of the content item.
@BuiltValueEnumConst(wireName: r'stream')
static const ContentItemTypeEnum stream = _$contentItemTypeEnum_stream;
/// The type of the content item.
@BuiltValueEnumConst(wireName: r'channel')
static const ContentItemTypeEnum channel = _$contentItemTypeEnum_channel;
/// The type of the content item.
@BuiltValueEnumConst(wireName: r'playlist')
static const ContentItemTypeEnum playlist = _$contentItemTypeEnum_playlist;
static Serializer<ContentItemTypeEnum> get serializer => _$contentItemTypeEnumSerializer;
const ContentItemTypeEnum._(String name): super(name);
static BuiltSet<ContentItemTypeEnum> get values => _$contentItemTypeEnumValues;
static ContentItemTypeEnum valueOf(String name) => _$contentItemTypeEnumValueOf(name);
}

View File

@ -0,0 +1,165 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'content_item.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
const ContentItemTypeEnum _$contentItemTypeEnum_stream =
const ContentItemTypeEnum._('stream');
const ContentItemTypeEnum _$contentItemTypeEnum_channel =
const ContentItemTypeEnum._('channel');
const ContentItemTypeEnum _$contentItemTypeEnum_playlist =
const ContentItemTypeEnum._('playlist');
ContentItemTypeEnum _$contentItemTypeEnumValueOf(String name) {
switch (name) {
case 'stream':
return _$contentItemTypeEnum_stream;
case 'channel':
return _$contentItemTypeEnum_channel;
case 'playlist':
return _$contentItemTypeEnum_playlist;
default:
throw new ArgumentError(name);
}
}
final BuiltSet<ContentItemTypeEnum> _$contentItemTypeEnumValues =
new BuiltSet<ContentItemTypeEnum>(const <ContentItemTypeEnum>[
_$contentItemTypeEnum_stream,
_$contentItemTypeEnum_channel,
_$contentItemTypeEnum_playlist,
]);
Serializer<ContentItemTypeEnum> _$contentItemTypeEnumSerializer =
new _$ContentItemTypeEnumSerializer();
class _$ContentItemTypeEnumSerializer
implements PrimitiveSerializer<ContentItemTypeEnum> {
static const Map<String, Object> _toWire = const <String, Object>{
'stream': 'stream',
'channel': 'channel',
'playlist': 'playlist',
};
static const Map<Object, String> _fromWire = const <Object, String>{
'stream': 'stream',
'channel': 'channel',
'playlist': 'playlist',
};
@override
final Iterable<Type> types = const <Type>[ContentItemTypeEnum];
@override
final String wireName = 'ContentItemTypeEnum';
@override
Object serialize(Serializers serializers, ContentItemTypeEnum object,
{FullType specifiedType = FullType.unspecified}) =>
_toWire[object.name] ?? object.name;
@override
ContentItemTypeEnum deserialize(Serializers serializers, Object serialized,
{FullType specifiedType = FullType.unspecified}) =>
ContentItemTypeEnum.valueOf(
_fromWire[serialized] ?? (serialized is String ? serialized : ''));
}
class _$ContentItem extends ContentItem {
@override
final ContentItemTypeEnum type;
@override
final OneOf oneOf;
factory _$ContentItem([void Function(ContentItemBuilder)? updates]) =>
(new ContentItemBuilder()..update(updates))._build();
_$ContentItem._({required this.type, required this.oneOf}) : super._() {
BuiltValueNullFieldError.checkNotNull(type, r'ContentItem', 'type');
BuiltValueNullFieldError.checkNotNull(oneOf, r'ContentItem', 'oneOf');
}
@override
ContentItem rebuild(void Function(ContentItemBuilder) updates) =>
(toBuilder()..update(updates)).build();
@override
ContentItemBuilder toBuilder() => new ContentItemBuilder()..replace(this);
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is ContentItem && type == other.type && oneOf == other.oneOf;
}
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, type.hashCode);
_$hash = $jc(_$hash, oneOf.hashCode);
_$hash = $jf(_$hash);
return _$hash;
}
@override
String toString() {
return (newBuiltValueToStringHelper(r'ContentItem')
..add('type', type)
..add('oneOf', oneOf))
.toString();
}
}
class ContentItemBuilder implements Builder<ContentItem, ContentItemBuilder> {
_$ContentItem? _$v;
ContentItemTypeEnum? _type;
ContentItemTypeEnum? get type => _$this._type;
set type(ContentItemTypeEnum? type) => _$this._type = type;
OneOf? _oneOf;
OneOf? get oneOf => _$this._oneOf;
set oneOf(OneOf? oneOf) => _$this._oneOf = oneOf;
ContentItemBuilder() {
ContentItem._defaults(this);
}
ContentItemBuilder get _$this {
final $v = _$v;
if ($v != null) {
_type = $v.type;
_oneOf = $v.oneOf;
_$v = null;
}
return this;
}
@override
void replace(ContentItem other) {
ArgumentError.checkNotNull(other, 'other');
_$v = other as _$ContentItem;
}
@override
void update(void Function(ContentItemBuilder)? updates) {
if (updates != null) updates(this);
}
@override
ContentItem build() => _build();
_$ContentItem _build() {
final _$result = _$v ??
new _$ContentItem._(
type: BuiltValueNullFieldError.checkNotNull(
type, r'ContentItem', 'type'),
oneOf: BuiltValueNullFieldError.checkNotNull(
oneOf, r'ContentItem', 'oneOf'));
replace(_$result);
return _$result;
}
}
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -39,7 +39,11 @@ class _$ExceptionError extends ExceptionError {
@override @override
int get hashCode { int get hashCode {
return $jf($jc($jc(0, error.hashCode), message.hashCode)); var _$hash = 0;
_$hash = $jc(_$hash, error.hashCode);
_$hash = $jc(_$hash, message.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -103,4 +107,4 @@ class ExceptionErrorBuilder
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -11,12 +11,17 @@ part 'playlist_item.g.dart';
/// PlaylistItem /// PlaylistItem
/// ///
/// Properties: /// Properties:
/// * [type] - The type of the playlist item. Always playlist.
/// * [name] - The name of the playlist. /// * [name] - The name of the playlist.
/// * [thumbnail] - The thumbnail of the playlist. /// * [thumbnail] - The thumbnail of the playlist.
/// * [url] - The relative URL of the playlist. /// * [url] - The relative URL of the playlist.
/// * [videos] - The number of videos in the playlist. /// * [videos] - The number of videos in the playlist.
@BuiltValue() @BuiltValue()
abstract class PlaylistItem implements Built<PlaylistItem, PlaylistItemBuilder> { abstract class PlaylistItem implements Built<PlaylistItem, PlaylistItemBuilder> {
/// The type of the playlist item. Always playlist.
@BuiltValueField(wireName: r'type')
String? get type;
/// The name of the playlist. /// The name of the playlist.
@BuiltValueField(wireName: r'name') @BuiltValueField(wireName: r'name')
String? get name; String? get name;
@ -56,6 +61,13 @@ class _$PlaylistItemSerializer implements PrimitiveSerializer<PlaylistItem> {
PlaylistItem object, { PlaylistItem object, {
FullType specifiedType = FullType.unspecified, FullType specifiedType = FullType.unspecified,
}) sync* { }) sync* {
if (object.type != null) {
yield r'type';
yield serializers.serialize(
object.type,
specifiedType: const FullType(String),
);
}
if (object.name != null) { if (object.name != null) {
yield r'name'; yield r'name';
yield serializers.serialize( yield serializers.serialize(
@ -107,6 +119,13 @@ class _$PlaylistItemSerializer implements PrimitiveSerializer<PlaylistItem> {
final key = serializedList[i] as String; final key = serializedList[i] as String;
final value = serializedList[i + 1]; final value = serializedList[i + 1];
switch (key) { switch (key) {
case r'type':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(String),
) as String;
result.type = valueDes;
break;
case r'name': case r'name':
final valueDes = serializers.deserialize( final valueDes = serializers.deserialize(
value, value,

View File

@ -7,6 +7,8 @@ part of 'playlist_item.dart';
// ************************************************************************** // **************************************************************************
class _$PlaylistItem extends PlaylistItem { class _$PlaylistItem extends PlaylistItem {
@override
final String? type;
@override @override
final String? name; final String? name;
@override @override
@ -19,7 +21,8 @@ class _$PlaylistItem extends PlaylistItem {
factory _$PlaylistItem([void Function(PlaylistItemBuilder)? updates]) => factory _$PlaylistItem([void Function(PlaylistItemBuilder)? updates]) =>
(new PlaylistItemBuilder()..update(updates))._build(); (new PlaylistItemBuilder()..update(updates))._build();
_$PlaylistItem._({this.name, this.thumbnail, this.url, this.videos}) _$PlaylistItem._(
{this.type, this.name, this.thumbnail, this.url, this.videos})
: super._(); : super._();
@override @override
@ -33,6 +36,7 @@ class _$PlaylistItem extends PlaylistItem {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
return other is PlaylistItem && return other is PlaylistItem &&
type == other.type &&
name == other.name && name == other.name &&
thumbnail == other.thumbnail && thumbnail == other.thumbnail &&
url == other.url && url == other.url &&
@ -41,14 +45,20 @@ class _$PlaylistItem extends PlaylistItem {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc($jc($jc(0, name.hashCode), thumbnail.hashCode), url.hashCode), _$hash = $jc(_$hash, type.hashCode);
videos.hashCode)); _$hash = $jc(_$hash, name.hashCode);
_$hash = $jc(_$hash, thumbnail.hashCode);
_$hash = $jc(_$hash, url.hashCode);
_$hash = $jc(_$hash, videos.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
String toString() { String toString() {
return (newBuiltValueToStringHelper(r'PlaylistItem') return (newBuiltValueToStringHelper(r'PlaylistItem')
..add('type', type)
..add('name', name) ..add('name', name)
..add('thumbnail', thumbnail) ..add('thumbnail', thumbnail)
..add('url', url) ..add('url', url)
@ -61,6 +71,10 @@ class PlaylistItemBuilder
implements Builder<PlaylistItem, PlaylistItemBuilder> { implements Builder<PlaylistItem, PlaylistItemBuilder> {
_$PlaylistItem? _$v; _$PlaylistItem? _$v;
String? _type;
String? get type => _$this._type;
set type(String? type) => _$this._type = type;
String? _name; String? _name;
String? get name => _$this._name; String? get name => _$this._name;
set name(String? name) => _$this._name = name; set name(String? name) => _$this._name = name;
@ -84,6 +98,7 @@ class PlaylistItemBuilder
PlaylistItemBuilder get _$this { PlaylistItemBuilder get _$this {
final $v = _$v; final $v = _$v;
if ($v != null) { if ($v != null) {
_type = $v.type;
_name = $v.name; _name = $v.name;
_thumbnail = $v.thumbnail; _thumbnail = $v.thumbnail;
_url = $v.url; _url = $v.url;
@ -110,10 +125,14 @@ class PlaylistItemBuilder
_$PlaylistItem _build() { _$PlaylistItem _build() {
final _$result = _$v ?? final _$result = _$v ??
new _$PlaylistItem._( new _$PlaylistItem._(
name: name, thumbnail: thumbnail, url: url, videos: videos); type: type,
name: name,
thumbnail: thumbnail,
url: url,
videos: videos);
replace(_$result); replace(_$result);
return _$result; return _$result;
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -802,4 +802,4 @@ class _$RegionsSerializer implements PrimitiveSerializer<Regions> {
_fromWire[serialized] ?? (serialized is String ? serialized : '')); _fromWire[serialized] ?? (serialized is String ? serialized : ''));
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -111,4 +111,4 @@ class _$SearchFilterSerializer implements PrimitiveSerializer<SearchFilter> {
_fromWire[serialized] ?? (serialized is String ? serialized : '')); _fromWire[serialized] ?? (serialized is String ? serialized : ''));
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -15,6 +15,7 @@ part 'search_item.g.dart';
/// SearchItem /// SearchItem
/// ///
/// Properties: /// Properties:
/// * [type] - The type of the playlist item. Always playlist.
/// * [duration] - The duration of the video in seconds. /// * [duration] - The duration of the video in seconds.
/// * [thumbnail] - The thumbnail of the playlist. /// * [thumbnail] - The thumbnail of the playlist.
/// * [title] - The title of the video. /// * [title] - The title of the video.
@ -26,6 +27,8 @@ part 'search_item.g.dart';
/// * [uploaderVerified] - Whether or not the channel has a verified badge. /// * [uploaderVerified] - Whether or not the channel has a verified badge.
/// * [url] - The relative URL of the playlist. /// * [url] - The relative URL of the playlist.
/// * [views] - The number of views the video has. /// * [views] - The number of views the video has.
/// * [isShort] - Whether or not the video is a short video.
/// * [shortDescription] - The short description of the video.
/// * [description] - The description of the channel. /// * [description] - The description of the channel.
/// * [name] - The name of the playlist. /// * [name] - The name of the playlist.
/// * [subscribers] - The number of subscribers the channel has. /// * [subscribers] - The number of subscribers the channel has.
@ -36,6 +39,14 @@ abstract class SearchItem implements Built<SearchItem, SearchItemBuilder> {
/// One Of [ChannelItem], [PlaylistItem], [StreamItem] /// One Of [ChannelItem], [PlaylistItem], [StreamItem]
OneOf get oneOf; OneOf get oneOf;
static const String discriminatorFieldName = r'type';
static const Map<String, Type> discriminatorMapping = {
r'channel': ChannelItem,
r'playlist': PlaylistItem,
r'stream': StreamItem,
};
SearchItem._(); SearchItem._();
factory SearchItem([void updates(SearchItemBuilder b)]) = _$SearchItem; factory SearchItem([void updates(SearchItemBuilder b)]) = _$SearchItem;
@ -47,6 +58,35 @@ abstract class SearchItem implements Built<SearchItem, SearchItemBuilder> {
static Serializer<SearchItem> get serializer => _$SearchItemSerializer(); static Serializer<SearchItem> get serializer => _$SearchItemSerializer();
} }
extension SearchItemDiscriminatorExt on SearchItem {
String? get discriminatorValue {
if (this is ChannelItem) {
return r'channel';
}
if (this is PlaylistItem) {
return r'playlist';
}
if (this is StreamItem) {
return r'stream';
}
return null;
}
}
extension SearchItemBuilderDiscriminatorExt on SearchItemBuilder {
String? get discriminatorValue {
if (this is ChannelItemBuilder) {
return r'channel';
}
if (this is PlaylistItemBuilder) {
return r'playlist';
}
if (this is StreamItemBuilder) {
return r'stream';
}
return null;
}
}
class _$SearchItemSerializer implements PrimitiveSerializer<SearchItem> { class _$SearchItemSerializer implements PrimitiveSerializer<SearchItem> {
@override @override
final Iterable<Type> types = const [SearchItem, _$SearchItem]; final Iterable<Type> types = const [SearchItem, _$SearchItem];
@ -79,9 +119,39 @@ class _$SearchItemSerializer implements PrimitiveSerializer<SearchItem> {
}) { }) {
final result = SearchItemBuilder(); final result = SearchItemBuilder();
Object? oneOfDataSrc; Object? oneOfDataSrc;
final targetType = const FullType(OneOf, [FullType(StreamItem), FullType(ChannelItem), FullType(PlaylistItem), ]); final serializedList = (serialized as Iterable<Object?>).toList();
final discIndex = serializedList.indexOf(SearchItem.discriminatorFieldName) + 1;
final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
oneOfDataSrc = serialized; oneOfDataSrc = serialized;
result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; final oneOfTypes = [ChannelItem, PlaylistItem, StreamItem, ];
Object oneOfResult;
Type oneOfType;
switch (discValue) {
case r'channel':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(ChannelItem),
) as ChannelItem;
oneOfType = ChannelItem;
break;
case r'playlist':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(PlaylistItem),
) as PlaylistItem;
oneOfType = PlaylistItem;
break;
case r'stream':
oneOfResult = serializers.deserialize(
oneOfDataSrc,
specifiedType: FullType(StreamItem),
) as StreamItem;
oneOfType = StreamItem;
break;
default:
throw UnsupportedError("Couldn't deserialize oneOf for the discriminator value: ${discValue}");
}
result.oneOf = OneOfDynamic(typeIndex: oneOfTypes.indexOf(oneOfType), types: oneOfTypes, value: oneOfResult);
return result.build(); return result.build();
} }
} }

View File

@ -32,7 +32,10 @@ class _$SearchItem extends SearchItem {
@override @override
int get hashCode { int get hashCode {
return $jf($jc(0, oneOf.hashCode)); var _$hash = 0;
_$hash = $jc(_$hash, oneOf.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -86,4 +89,4 @@ class SearchItemBuilder implements Builder<SearchItem, SearchItemBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -41,9 +41,13 @@ class _$SearchPage extends SearchPage {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc($jc($jc(0, corrected.hashCode), items.hashCode), nextpage.hashCode), _$hash = $jc(_$hash, corrected.hashCode);
suggestion.hashCode)); _$hash = $jc(_$hash, items.hashCode);
_$hash = $jc(_$hash, nextpage.hashCode);
_$hash = $jc(_$hash, suggestion.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -132,4 +136,4 @@ class SearchPageBuilder implements Builder<SearchPage, SearchPageBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -158,32 +158,23 @@ class _$Stream extends Stream {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, url.hashCode);
$jc( _$hash = $jc(_$hash, format.hashCode);
$jc( _$hash = $jc(_$hash, quality.hashCode);
$jc( _$hash = $jc(_$hash, mimeType.hashCode);
$jc( _$hash = $jc(_$hash, codec.hashCode);
$jc( _$hash = $jc(_$hash, videoOnly.hashCode);
$jc( _$hash = $jc(_$hash, bitrate.hashCode);
$jc( _$hash = $jc(_$hash, initStart.hashCode);
$jc( _$hash = $jc(_$hash, initEnd.hashCode);
$jc( _$hash = $jc(_$hash, indexStart.hashCode);
$jc( _$hash = $jc(_$hash, indexEnd.hashCode);
$jc($jc(0, url.hashCode), _$hash = $jc(_$hash, width.hashCode);
format.hashCode), _$hash = $jc(_$hash, height.hashCode);
quality.hashCode), _$hash = $jc(_$hash, fps.hashCode);
mimeType.hashCode), _$hash = $jf(_$hash);
codec.hashCode), return _$hash;
videoOnly.hashCode),
bitrate.hashCode),
initStart.hashCode),
initEnd.hashCode),
indexStart.hashCode),
indexEnd.hashCode),
width.hashCode),
height.hashCode),
fps.hashCode));
} }
@override @override
@ -328,4 +319,4 @@ class StreamBuilder implements Builder<Stream, StreamBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -11,6 +11,7 @@ part 'stream_item.g.dart';
/// StreamItem /// StreamItem
/// ///
/// Properties: /// Properties:
/// * [type] - The type of the stream item. Always stream.
/// * [duration] - The duration of the video in seconds. /// * [duration] - The duration of the video in seconds.
/// * [thumbnail] - The thumbnail of the video. /// * [thumbnail] - The thumbnail of the video.
/// * [title] - The title of the video. /// * [title] - The title of the video.
@ -22,8 +23,14 @@ part 'stream_item.g.dart';
/// * [uploaderVerified] - Whether or not the channel has a verified badge. /// * [uploaderVerified] - Whether or not the channel has a verified badge.
/// * [url] - The relative URL to the video. /// * [url] - The relative URL to the video.
/// * [views] - The number of views the video has. /// * [views] - The number of views the video has.
/// * [isShort] - Whether or not the video is a short video.
/// * [shortDescription] - The short description of the video.
@BuiltValue() @BuiltValue()
abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> { abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
/// The type of the stream item. Always stream.
@BuiltValueField(wireName: r'type')
String? get type;
/// The duration of the video in seconds. /// The duration of the video in seconds.
@BuiltValueField(wireName: r'duration') @BuiltValueField(wireName: r'duration')
int get duration; int get duration;
@ -41,6 +48,7 @@ abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
int? get uploaded; int? get uploaded;
/// The relative date the video was uploaded on. /// The relative date the video was uploaded on.
@Deprecated('uploadedDate has been deprecated')
@BuiltValueField(wireName: r'uploadedDate') @BuiltValueField(wireName: r'uploadedDate')
String? get uploadedDate; String? get uploadedDate;
@ -68,6 +76,14 @@ abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
@BuiltValueField(wireName: r'views') @BuiltValueField(wireName: r'views')
int? get views; int? get views;
/// Whether or not the video is a short video.
@BuiltValueField(wireName: r'isShort')
bool? get isShort;
/// The short description of the video.
@BuiltValueField(wireName: r'shortDescription')
String? get shortDescription;
StreamItem._(); StreamItem._();
factory StreamItem([void updates(StreamItemBuilder b)]) = _$StreamItem; factory StreamItem([void updates(StreamItemBuilder b)]) = _$StreamItem;
@ -91,6 +107,13 @@ class _$StreamItemSerializer implements PrimitiveSerializer<StreamItem> {
StreamItem object, { StreamItem object, {
FullType specifiedType = FullType.unspecified, FullType specifiedType = FullType.unspecified,
}) sync* { }) sync* {
if (object.type != null) {
yield r'type';
yield serializers.serialize(
object.type,
specifiedType: const FullType(String),
);
}
yield r'duration'; yield r'duration';
yield serializers.serialize( yield serializers.serialize(
object.duration, object.duration,
@ -160,6 +183,20 @@ class _$StreamItemSerializer implements PrimitiveSerializer<StreamItem> {
specifiedType: const FullType(int), specifiedType: const FullType(int),
); );
} }
if (object.isShort != null) {
yield r'isShort';
yield serializers.serialize(
object.isShort,
specifiedType: const FullType(bool),
);
}
if (object.shortDescription != null) {
yield r'shortDescription';
yield serializers.serialize(
object.shortDescription,
specifiedType: const FullType.nullable(String),
);
}
} }
@override @override
@ -183,6 +220,13 @@ class _$StreamItemSerializer implements PrimitiveSerializer<StreamItem> {
final key = serializedList[i] as String; final key = serializedList[i] as String;
final value = serializedList[i + 1]; final value = serializedList[i + 1];
switch (key) { switch (key) {
case r'type':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(String),
) as String;
result.type = valueDes;
break;
case r'duration': case r'duration':
final valueDes = serializers.deserialize( final valueDes = serializers.deserialize(
value, value,
@ -262,6 +306,21 @@ class _$StreamItemSerializer implements PrimitiveSerializer<StreamItem> {
) as int; ) as int;
result.views = valueDes; result.views = valueDes;
break; break;
case r'isShort':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(bool),
) as bool;
result.isShort = valueDes;
break;
case r'shortDescription':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType.nullable(String),
) as String?;
if (valueDes == null) continue;
result.shortDescription = valueDes;
break;
default: default:
unhandled.add(key); unhandled.add(key);
unhandled.add(value); unhandled.add(value);

View File

@ -7,6 +7,8 @@ part of 'stream_item.dart';
// ************************************************************************** // **************************************************************************
class _$StreamItem extends StreamItem { class _$StreamItem extends StreamItem {
@override
final String? type;
@override @override
final int duration; final int duration;
@override @override
@ -29,12 +31,17 @@ class _$StreamItem extends StreamItem {
final String url; final String url;
@override @override
final int? views; final int? views;
@override
final bool? isShort;
@override
final String? shortDescription;
factory _$StreamItem([void Function(StreamItemBuilder)? updates]) => factory _$StreamItem([void Function(StreamItemBuilder)? updates]) =>
(new StreamItemBuilder()..update(updates))._build(); (new StreamItemBuilder()..update(updates))._build();
_$StreamItem._( _$StreamItem._(
{required this.duration, {this.type,
required this.duration,
required this.thumbnail, required this.thumbnail,
required this.title, required this.title,
this.uploaded, this.uploaded,
@ -44,7 +51,9 @@ class _$StreamItem extends StreamItem {
this.uploaderUrl, this.uploaderUrl,
this.uploaderVerified, this.uploaderVerified,
required this.url, required this.url,
this.views}) this.views,
this.isShort,
this.shortDescription})
: super._() { : super._() {
BuiltValueNullFieldError.checkNotNull(duration, r'StreamItem', 'duration'); BuiltValueNullFieldError.checkNotNull(duration, r'StreamItem', 'duration');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -64,6 +73,7 @@ class _$StreamItem extends StreamItem {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(other, this)) return true; if (identical(other, this)) return true;
return other is StreamItem && return other is StreamItem &&
type == other.type &&
duration == other.duration && duration == other.duration &&
thumbnail == other.thumbnail && thumbnail == other.thumbnail &&
title == other.title && title == other.title &&
@ -74,36 +84,36 @@ class _$StreamItem extends StreamItem {
uploaderUrl == other.uploaderUrl && uploaderUrl == other.uploaderUrl &&
uploaderVerified == other.uploaderVerified && uploaderVerified == other.uploaderVerified &&
url == other.url && url == other.url &&
views == other.views; views == other.views &&
isShort == other.isShort &&
shortDescription == other.shortDescription;
} }
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, type.hashCode);
$jc( _$hash = $jc(_$hash, duration.hashCode);
$jc( _$hash = $jc(_$hash, thumbnail.hashCode);
$jc( _$hash = $jc(_$hash, title.hashCode);
$jc( _$hash = $jc(_$hash, uploaded.hashCode);
$jc( _$hash = $jc(_$hash, uploadedDate.hashCode);
$jc( _$hash = $jc(_$hash, uploaderAvatar.hashCode);
$jc( _$hash = $jc(_$hash, uploaderName.hashCode);
$jc($jc(0, duration.hashCode), _$hash = $jc(_$hash, uploaderUrl.hashCode);
thumbnail.hashCode), _$hash = $jc(_$hash, uploaderVerified.hashCode);
title.hashCode), _$hash = $jc(_$hash, url.hashCode);
uploaded.hashCode), _$hash = $jc(_$hash, views.hashCode);
uploadedDate.hashCode), _$hash = $jc(_$hash, isShort.hashCode);
uploaderAvatar.hashCode), _$hash = $jc(_$hash, shortDescription.hashCode);
uploaderName.hashCode), _$hash = $jf(_$hash);
uploaderUrl.hashCode), return _$hash;
uploaderVerified.hashCode),
url.hashCode),
views.hashCode));
} }
@override @override
String toString() { String toString() {
return (newBuiltValueToStringHelper(r'StreamItem') return (newBuiltValueToStringHelper(r'StreamItem')
..add('type', type)
..add('duration', duration) ..add('duration', duration)
..add('thumbnail', thumbnail) ..add('thumbnail', thumbnail)
..add('title', title) ..add('title', title)
@ -114,7 +124,9 @@ class _$StreamItem extends StreamItem {
..add('uploaderUrl', uploaderUrl) ..add('uploaderUrl', uploaderUrl)
..add('uploaderVerified', uploaderVerified) ..add('uploaderVerified', uploaderVerified)
..add('url', url) ..add('url', url)
..add('views', views)) ..add('views', views)
..add('isShort', isShort)
..add('shortDescription', shortDescription))
.toString(); .toString();
} }
} }
@ -122,6 +134,10 @@ class _$StreamItem extends StreamItem {
class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> { class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
_$StreamItem? _$v; _$StreamItem? _$v;
String? _type;
String? get type => _$this._type;
set type(String? type) => _$this._type = type;
int? _duration; int? _duration;
int? get duration => _$this._duration; int? get duration => _$this._duration;
set duration(int? duration) => _$this._duration = duration; set duration(int? duration) => _$this._duration = duration;
@ -168,6 +184,15 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
int? get views => _$this._views; int? get views => _$this._views;
set views(int? views) => _$this._views = views; set views(int? views) => _$this._views = views;
bool? _isShort;
bool? get isShort => _$this._isShort;
set isShort(bool? isShort) => _$this._isShort = isShort;
String? _shortDescription;
String? get shortDescription => _$this._shortDescription;
set shortDescription(String? shortDescription) =>
_$this._shortDescription = shortDescription;
StreamItemBuilder() { StreamItemBuilder() {
StreamItem._defaults(this); StreamItem._defaults(this);
} }
@ -175,6 +200,7 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
StreamItemBuilder get _$this { StreamItemBuilder get _$this {
final $v = _$v; final $v = _$v;
if ($v != null) { if ($v != null) {
_type = $v.type;
_duration = $v.duration; _duration = $v.duration;
_thumbnail = $v.thumbnail; _thumbnail = $v.thumbnail;
_title = $v.title; _title = $v.title;
@ -186,6 +212,8 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
_uploaderVerified = $v.uploaderVerified; _uploaderVerified = $v.uploaderVerified;
_url = $v.url; _url = $v.url;
_views = $v.views; _views = $v.views;
_isShort = $v.isShort;
_shortDescription = $v.shortDescription;
_$v = null; _$v = null;
} }
return this; return this;
@ -208,6 +236,7 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
_$StreamItem _build() { _$StreamItem _build() {
final _$result = _$v ?? final _$result = _$v ??
new _$StreamItem._( new _$StreamItem._(
type: type,
duration: BuiltValueNullFieldError.checkNotNull( duration: BuiltValueNullFieldError.checkNotNull(
duration, r'StreamItem', 'duration'), duration, r'StreamItem', 'duration'),
thumbnail: BuiltValueNullFieldError.checkNotNull( thumbnail: BuiltValueNullFieldError.checkNotNull(
@ -222,10 +251,12 @@ class StreamItemBuilder implements Builder<StreamItem, StreamItemBuilder> {
uploaderVerified: uploaderVerified, uploaderVerified: uploaderVerified,
url: BuiltValueNullFieldError.checkNotNull( url: BuiltValueNullFieldError.checkNotNull(
url, r'StreamItem', 'url'), url, r'StreamItem', 'url'),
views: views); views: views,
isShort: isShort,
shortDescription: shortDescription);
replace(_$result); replace(_$result);
return _$result; return _$result;
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -34,7 +34,11 @@ class _$StreamsPage extends StreamsPage {
@override @override
int get hashCode { int get hashCode {
return $jf($jc($jc(0, relatedStreams.hashCode), nextpage.hashCode)); var _$hash = 0;
_$hash = $jc(_$hash, relatedStreams.hashCode);
_$hash = $jc(_$hash, nextpage.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -109,4 +113,4 @@ class StreamsPageBuilder implements Builder<StreamsPage, StreamsPageBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -41,10 +41,13 @@ class _$Subtitle extends Subtitle {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc($jc($jc(0, autoGenerated.hashCode), code.hashCode), _$hash = $jc(_$hash, autoGenerated.hashCode);
mimeType.hashCode), _$hash = $jc(_$hash, code.hashCode);
url.hashCode)); _$hash = $jc(_$hash, mimeType.hashCode);
_$hash = $jc(_$hash, url.hashCode);
_$hash = $jf(_$hash);
return _$hash;
} }
@override @override
@ -120,4 +123,4 @@ class SubtitleBuilder implements Builder<Subtitle, SubtitleBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -113,44 +113,30 @@ class _$VideoInfo extends VideoInfo {
@override @override
int get hashCode { int get hashCode {
return $jf($jc( var _$hash = 0;
$jc( _$hash = $jc(_$hash, audioStreams.hashCode);
$jc( _$hash = $jc(_$hash, videoStreams.hashCode);
$jc( _$hash = $jc(_$hash, description.hashCode);
$jc( _$hash = $jc(_$hash, dislikes.hashCode);
$jc( _$hash = $jc(_$hash, duration.hashCode);
$jc( _$hash = $jc(_$hash, hls.hashCode);
$jc( _$hash = $jc(_$hash, lbryId.hashCode);
$jc( _$hash = $jc(_$hash, likes.hashCode);
$jc( _$hash = $jc(_$hash, livestream.hashCode);
$jc( _$hash = $jc(_$hash, proxyUrl.hashCode);
$jc( _$hash = $jc(_$hash, subtitles.hashCode);
$jc( _$hash = $jc(_$hash, dash.hashCode);
$jc( _$hash = $jc(_$hash, thumbnailUrl.hashCode);
$jc( _$hash = $jc(_$hash, title.hashCode);
$jc( _$hash = $jc(_$hash, uploadDate.hashCode);
$jc( _$hash = $jc(_$hash, uploader.hashCode);
$jc( _$hash = $jc(_$hash, uploaderAvatar.hashCode);
$jc($jc($jc(0, audioStreams.hashCode), videoStreams.hashCode), _$hash = $jc(_$hash, uploaderUrl.hashCode);
description.hashCode), _$hash = $jc(_$hash, uploaderVerified.hashCode);
dislikes.hashCode), _$hash = $jc(_$hash, views.hashCode);
duration.hashCode), _$hash = $jc(_$hash, relatedStreams.hashCode);
hls.hashCode), _$hash = $jf(_$hash);
lbryId.hashCode), return _$hash;
likes.hashCode),
livestream.hashCode),
proxyUrl.hashCode),
subtitles.hashCode),
dash.hashCode),
thumbnailUrl.hashCode),
title.hashCode),
uploadDate.hashCode),
uploader.hashCode),
uploaderAvatar.hashCode),
uploaderUrl.hashCode),
uploaderVerified.hashCode),
views.hashCode),
relatedStreams.hashCode));
} }
@override @override
@ -375,4 +361,4 @@ class VideoInfoBuilder implements Builder<VideoInfo, VideoInfoBuilder> {
} }
} }
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -49,4 +49,4 @@ Serializers _$serializers = (new Serializers().toBuilder()
() => new ListBuilder<StreamItem>())) () => new ListBuilder<StreamItem>()))
.build(); .build();
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,no_leading_underscores_for_local_identifiers,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new,unnecessary_lambdas // ignore_for_file: deprecated_member_use_from_same_package,type=lint

View File

@ -4,10 +4,10 @@ description: Automatically generated OpenAPI bindings for Piped.
homepage: homepage homepage: homepage
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.15.0 <3.0.0'
dependencies: dependencies:
dio: '>=4.0.1 <5.0.0' dio: '^5.0.0'
one_of: '>=1.5.0 <2.0.0' one_of: '>=1.5.0 <2.0.0'
one_of_serializer: '>=1.5.0 <2.0.0' one_of_serializer: '>=1.5.0 <2.0.0'
built_value: '>=8.4.0 <9.0.0' built_value: '>=8.4.0 <9.0.0'

125
test/content_item_test.dart Normal file
View File

@ -0,0 +1,125 @@
import 'package:test/test.dart';
import 'package:piped_api/piped_api.dart';
// tests for ContentItem
void main() {
final instance = ContentItemBuilder();
// TODO add properties to the builder and call build()
group(ContentItem, () {
// The type of the content item.
// String type
test('to test the property `type`', () async {
// TODO
});
// The duration of the video in seconds.
// int duration
test('to test the property `duration`', () async {
// TODO
});
// The thumbnail of the playlist.
// String thumbnail
test('to test the property `thumbnail`', () async {
// TODO
});
// The title of the video.
// String title
test('to test the property `title`', () async {
// TODO
});
// The date in unix epoch the video was uploaded.
// int uploaded
test('to test the property `uploaded`', () async {
// TODO
});
// The relative date the video was uploaded on.
// String uploadedDate
test('to test the property `uploadedDate`', () async {
// TODO
});
// The avatar of the channel of the video.
// String uploaderAvatar
test('to test the property `uploaderAvatar`', () async {
// TODO
});
// The name of the channel of the video.
// String uploaderName
test('to test the property `uploaderName`', () async {
// TODO
});
// The relative URL of the channel of the video.
// String uploaderUrl
test('to test the property `uploaderUrl`', () async {
// TODO
});
// Whether or not the channel has a verified badge.
// bool uploaderVerified
test('to test the property `uploaderVerified`', () async {
// TODO
});
// The relative URL of the playlist.
// String url
test('to test the property `url`', () async {
// TODO
});
// The number of views the video has.
// int views
test('to test the property `views`', () async {
// TODO
});
// Whether or not the video is a short video.
// bool isShort
test('to test the property `isShort`', () async {
// TODO
});
// The short description of the video.
// String shortDescription
test('to test the property `shortDescription`', () async {
// TODO
});
// The description of the channel.
// String description
test('to test the property `description`', () async {
// TODO
});
// The name of the playlist.
// String name
test('to test the property `name`', () async {
// TODO
});
// The number of subscribers the channel has.
// int subscribers
test('to test the property `subscribers`', () async {
// TODO
});
// Whether the channel is verified.
// bool verified
test('to test the property `verified`', () async {
// TODO
});
// The number of videos in the playlist.
// int videos
test('to test the property `videos`', () async {
// TODO
});
});
}

View File

@ -1,7 +1,6 @@
import 'package:test/test.dart'; import 'package:test/test.dart';
import 'package:piped_api/piped_api.dart'; import 'package:piped_api/piped_api.dart';
/// tests for SearchApi /// tests for SearchApi
void main() { void main() {
final instance = PipedApi().getSearchApi(); final instance = PipedApi().getSearchApi();
@ -13,7 +12,10 @@ void main() {
// //
//Future<SearchPage> search(String q, SearchFilter filter) async //Future<SearchPage> search(String q, SearchFilter filter) async
test('test search', () async { test('test search', () async {
// TODO print((await instance.search(q: "cat videos", filter: SearchFilter.all))
.data
?.items
?.first);
}); });
// Gets more search results // Gets more search results
@ -24,6 +26,5 @@ void main() {
test('test searchNextPage', () async { test('test searchNextPage', () async {
// TODO // TODO
}); });
}); });
} }