worldhopper/lib/models/link.freezed.dart
Felipe M. 58a562abe8
feat: refactor server software abstraction with Kavita REST API integration
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
2026-04-06 17:46:48 +02:00

233 lines
7 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 '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');
Link _$LinkFromJson(Map<String, dynamic> json) {
return _Link.fromJson(json);
}
/// @nodoc
mixin _$Link {
/// Link relation type (e.g., 'self', 'start', 'subsection', 'http://opds-spec.org/acquisition')
String get rel => throw _privateConstructorUsedError;
/// Link URL
String get href => throw _privateConstructorUsedError;
/// MIME type of the linked resource
String? get type => throw _privateConstructorUsedError;
/// Link title
String? get title => throw _privateConstructorUsedError;
/// Serializes this Link to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LinkCopyWith<Link> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $LinkCopyWith<$Res> {
factory $LinkCopyWith(Link value, $Res Function(Link) then) =
_$LinkCopyWithImpl<$Res, Link>;
@useResult
$Res call({String rel, String href, String? type, String? title});
}
/// @nodoc
class _$LinkCopyWithImpl<$Res, $Val extends Link>
implements $LinkCopyWith<$Res> {
_$LinkCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? rel = null,
Object? href = null,
Object? type = freezed,
Object? title = freezed,
}) {
return _then(_value.copyWith(
rel: null == rel
? _value.rel
: rel // ignore: cast_nullable_to_non_nullable
as String,
href: null == href
? _value.href
: href // ignore: cast_nullable_to_non_nullable
as String,
type: freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> {
factory _$$LinkImplCopyWith(
_$LinkImpl value, $Res Function(_$LinkImpl) then) =
__$$LinkImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String rel, String href, String? type, String? title});
}
/// @nodoc
class __$$LinkImplCopyWithImpl<$Res>
extends _$LinkCopyWithImpl<$Res, _$LinkImpl>
implements _$$LinkImplCopyWith<$Res> {
__$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then)
: super(_value, _then);
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? rel = null,
Object? href = null,
Object? type = freezed,
Object? title = freezed,
}) {
return _then(_$LinkImpl(
rel: null == rel
? _value.rel
: rel // ignore: cast_nullable_to_non_nullable
as String,
href: null == href
? _value.href
: href // ignore: cast_nullable_to_non_nullable
as String,
type: freezed == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as String?,
title: freezed == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LinkImpl implements _Link {
const _$LinkImpl(
{required this.rel, required this.href, this.type, this.title});
factory _$LinkImpl.fromJson(Map<String, dynamic> json) =>
_$$LinkImplFromJson(json);
/// Link relation type (e.g., 'self', 'start', 'subsection', 'http://opds-spec.org/acquisition')
@override
final String rel;
/// Link URL
@override
final String href;
/// MIME type of the linked resource
@override
final String? type;
/// Link title
@override
final String? title;
@override
String toString() {
return 'Link(rel: $rel, href: $href, type: $type, title: $title)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LinkImpl &&
(identical(other.rel, rel) || other.rel == rel) &&
(identical(other.href, href) || other.href == href) &&
(identical(other.type, type) || other.type == type) &&
(identical(other.title, title) || other.title == title));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, rel, href, type, title);
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
__$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$LinkImplToJson(
this,
);
}
}
abstract class _Link implements Link {
const factory _Link(
{required final String rel,
required final String href,
final String? type,
final String? title}) = _$LinkImpl;
factory _Link.fromJson(Map<String, dynamic> json) = _$LinkImpl.fromJson;
/// Link relation type (e.g., 'self', 'start', 'subsection', 'http://opds-spec.org/acquisition')
@override
String get rel;
/// Link URL
@override
String get href;
/// MIME type of the linked resource
@override
String? get type;
/// Link title
@override
String? get title;
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
throw _privateConstructorUsedError;
}