worldhopper/lib/models/feed.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

462 lines
13 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 'feed.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');
Feed _$FeedFromJson(Map<String, dynamic> json) {
return _Feed.fromJson(json);
}
/// @nodoc
mixin _$Feed {
/// Feed ID
String get id => throw _privateConstructorUsedError;
/// Feed title
String get title => throw _privateConstructorUsedError;
/// Feed subtitle
String? get subtitle => throw _privateConstructorUsedError;
/// Feed icon URL
String? get icon => throw _privateConstructorUsedError;
/// Last update timestamp
DateTime? get updated => throw _privateConstructorUsedError;
/// Feed author
String? get author => throw _privateConstructorUsedError;
/// All links in the feed
List<Link> get links => throw _privateConstructorUsedError;
/// All entries in the feed
List<Entry> get entries => throw _privateConstructorUsedError;
/// Total results (for paginated feeds)
int? get totalResults => throw _privateConstructorUsedError;
/// Items per page (for paginated feeds)
int? get itemsPerPage => throw _privateConstructorUsedError;
/// Start index (for paginated feeds)
int? get startIndex => throw _privateConstructorUsedError;
/// Serializes this Feed to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of Feed
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$FeedCopyWith<Feed> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $FeedCopyWith<$Res> {
factory $FeedCopyWith(Feed value, $Res Function(Feed) then) =
_$FeedCopyWithImpl<$Res, Feed>;
@useResult
$Res call(
{String id,
String title,
String? subtitle,
String? icon,
DateTime? updated,
String? author,
List<Link> links,
List<Entry> entries,
int? totalResults,
int? itemsPerPage,
int? startIndex});
}
/// @nodoc
class _$FeedCopyWithImpl<$Res, $Val extends Feed>
implements $FeedCopyWith<$Res> {
_$FeedCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Feed
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? title = null,
Object? subtitle = freezed,
Object? icon = freezed,
Object? updated = freezed,
Object? author = freezed,
Object? links = null,
Object? entries = null,
Object? totalResults = freezed,
Object? itemsPerPage = freezed,
Object? startIndex = freezed,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
subtitle: freezed == subtitle
? _value.subtitle
: subtitle // ignore: cast_nullable_to_non_nullable
as String?,
icon: freezed == icon
? _value.icon
: icon // ignore: cast_nullable_to_non_nullable
as String?,
updated: freezed == updated
? _value.updated
: updated // ignore: cast_nullable_to_non_nullable
as DateTime?,
author: freezed == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as String?,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
entries: null == entries
? _value.entries
: entries // ignore: cast_nullable_to_non_nullable
as List<Entry>,
totalResults: freezed == totalResults
? _value.totalResults
: totalResults // ignore: cast_nullable_to_non_nullable
as int?,
itemsPerPage: freezed == itemsPerPage
? _value.itemsPerPage
: itemsPerPage // ignore: cast_nullable_to_non_nullable
as int?,
startIndex: freezed == startIndex
? _value.startIndex
: startIndex // ignore: cast_nullable_to_non_nullable
as int?,
) as $Val);
}
}
/// @nodoc
abstract class _$$FeedImplCopyWith<$Res> implements $FeedCopyWith<$Res> {
factory _$$FeedImplCopyWith(
_$FeedImpl value, $Res Function(_$FeedImpl) then) =
__$$FeedImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String id,
String title,
String? subtitle,
String? icon,
DateTime? updated,
String? author,
List<Link> links,
List<Entry> entries,
int? totalResults,
int? itemsPerPage,
int? startIndex});
}
/// @nodoc
class __$$FeedImplCopyWithImpl<$Res>
extends _$FeedCopyWithImpl<$Res, _$FeedImpl>
implements _$$FeedImplCopyWith<$Res> {
__$$FeedImplCopyWithImpl(_$FeedImpl _value, $Res Function(_$FeedImpl) _then)
: super(_value, _then);
/// Create a copy of Feed
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? title = null,
Object? subtitle = freezed,
Object? icon = freezed,
Object? updated = freezed,
Object? author = freezed,
Object? links = null,
Object? entries = null,
Object? totalResults = freezed,
Object? itemsPerPage = freezed,
Object? startIndex = freezed,
}) {
return _then(_$FeedImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
subtitle: freezed == subtitle
? _value.subtitle
: subtitle // ignore: cast_nullable_to_non_nullable
as String?,
icon: freezed == icon
? _value.icon
: icon // ignore: cast_nullable_to_non_nullable
as String?,
updated: freezed == updated
? _value.updated
: updated // ignore: cast_nullable_to_non_nullable
as DateTime?,
author: freezed == author
? _value.author
: author // ignore: cast_nullable_to_non_nullable
as String?,
links: null == links
? _value._links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
entries: null == entries
? _value._entries
: entries // ignore: cast_nullable_to_non_nullable
as List<Entry>,
totalResults: freezed == totalResults
? _value.totalResults
: totalResults // ignore: cast_nullable_to_non_nullable
as int?,
itemsPerPage: freezed == itemsPerPage
? _value.itemsPerPage
: itemsPerPage // ignore: cast_nullable_to_non_nullable
as int?,
startIndex: freezed == startIndex
? _value.startIndex
: startIndex // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$FeedImpl extends _Feed {
const _$FeedImpl(
{required this.id,
required this.title,
this.subtitle,
this.icon,
this.updated,
this.author,
final List<Link> links = const [],
final List<Entry> entries = const [],
this.totalResults,
this.itemsPerPage,
this.startIndex})
: _links = links,
_entries = entries,
super._();
factory _$FeedImpl.fromJson(Map<String, dynamic> json) =>
_$$FeedImplFromJson(json);
/// Feed ID
@override
final String id;
/// Feed title
@override
final String title;
/// Feed subtitle
@override
final String? subtitle;
/// Feed icon URL
@override
final String? icon;
/// Last update timestamp
@override
final DateTime? updated;
/// Feed author
@override
final String? author;
/// All links in the feed
final List<Link> _links;
/// All links in the feed
@override
@JsonKey()
List<Link> get links {
if (_links is EqualUnmodifiableListView) return _links;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_links);
}
/// All entries in the feed
final List<Entry> _entries;
/// All entries in the feed
@override
@JsonKey()
List<Entry> get entries {
if (_entries is EqualUnmodifiableListView) return _entries;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_entries);
}
/// Total results (for paginated feeds)
@override
final int? totalResults;
/// Items per page (for paginated feeds)
@override
final int? itemsPerPage;
/// Start index (for paginated feeds)
@override
final int? startIndex;
@override
String toString() {
return 'Feed(id: $id, title: $title, subtitle: $subtitle, icon: $icon, updated: $updated, author: $author, links: $links, entries: $entries, totalResults: $totalResults, itemsPerPage: $itemsPerPage, startIndex: $startIndex)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$FeedImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.subtitle, subtitle) ||
other.subtitle == subtitle) &&
(identical(other.icon, icon) || other.icon == icon) &&
(identical(other.updated, updated) || other.updated == updated) &&
(identical(other.author, author) || other.author == author) &&
const DeepCollectionEquality().equals(other._links, _links) &&
const DeepCollectionEquality().equals(other._entries, _entries) &&
(identical(other.totalResults, totalResults) ||
other.totalResults == totalResults) &&
(identical(other.itemsPerPage, itemsPerPage) ||
other.itemsPerPage == itemsPerPage) &&
(identical(other.startIndex, startIndex) ||
other.startIndex == startIndex));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
title,
subtitle,
icon,
updated,
author,
const DeepCollectionEquality().hash(_links),
const DeepCollectionEquality().hash(_entries),
totalResults,
itemsPerPage,
startIndex);
/// Create a copy of Feed
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FeedImplCopyWith<_$FeedImpl> get copyWith =>
__$$FeedImplCopyWithImpl<_$FeedImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$FeedImplToJson(
this,
);
}
}
abstract class _Feed extends Feed {
const factory _Feed(
{required final String id,
required final String title,
final String? subtitle,
final String? icon,
final DateTime? updated,
final String? author,
final List<Link> links,
final List<Entry> entries,
final int? totalResults,
final int? itemsPerPage,
final int? startIndex}) = _$FeedImpl;
const _Feed._() : super._();
factory _Feed.fromJson(Map<String, dynamic> json) = _$FeedImpl.fromJson;
/// Feed ID
@override
String get id;
/// Feed title
@override
String get title;
/// Feed subtitle
@override
String? get subtitle;
/// Feed icon URL
@override
String? get icon;
/// Last update timestamp
@override
DateTime? get updated;
/// Feed author
@override
String? get author;
/// All links in the feed
@override
List<Link> get links;
/// All entries in the feed
@override
List<Entry> get entries;
/// Total results (for paginated feeds)
@override
int? get totalResults;
/// Items per page (for paginated feeds)
@override
int? get itemsPerPage;
/// Start index (for paginated feeds)
@override
int? get startIndex;
/// Create a copy of Feed
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FeedImplCopyWith<_$FeedImpl> get copyWith =>
throw _privateConstructorUsedError;
}