Rename all OPDS-prefixed models to generic names (Server, Feed, Entry, Link, StreamLink), expand the ServerSoftware interface to cover all server interactions, and implement a full Kavita REST API client that replaces the OPDS delegation. - Rename OPDS* models to generic names across ~60 files - Add database migrations 13 (opds_id → entry_id) and 14 (unify credentials) - Create OPDSServerSoftware wrapping existing OPDS services - Create KavitaApiClient for direct Kavita REST API calls - Create KavitaFeedMapper to convert Kavita JSON to Feed/Entry models - Rewrite KavitaServerSoftware to use native API (no OPDS delegation) - Unify server credentials (remove softwareUsername/softwarePassword) - Simplify add/edit server UI to single auth section - Add test connection button to server add/edit screens - Add progress indicator to PublicationCard using local and server data - Eliminate softwareType branching in reader screens - Add EntryProgress and fetchEntryProgress to ServerSoftware interface - Fix Entry.acquisitionLink crash on empty links - Add 59 new tests covering models, services, and providers
284 lines
9 KiB
Dart
284 lines
9 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 'stream_link.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');
|
|
|
|
StreamLink _$StreamLinkFromJson(Map<String, dynamic> json) {
|
|
return _StreamLink.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$StreamLink {
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
String get href => throw _privateConstructorUsedError;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
String get type => throw _privateConstructorUsedError;
|
|
|
|
/// Total number of pages
|
|
int get pageCount => throw _privateConstructorUsedError;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
int? get lastRead => throw _privateConstructorUsedError;
|
|
|
|
/// Last read timestamp
|
|
DateTime? get lastReadDate => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this StreamLink to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of StreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$StreamLinkCopyWith<StreamLink> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $StreamLinkCopyWith<$Res> {
|
|
factory $StreamLinkCopyWith(
|
|
StreamLink value, $Res Function(StreamLink) then) =
|
|
_$StreamLinkCopyWithImpl<$Res, StreamLink>;
|
|
@useResult
|
|
$Res call(
|
|
{String href,
|
|
String type,
|
|
int pageCount,
|
|
int? lastRead,
|
|
DateTime? lastReadDate});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$StreamLinkCopyWithImpl<$Res, $Val extends StreamLink>
|
|
implements $StreamLinkCopyWith<$Res> {
|
|
_$StreamLinkCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of StreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? href = null,
|
|
Object? type = null,
|
|
Object? pageCount = null,
|
|
Object? lastRead = freezed,
|
|
Object? lastReadDate = freezed,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
href: null == href
|
|
? _value.href
|
|
: href // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
pageCount: null == pageCount
|
|
? _value.pageCount
|
|
: pageCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
lastRead: freezed == lastRead
|
|
? _value.lastRead
|
|
: lastRead // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
lastReadDate: freezed == lastReadDate
|
|
? _value.lastReadDate
|
|
: lastReadDate // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
) as $Val);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$StreamLinkImplCopyWith<$Res>
|
|
implements $StreamLinkCopyWith<$Res> {
|
|
factory _$$StreamLinkImplCopyWith(
|
|
_$StreamLinkImpl value, $Res Function(_$StreamLinkImpl) then) =
|
|
__$$StreamLinkImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call(
|
|
{String href,
|
|
String type,
|
|
int pageCount,
|
|
int? lastRead,
|
|
DateTime? lastReadDate});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$StreamLinkImplCopyWithImpl<$Res>
|
|
extends _$StreamLinkCopyWithImpl<$Res, _$StreamLinkImpl>
|
|
implements _$$StreamLinkImplCopyWith<$Res> {
|
|
__$$StreamLinkImplCopyWithImpl(
|
|
_$StreamLinkImpl _value, $Res Function(_$StreamLinkImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
/// Create a copy of StreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? href = null,
|
|
Object? type = null,
|
|
Object? pageCount = null,
|
|
Object? lastRead = freezed,
|
|
Object? lastReadDate = freezed,
|
|
}) {
|
|
return _then(_$StreamLinkImpl(
|
|
href: null == href
|
|
? _value.href
|
|
: href // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
pageCount: null == pageCount
|
|
? _value.pageCount
|
|
: pageCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
lastRead: freezed == lastRead
|
|
? _value.lastRead
|
|
: lastRead // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
lastReadDate: freezed == lastReadDate
|
|
? _value.lastReadDate
|
|
: lastReadDate // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$StreamLinkImpl extends _StreamLink {
|
|
const _$StreamLinkImpl(
|
|
{required this.href,
|
|
required this.type,
|
|
required this.pageCount,
|
|
this.lastRead,
|
|
this.lastReadDate})
|
|
: super._();
|
|
|
|
factory _$StreamLinkImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$StreamLinkImplFromJson(json);
|
|
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
@override
|
|
final String href;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
@override
|
|
final String type;
|
|
|
|
/// Total number of pages
|
|
@override
|
|
final int pageCount;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
@override
|
|
final int? lastRead;
|
|
|
|
/// Last read timestamp
|
|
@override
|
|
final DateTime? lastReadDate;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'StreamLink(href: $href, type: $type, pageCount: $pageCount, lastRead: $lastRead, lastReadDate: $lastReadDate)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$StreamLinkImpl &&
|
|
(identical(other.href, href) || other.href == href) &&
|
|
(identical(other.type, type) || other.type == type) &&
|
|
(identical(other.pageCount, pageCount) ||
|
|
other.pageCount == pageCount) &&
|
|
(identical(other.lastRead, lastRead) ||
|
|
other.lastRead == lastRead) &&
|
|
(identical(other.lastReadDate, lastReadDate) ||
|
|
other.lastReadDate == lastReadDate));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(runtimeType, href, type, pageCount, lastRead, lastReadDate);
|
|
|
|
/// Create a copy of StreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$StreamLinkImplCopyWith<_$StreamLinkImpl> get copyWith =>
|
|
__$$StreamLinkImplCopyWithImpl<_$StreamLinkImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$StreamLinkImplToJson(
|
|
this,
|
|
);
|
|
}
|
|
}
|
|
|
|
abstract class _StreamLink extends StreamLink {
|
|
const factory _StreamLink(
|
|
{required final String href,
|
|
required final String type,
|
|
required final int pageCount,
|
|
final int? lastRead,
|
|
final DateTime? lastReadDate}) = _$StreamLinkImpl;
|
|
const _StreamLink._() : super._();
|
|
|
|
factory _StreamLink.fromJson(Map<String, dynamic> json) =
|
|
_$StreamLinkImpl.fromJson;
|
|
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
@override
|
|
String get href;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
@override
|
|
String get type;
|
|
|
|
/// Total number of pages
|
|
@override
|
|
int get pageCount;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
@override
|
|
int? get lastRead;
|
|
|
|
/// Last read timestamp
|
|
@override
|
|
DateTime? get lastReadDate;
|
|
|
|
/// Create a copy of StreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$StreamLinkImplCopyWith<_$StreamLinkImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|