All checks were successful
ci/woodpecker/tag/release Pipeline was successful
Add Android foreground service support for downloads to prevent OS process killing during long operations. Fix multiple error handling issues: foreground service leak on exceptions, polling stuck forever on failure, double-counting chapters on retry, silent retry failures without user feedback, and app crash if background service init fails. Replace inaccurate failed chapter count heuristic with actual data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
461 lines
16 KiB
Dart
461 lines
16 KiB
Dart
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// ignore_for_file: type=lint
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'downloaded_series.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
T _$identity<T>(T value) => value;
|
|
|
|
final _privateConstructorUsedError = UnsupportedError(
|
|
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
|
|
DownloadedSeries _$DownloadedSeriesFromJson(Map<String, dynamic> json) {
|
|
return _DownloadedSeries.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$DownloadedSeries {
|
|
String get id => throw _privateConstructorUsedError;
|
|
String get serverId => throw _privateConstructorUsedError;
|
|
String get seriesFeedUrl => throw _privateConstructorUsedError;
|
|
String get title => throw _privateConstructorUsedError;
|
|
String? get coverUrl => throw _privateConstructorUsedError;
|
|
String? get coverPath => throw _privateConstructorUsedError;
|
|
String? get thumbnailUrl => throw _privateConstructorUsedError;
|
|
String? get thumbnailPath => throw _privateConstructorUsedError;
|
|
DownloadStatus get status => throw _privateConstructorUsedError;
|
|
int get totalChapters => throw _privateConstructorUsedError;
|
|
int get downloadedChaptersCount => throw _privateConstructorUsedError;
|
|
DateTime? get downloadedAt => throw _privateConstructorUsedError;
|
|
DateTime get updatedAt => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this DownloadedSeries to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of DownloadedSeries
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$DownloadedSeriesCopyWith<DownloadedSeries> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $DownloadedSeriesCopyWith<$Res> {
|
|
factory $DownloadedSeriesCopyWith(
|
|
DownloadedSeries value, $Res Function(DownloadedSeries) then) =
|
|
_$DownloadedSeriesCopyWithImpl<$Res, DownloadedSeries>;
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String serverId,
|
|
String seriesFeedUrl,
|
|
String title,
|
|
String? coverUrl,
|
|
String? coverPath,
|
|
String? thumbnailUrl,
|
|
String? thumbnailPath,
|
|
DownloadStatus status,
|
|
int totalChapters,
|
|
int downloadedChaptersCount,
|
|
DateTime? downloadedAt,
|
|
DateTime updatedAt});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$DownloadedSeriesCopyWithImpl<$Res, $Val extends DownloadedSeries>
|
|
implements $DownloadedSeriesCopyWith<$Res> {
|
|
_$DownloadedSeriesCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of DownloadedSeries
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? serverId = null,
|
|
Object? seriesFeedUrl = null,
|
|
Object? title = null,
|
|
Object? coverUrl = freezed,
|
|
Object? coverPath = freezed,
|
|
Object? thumbnailUrl = freezed,
|
|
Object? thumbnailPath = freezed,
|
|
Object? status = null,
|
|
Object? totalChapters = null,
|
|
Object? downloadedChaptersCount = null,
|
|
Object? downloadedAt = freezed,
|
|
Object? updatedAt = null,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
serverId: null == serverId
|
|
? _value.serverId
|
|
: serverId // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
seriesFeedUrl: null == seriesFeedUrl
|
|
? _value.seriesFeedUrl
|
|
: seriesFeedUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
title: null == title
|
|
? _value.title
|
|
: title // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
coverUrl: freezed == coverUrl
|
|
? _value.coverUrl
|
|
: coverUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
coverPath: freezed == coverPath
|
|
? _value.coverPath
|
|
: coverPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
thumbnailUrl: freezed == thumbnailUrl
|
|
? _value.thumbnailUrl
|
|
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
thumbnailPath: freezed == thumbnailPath
|
|
? _value.thumbnailPath
|
|
: thumbnailPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
status: null == status
|
|
? _value.status
|
|
: status // ignore: cast_nullable_to_non_nullable
|
|
as DownloadStatus,
|
|
totalChapters: null == totalChapters
|
|
? _value.totalChapters
|
|
: totalChapters // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
downloadedChaptersCount: null == downloadedChaptersCount
|
|
? _value.downloadedChaptersCount
|
|
: downloadedChaptersCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
downloadedAt: freezed == downloadedAt
|
|
? _value.downloadedAt
|
|
: downloadedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
updatedAt: null == updatedAt
|
|
? _value.updatedAt
|
|
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime,
|
|
) as $Val);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$DownloadedSeriesImplCopyWith<$Res>
|
|
implements $DownloadedSeriesCopyWith<$Res> {
|
|
factory _$$DownloadedSeriesImplCopyWith(_$DownloadedSeriesImpl value,
|
|
$Res Function(_$DownloadedSeriesImpl) then) =
|
|
__$$DownloadedSeriesImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String serverId,
|
|
String seriesFeedUrl,
|
|
String title,
|
|
String? coverUrl,
|
|
String? coverPath,
|
|
String? thumbnailUrl,
|
|
String? thumbnailPath,
|
|
DownloadStatus status,
|
|
int totalChapters,
|
|
int downloadedChaptersCount,
|
|
DateTime? downloadedAt,
|
|
DateTime updatedAt});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$DownloadedSeriesImplCopyWithImpl<$Res>
|
|
extends _$DownloadedSeriesCopyWithImpl<$Res, _$DownloadedSeriesImpl>
|
|
implements _$$DownloadedSeriesImplCopyWith<$Res> {
|
|
__$$DownloadedSeriesImplCopyWithImpl(_$DownloadedSeriesImpl _value,
|
|
$Res Function(_$DownloadedSeriesImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
/// Create a copy of DownloadedSeries
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? serverId = null,
|
|
Object? seriesFeedUrl = null,
|
|
Object? title = null,
|
|
Object? coverUrl = freezed,
|
|
Object? coverPath = freezed,
|
|
Object? thumbnailUrl = freezed,
|
|
Object? thumbnailPath = freezed,
|
|
Object? status = null,
|
|
Object? totalChapters = null,
|
|
Object? downloadedChaptersCount = null,
|
|
Object? downloadedAt = freezed,
|
|
Object? updatedAt = null,
|
|
}) {
|
|
return _then(_$DownloadedSeriesImpl(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
serverId: null == serverId
|
|
? _value.serverId
|
|
: serverId // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
seriesFeedUrl: null == seriesFeedUrl
|
|
? _value.seriesFeedUrl
|
|
: seriesFeedUrl // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
title: null == title
|
|
? _value.title
|
|
: title // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
coverUrl: freezed == coverUrl
|
|
? _value.coverUrl
|
|
: coverUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
coverPath: freezed == coverPath
|
|
? _value.coverPath
|
|
: coverPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
thumbnailUrl: freezed == thumbnailUrl
|
|
? _value.thumbnailUrl
|
|
: thumbnailUrl // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
thumbnailPath: freezed == thumbnailPath
|
|
? _value.thumbnailPath
|
|
: thumbnailPath // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
status: null == status
|
|
? _value.status
|
|
: status // ignore: cast_nullable_to_non_nullable
|
|
as DownloadStatus,
|
|
totalChapters: null == totalChapters
|
|
? _value.totalChapters
|
|
: totalChapters // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
downloadedChaptersCount: null == downloadedChaptersCount
|
|
? _value.downloadedChaptersCount
|
|
: downloadedChaptersCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
downloadedAt: freezed == downloadedAt
|
|
? _value.downloadedAt
|
|
: downloadedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
updatedAt: null == updatedAt
|
|
? _value.updatedAt
|
|
: updatedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$DownloadedSeriesImpl extends _DownloadedSeries
|
|
with DiagnosticableTreeMixin {
|
|
const _$DownloadedSeriesImpl(
|
|
{required this.id,
|
|
required this.serverId,
|
|
required this.seriesFeedUrl,
|
|
required this.title,
|
|
this.coverUrl,
|
|
this.coverPath,
|
|
this.thumbnailUrl,
|
|
this.thumbnailPath,
|
|
this.status = DownloadStatus.pending,
|
|
this.totalChapters = 0,
|
|
this.downloadedChaptersCount = 0,
|
|
this.downloadedAt,
|
|
required this.updatedAt})
|
|
: super._();
|
|
|
|
factory _$DownloadedSeriesImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$DownloadedSeriesImplFromJson(json);
|
|
|
|
@override
|
|
final String id;
|
|
@override
|
|
final String serverId;
|
|
@override
|
|
final String seriesFeedUrl;
|
|
@override
|
|
final String title;
|
|
@override
|
|
final String? coverUrl;
|
|
@override
|
|
final String? coverPath;
|
|
@override
|
|
final String? thumbnailUrl;
|
|
@override
|
|
final String? thumbnailPath;
|
|
@override
|
|
@JsonKey()
|
|
final DownloadStatus status;
|
|
@override
|
|
@JsonKey()
|
|
final int totalChapters;
|
|
@override
|
|
@JsonKey()
|
|
final int downloadedChaptersCount;
|
|
@override
|
|
final DateTime? downloadedAt;
|
|
@override
|
|
final DateTime updatedAt;
|
|
|
|
@override
|
|
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
|
return 'DownloadedSeries(id: $id, serverId: $serverId, seriesFeedUrl: $seriesFeedUrl, title: $title, coverUrl: $coverUrl, coverPath: $coverPath, thumbnailUrl: $thumbnailUrl, thumbnailPath: $thumbnailPath, status: $status, totalChapters: $totalChapters, downloadedChaptersCount: $downloadedChaptersCount, downloadedAt: $downloadedAt, updatedAt: $updatedAt)';
|
|
}
|
|
|
|
@override
|
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
|
super.debugFillProperties(properties);
|
|
properties
|
|
..add(DiagnosticsProperty('type', 'DownloadedSeries'))
|
|
..add(DiagnosticsProperty('id', id))
|
|
..add(DiagnosticsProperty('serverId', serverId))
|
|
..add(DiagnosticsProperty('seriesFeedUrl', seriesFeedUrl))
|
|
..add(DiagnosticsProperty('title', title))
|
|
..add(DiagnosticsProperty('coverUrl', coverUrl))
|
|
..add(DiagnosticsProperty('coverPath', coverPath))
|
|
..add(DiagnosticsProperty('thumbnailUrl', thumbnailUrl))
|
|
..add(DiagnosticsProperty('thumbnailPath', thumbnailPath))
|
|
..add(DiagnosticsProperty('status', status))
|
|
..add(DiagnosticsProperty('totalChapters', totalChapters))
|
|
..add(DiagnosticsProperty(
|
|
'downloadedChaptersCount', downloadedChaptersCount))
|
|
..add(DiagnosticsProperty('downloadedAt', downloadedAt))
|
|
..add(DiagnosticsProperty('updatedAt', updatedAt));
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$DownloadedSeriesImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.serverId, serverId) ||
|
|
other.serverId == serverId) &&
|
|
(identical(other.seriesFeedUrl, seriesFeedUrl) ||
|
|
other.seriesFeedUrl == seriesFeedUrl) &&
|
|
(identical(other.title, title) || other.title == title) &&
|
|
(identical(other.coverUrl, coverUrl) ||
|
|
other.coverUrl == coverUrl) &&
|
|
(identical(other.coverPath, coverPath) ||
|
|
other.coverPath == coverPath) &&
|
|
(identical(other.thumbnailUrl, thumbnailUrl) ||
|
|
other.thumbnailUrl == thumbnailUrl) &&
|
|
(identical(other.thumbnailPath, thumbnailPath) ||
|
|
other.thumbnailPath == thumbnailPath) &&
|
|
(identical(other.status, status) || other.status == status) &&
|
|
(identical(other.totalChapters, totalChapters) ||
|
|
other.totalChapters == totalChapters) &&
|
|
(identical(
|
|
other.downloadedChaptersCount, downloadedChaptersCount) ||
|
|
other.downloadedChaptersCount == downloadedChaptersCount) &&
|
|
(identical(other.downloadedAt, downloadedAt) ||
|
|
other.downloadedAt == downloadedAt) &&
|
|
(identical(other.updatedAt, updatedAt) ||
|
|
other.updatedAt == updatedAt));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
runtimeType,
|
|
id,
|
|
serverId,
|
|
seriesFeedUrl,
|
|
title,
|
|
coverUrl,
|
|
coverPath,
|
|
thumbnailUrl,
|
|
thumbnailPath,
|
|
status,
|
|
totalChapters,
|
|
downloadedChaptersCount,
|
|
downloadedAt,
|
|
updatedAt);
|
|
|
|
/// Create a copy of DownloadedSeries
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$DownloadedSeriesImplCopyWith<_$DownloadedSeriesImpl> get copyWith =>
|
|
__$$DownloadedSeriesImplCopyWithImpl<_$DownloadedSeriesImpl>(
|
|
this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$DownloadedSeriesImplToJson(
|
|
this,
|
|
);
|
|
}
|
|
}
|
|
|
|
abstract class _DownloadedSeries extends DownloadedSeries {
|
|
const factory _DownloadedSeries(
|
|
{required final String id,
|
|
required final String serverId,
|
|
required final String seriesFeedUrl,
|
|
required final String title,
|
|
final String? coverUrl,
|
|
final String? coverPath,
|
|
final String? thumbnailUrl,
|
|
final String? thumbnailPath,
|
|
final DownloadStatus status,
|
|
final int totalChapters,
|
|
final int downloadedChaptersCount,
|
|
final DateTime? downloadedAt,
|
|
required final DateTime updatedAt}) = _$DownloadedSeriesImpl;
|
|
const _DownloadedSeries._() : super._();
|
|
|
|
factory _DownloadedSeries.fromJson(Map<String, dynamic> json) =
|
|
_$DownloadedSeriesImpl.fromJson;
|
|
|
|
@override
|
|
String get id;
|
|
@override
|
|
String get serverId;
|
|
@override
|
|
String get seriesFeedUrl;
|
|
@override
|
|
String get title;
|
|
@override
|
|
String? get coverUrl;
|
|
@override
|
|
String? get coverPath;
|
|
@override
|
|
String? get thumbnailUrl;
|
|
@override
|
|
String? get thumbnailPath;
|
|
@override
|
|
DownloadStatus get status;
|
|
@override
|
|
int get totalChapters;
|
|
@override
|
|
int get downloadedChaptersCount;
|
|
@override
|
|
DateTime? get downloadedAt;
|
|
@override
|
|
DateTime get updatedAt;
|
|
|
|
/// Create a copy of DownloadedSeries
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$DownloadedSeriesImplCopyWith<_$DownloadedSeriesImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|