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
355 lines
11 KiB
Dart
355 lines
11 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 'server.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');
|
|
|
|
Server _$ServerFromJson(Map<String, dynamic> json) {
|
|
return _Server.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$Server {
|
|
/// Unique identifier for the server
|
|
String get id => throw _privateConstructorUsedError;
|
|
|
|
/// Display name for the server
|
|
String get name => throw _privateConstructorUsedError;
|
|
|
|
/// Root URL of the server
|
|
String get url => throw _privateConstructorUsedError;
|
|
|
|
/// Optional username for authentication
|
|
String? get username => throw _privateConstructorUsedError;
|
|
|
|
/// Optional password for authentication
|
|
String? get password => throw _privateConstructorUsedError;
|
|
|
|
/// Timestamp when the server was added
|
|
DateTime get createdAt => throw _privateConstructorUsedError;
|
|
|
|
/// Timestamp of the last successful sync
|
|
DateTime? get lastSyncedAt => throw _privateConstructorUsedError;
|
|
|
|
/// Server software type (null = not yet detected)
|
|
ServerSoftwareType? get softwareType => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this Server to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of Server
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$ServerCopyWith<Server> get copyWith => throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $ServerCopyWith<$Res> {
|
|
factory $ServerCopyWith(Server value, $Res Function(Server) then) =
|
|
_$ServerCopyWithImpl<$Res, Server>;
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String name,
|
|
String url,
|
|
String? username,
|
|
String? password,
|
|
DateTime createdAt,
|
|
DateTime? lastSyncedAt,
|
|
ServerSoftwareType? softwareType});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ServerCopyWithImpl<$Res, $Val extends Server>
|
|
implements $ServerCopyWith<$Res> {
|
|
_$ServerCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of Server
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? url = null,
|
|
Object? username = freezed,
|
|
Object? password = freezed,
|
|
Object? createdAt = null,
|
|
Object? lastSyncedAt = freezed,
|
|
Object? softwareType = freezed,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
url: null == url
|
|
? _value.url
|
|
: url // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
password: freezed == password
|
|
? _value.password
|
|
: password // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
createdAt: null == createdAt
|
|
? _value.createdAt
|
|
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime,
|
|
lastSyncedAt: freezed == lastSyncedAt
|
|
? _value.lastSyncedAt
|
|
: lastSyncedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
softwareType: freezed == softwareType
|
|
? _value.softwareType
|
|
: softwareType // ignore: cast_nullable_to_non_nullable
|
|
as ServerSoftwareType?,
|
|
) as $Val);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$ServerImplCopyWith<$Res> implements $ServerCopyWith<$Res> {
|
|
factory _$$ServerImplCopyWith(
|
|
_$ServerImpl value, $Res Function(_$ServerImpl) then) =
|
|
__$$ServerImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call(
|
|
{String id,
|
|
String name,
|
|
String url,
|
|
String? username,
|
|
String? password,
|
|
DateTime createdAt,
|
|
DateTime? lastSyncedAt,
|
|
ServerSoftwareType? softwareType});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$ServerImplCopyWithImpl<$Res>
|
|
extends _$ServerCopyWithImpl<$Res, _$ServerImpl>
|
|
implements _$$ServerImplCopyWith<$Res> {
|
|
__$$ServerImplCopyWithImpl(
|
|
_$ServerImpl _value, $Res Function(_$ServerImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
/// Create a copy of Server
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? url = null,
|
|
Object? username = freezed,
|
|
Object? password = freezed,
|
|
Object? createdAt = null,
|
|
Object? lastSyncedAt = freezed,
|
|
Object? softwareType = freezed,
|
|
}) {
|
|
return _then(_$ServerImpl(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
url: null == url
|
|
? _value.url
|
|
: url // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
password: freezed == password
|
|
? _value.password
|
|
: password // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
createdAt: null == createdAt
|
|
? _value.createdAt
|
|
: createdAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime,
|
|
lastSyncedAt: freezed == lastSyncedAt
|
|
? _value.lastSyncedAt
|
|
: lastSyncedAt // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
softwareType: freezed == softwareType
|
|
? _value.softwareType
|
|
: softwareType // ignore: cast_nullable_to_non_nullable
|
|
as ServerSoftwareType?,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$ServerImpl implements _Server {
|
|
const _$ServerImpl(
|
|
{required this.id,
|
|
required this.name,
|
|
required this.url,
|
|
this.username,
|
|
this.password,
|
|
required this.createdAt,
|
|
this.lastSyncedAt,
|
|
this.softwareType});
|
|
|
|
factory _$ServerImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$ServerImplFromJson(json);
|
|
|
|
/// Unique identifier for the server
|
|
@override
|
|
final String id;
|
|
|
|
/// Display name for the server
|
|
@override
|
|
final String name;
|
|
|
|
/// Root URL of the server
|
|
@override
|
|
final String url;
|
|
|
|
/// Optional username for authentication
|
|
@override
|
|
final String? username;
|
|
|
|
/// Optional password for authentication
|
|
@override
|
|
final String? password;
|
|
|
|
/// Timestamp when the server was added
|
|
@override
|
|
final DateTime createdAt;
|
|
|
|
/// Timestamp of the last successful sync
|
|
@override
|
|
final DateTime? lastSyncedAt;
|
|
|
|
/// Server software type (null = not yet detected)
|
|
@override
|
|
final ServerSoftwareType? softwareType;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'Server(id: $id, name: $name, url: $url, username: $username, password: $password, createdAt: $createdAt, lastSyncedAt: $lastSyncedAt, softwareType: $softwareType)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$ServerImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.name, name) || other.name == name) &&
|
|
(identical(other.url, url) || other.url == url) &&
|
|
(identical(other.username, username) ||
|
|
other.username == username) &&
|
|
(identical(other.password, password) ||
|
|
other.password == password) &&
|
|
(identical(other.createdAt, createdAt) ||
|
|
other.createdAt == createdAt) &&
|
|
(identical(other.lastSyncedAt, lastSyncedAt) ||
|
|
other.lastSyncedAt == lastSyncedAt) &&
|
|
(identical(other.softwareType, softwareType) ||
|
|
other.softwareType == softwareType));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType, id, name, url, username,
|
|
password, createdAt, lastSyncedAt, softwareType);
|
|
|
|
/// Create a copy of Server
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$ServerImplCopyWith<_$ServerImpl> get copyWith =>
|
|
__$$ServerImplCopyWithImpl<_$ServerImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$ServerImplToJson(
|
|
this,
|
|
);
|
|
}
|
|
}
|
|
|
|
abstract class _Server implements Server {
|
|
const factory _Server(
|
|
{required final String id,
|
|
required final String name,
|
|
required final String url,
|
|
final String? username,
|
|
final String? password,
|
|
required final DateTime createdAt,
|
|
final DateTime? lastSyncedAt,
|
|
final ServerSoftwareType? softwareType}) = _$ServerImpl;
|
|
|
|
factory _Server.fromJson(Map<String, dynamic> json) = _$ServerImpl.fromJson;
|
|
|
|
/// Unique identifier for the server
|
|
@override
|
|
String get id;
|
|
|
|
/// Display name for the server
|
|
@override
|
|
String get name;
|
|
|
|
/// Root URL of the server
|
|
@override
|
|
String get url;
|
|
|
|
/// Optional username for authentication
|
|
@override
|
|
String? get username;
|
|
|
|
/// Optional password for authentication
|
|
@override
|
|
String? get password;
|
|
|
|
/// Timestamp when the server was added
|
|
@override
|
|
DateTime get createdAt;
|
|
|
|
/// Timestamp of the last successful sync
|
|
@override
|
|
DateTime? get lastSyncedAt;
|
|
|
|
/// Server software type (null = not yet detected)
|
|
@override
|
|
ServerSoftwareType? get softwareType;
|
|
|
|
/// Create a copy of Server
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$ServerImplCopyWith<_$ServerImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|