worldhopper/lib/models/downloaded_chapter.g.dart
Felipe M. d2497f8aed
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
feat: add background download service with error handling improvements
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>
2026-02-21 11:44:37 +01:00

68 lines
2.6 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'downloaded_chapter.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$DownloadedChapterImpl _$$DownloadedChapterImplFromJson(
Map<String, dynamic> json) =>
_$DownloadedChapterImpl(
id: json['id'] as String,
seriesId: json['seriesId'] as String,
serverId: json['serverId'] as String,
entryId: json['entryId'] as String,
title: json['title'] as String,
contentType:
$enumDecode(_$ChapterContentTypeEnumMap, json['contentType']),
status: $enumDecodeNullable(_$DownloadStatusEnumMap, json['status']) ??
DownloadStatus.pending,
filePath: json['filePath'] as String?,
totalPages: (json['totalPages'] as num?)?.toInt() ?? 0,
downloadedPages: (json['downloadedPages'] as num?)?.toInt() ?? 0,
entryJson: json['entryJson'] as String,
coverUrl: json['coverUrl'] as String?,
coverPath: json['coverPath'] as String?,
sortOrder: (json['sortOrder'] as num?)?.toInt() ?? 0,
errorMessage: json['errorMessage'] as String?,
downloadedAt: json['downloadedAt'] == null
? null
: DateTime.parse(json['downloadedAt'] as String),
updatedAt: DateTime.parse(json['updatedAt'] as String),
);
Map<String, dynamic> _$$DownloadedChapterImplToJson(
_$DownloadedChapterImpl instance) =>
<String, dynamic>{
'id': instance.id,
'seriesId': instance.seriesId,
'serverId': instance.serverId,
'entryId': instance.entryId,
'title': instance.title,
'contentType': _$ChapterContentTypeEnumMap[instance.contentType]!,
'status': _$DownloadStatusEnumMap[instance.status]!,
'filePath': instance.filePath,
'totalPages': instance.totalPages,
'downloadedPages': instance.downloadedPages,
'entryJson': instance.entryJson,
'coverUrl': instance.coverUrl,
'coverPath': instance.coverPath,
'sortOrder': instance.sortOrder,
'errorMessage': instance.errorMessage,
'downloadedAt': instance.downloadedAt?.toIso8601String(),
'updatedAt': instance.updatedAt.toIso8601String(),
};
const _$ChapterContentTypeEnumMap = {
ChapterContentType.epub: 'epub',
ChapterContentType.imageStream: 'imageStream',
};
const _$DownloadStatusEnumMap = {
DownloadStatus.pending: 'pending',
DownloadStatus.downloading: 'downloading',
DownloadStatus.complete: 'complete',
DownloadStatus.partial: 'partial',
DownloadStatus.failed: 'failed',
};