torrent fix

This commit is contained in:
royalcat 2024-08-15 11:23:44 +03:00
parent 57ada71d36
commit e517332a65
26 changed files with 2240 additions and 850 deletions

View file

@ -1033,6 +1033,282 @@ class _CopyWithStubImpl$Input$TorrentFilter<TRes>
_res;
}
class Input$TorrentPriorityFilter {
factory Input$TorrentPriorityFilter({
Enum$TorrentPriority? eq,
Enum$TorrentPriority? gt,
Enum$TorrentPriority? lt,
Enum$TorrentPriority? gte,
Enum$TorrentPriority? lte,
List<Enum$TorrentPriority>? $in,
}) =>
Input$TorrentPriorityFilter._({
if (eq != null) r'eq': eq,
if (gt != null) r'gt': gt,
if (lt != null) r'lt': lt,
if (gte != null) r'gte': gte,
if (lte != null) r'lte': lte,
if ($in != null) r'in': $in,
});
Input$TorrentPriorityFilter._(this._$data);
factory Input$TorrentPriorityFilter.fromJson(Map<String, dynamic> data) {
final result$data = <String, dynamic>{};
if (data.containsKey('eq')) {
final l$eq = data['eq'];
result$data['eq'] =
l$eq == null ? null : fromJson$Enum$TorrentPriority((l$eq as String));
}
if (data.containsKey('gt')) {
final l$gt = data['gt'];
result$data['gt'] =
l$gt == null ? null : fromJson$Enum$TorrentPriority((l$gt as String));
}
if (data.containsKey('lt')) {
final l$lt = data['lt'];
result$data['lt'] =
l$lt == null ? null : fromJson$Enum$TorrentPriority((l$lt as String));
}
if (data.containsKey('gte')) {
final l$gte = data['gte'];
result$data['gte'] = l$gte == null
? null
: fromJson$Enum$TorrentPriority((l$gte as String));
}
if (data.containsKey('lte')) {
final l$lte = data['lte'];
result$data['lte'] = l$lte == null
? null
: fromJson$Enum$TorrentPriority((l$lte as String));
}
if (data.containsKey('in')) {
final l$$in = data['in'];
result$data['in'] = (l$$in as List<dynamic>?)
?.map((e) => fromJson$Enum$TorrentPriority((e as String)))
.toList();
}
return Input$TorrentPriorityFilter._(result$data);
}
Map<String, dynamic> _$data;
Enum$TorrentPriority? get eq => (_$data['eq'] as Enum$TorrentPriority?);
Enum$TorrentPriority? get gt => (_$data['gt'] as Enum$TorrentPriority?);
Enum$TorrentPriority? get lt => (_$data['lt'] as Enum$TorrentPriority?);
Enum$TorrentPriority? get gte => (_$data['gte'] as Enum$TorrentPriority?);
Enum$TorrentPriority? get lte => (_$data['lte'] as Enum$TorrentPriority?);
List<Enum$TorrentPriority>? get $in =>
(_$data['in'] as List<Enum$TorrentPriority>?);
Map<String, dynamic> toJson() {
final result$data = <String, dynamic>{};
if (_$data.containsKey('eq')) {
final l$eq = eq;
result$data['eq'] =
l$eq == null ? null : toJson$Enum$TorrentPriority(l$eq);
}
if (_$data.containsKey('gt')) {
final l$gt = gt;
result$data['gt'] =
l$gt == null ? null : toJson$Enum$TorrentPriority(l$gt);
}
if (_$data.containsKey('lt')) {
final l$lt = lt;
result$data['lt'] =
l$lt == null ? null : toJson$Enum$TorrentPriority(l$lt);
}
if (_$data.containsKey('gte')) {
final l$gte = gte;
result$data['gte'] =
l$gte == null ? null : toJson$Enum$TorrentPriority(l$gte);
}
if (_$data.containsKey('lte')) {
final l$lte = lte;
result$data['lte'] =
l$lte == null ? null : toJson$Enum$TorrentPriority(l$lte);
}
if (_$data.containsKey('in')) {
final l$$in = $in;
result$data['in'] =
l$$in?.map((e) => toJson$Enum$TorrentPriority(e)).toList();
}
return result$data;
}
CopyWith$Input$TorrentPriorityFilter<Input$TorrentPriorityFilter>
get copyWith => CopyWith$Input$TorrentPriorityFilter(
this,
(i) => i,
);
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Input$TorrentPriorityFilter) ||
runtimeType != other.runtimeType) {
return false;
}
final l$eq = eq;
final lOther$eq = other.eq;
if (_$data.containsKey('eq') != other._$data.containsKey('eq')) {
return false;
}
if (l$eq != lOther$eq) {
return false;
}
final l$gt = gt;
final lOther$gt = other.gt;
if (_$data.containsKey('gt') != other._$data.containsKey('gt')) {
return false;
}
if (l$gt != lOther$gt) {
return false;
}
final l$lt = lt;
final lOther$lt = other.lt;
if (_$data.containsKey('lt') != other._$data.containsKey('lt')) {
return false;
}
if (l$lt != lOther$lt) {
return false;
}
final l$gte = gte;
final lOther$gte = other.gte;
if (_$data.containsKey('gte') != other._$data.containsKey('gte')) {
return false;
}
if (l$gte != lOther$gte) {
return false;
}
final l$lte = lte;
final lOther$lte = other.lte;
if (_$data.containsKey('lte') != other._$data.containsKey('lte')) {
return false;
}
if (l$lte != lOther$lte) {
return false;
}
final l$$in = $in;
final lOther$$in = other.$in;
if (_$data.containsKey('in') != other._$data.containsKey('in')) {
return false;
}
if (l$$in != null && lOther$$in != null) {
if (l$$in.length != lOther$$in.length) {
return false;
}
for (int i = 0; i < l$$in.length; i++) {
final l$$in$entry = l$$in[i];
final lOther$$in$entry = lOther$$in[i];
if (l$$in$entry != lOther$$in$entry) {
return false;
}
}
} else if (l$$in != lOther$$in) {
return false;
}
return true;
}
@override
int get hashCode {
final l$eq = eq;
final l$gt = gt;
final l$lt = lt;
final l$gte = gte;
final l$lte = lte;
final l$$in = $in;
return Object.hashAll([
_$data.containsKey('eq') ? l$eq : const {},
_$data.containsKey('gt') ? l$gt : const {},
_$data.containsKey('lt') ? l$lt : const {},
_$data.containsKey('gte') ? l$gte : const {},
_$data.containsKey('lte') ? l$lte : const {},
_$data.containsKey('in')
? l$$in == null
? null
: Object.hashAll(l$$in.map((v) => v))
: const {},
]);
}
}
abstract class CopyWith$Input$TorrentPriorityFilter<TRes> {
factory CopyWith$Input$TorrentPriorityFilter(
Input$TorrentPriorityFilter instance,
TRes Function(Input$TorrentPriorityFilter) then,
) = _CopyWithImpl$Input$TorrentPriorityFilter;
factory CopyWith$Input$TorrentPriorityFilter.stub(TRes res) =
_CopyWithStubImpl$Input$TorrentPriorityFilter;
TRes call({
Enum$TorrentPriority? eq,
Enum$TorrentPriority? gt,
Enum$TorrentPriority? lt,
Enum$TorrentPriority? gte,
Enum$TorrentPriority? lte,
List<Enum$TorrentPriority>? $in,
});
}
class _CopyWithImpl$Input$TorrentPriorityFilter<TRes>
implements CopyWith$Input$TorrentPriorityFilter<TRes> {
_CopyWithImpl$Input$TorrentPriorityFilter(
this._instance,
this._then,
);
final Input$TorrentPriorityFilter _instance;
final TRes Function(Input$TorrentPriorityFilter) _then;
static const _undefined = <dynamic, dynamic>{};
TRes call({
Object? eq = _undefined,
Object? gt = _undefined,
Object? lt = _undefined,
Object? gte = _undefined,
Object? lte = _undefined,
Object? $in = _undefined,
}) =>
_then(Input$TorrentPriorityFilter._({
..._instance._$data,
if (eq != _undefined) 'eq': (eq as Enum$TorrentPriority?),
if (gt != _undefined) 'gt': (gt as Enum$TorrentPriority?),
if (lt != _undefined) 'lt': (lt as Enum$TorrentPriority?),
if (gte != _undefined) 'gte': (gte as Enum$TorrentPriority?),
if (lte != _undefined) 'lte': (lte as Enum$TorrentPriority?),
if ($in != _undefined) 'in': ($in as List<Enum$TorrentPriority>?),
}));
}
class _CopyWithStubImpl$Input$TorrentPriorityFilter<TRes>
implements CopyWith$Input$TorrentPriorityFilter<TRes> {
_CopyWithStubImpl$Input$TorrentPriorityFilter(this._res);
TRes _res;
call({
Enum$TorrentPriority? eq,
Enum$TorrentPriority? gt,
Enum$TorrentPriority? lt,
Enum$TorrentPriority? gte,
Enum$TorrentPriority? lte,
List<Enum$TorrentPriority>? $in,
}) =>
_res;
}
class Input$TorrentsFilter {
factory Input$TorrentsFilter({
Input$StringFilter? infohash,
@ -1040,7 +1316,7 @@ class Input$TorrentsFilter {
Input$IntFilter? bytesCompleted,
Input$IntFilter? bytesMissing,
Input$IntFilter? peersCount,
Input$BooleanFilter? downloading,
Input$TorrentPriorityFilter? priority,
}) =>
Input$TorrentsFilter._({
if (infohash != null) r'infohash': infohash,
@ -1048,7 +1324,7 @@ class Input$TorrentsFilter {
if (bytesCompleted != null) r'bytesCompleted': bytesCompleted,
if (bytesMissing != null) r'bytesMissing': bytesMissing,
if (peersCount != null) r'peersCount': peersCount,
if (downloading != null) r'downloading': downloading,
if (priority != null) r'priority': priority,
});
Input$TorrentsFilter._(this._$data);
@ -1086,12 +1362,12 @@ class Input$TorrentsFilter {
? null
: Input$IntFilter.fromJson((l$peersCount as Map<String, dynamic>));
}
if (data.containsKey('downloading')) {
final l$downloading = data['downloading'];
result$data['downloading'] = l$downloading == null
if (data.containsKey('priority')) {
final l$priority = data['priority'];
result$data['priority'] = l$priority == null
? null
: Input$BooleanFilter.fromJson(
(l$downloading as Map<String, dynamic>));
: Input$TorrentPriorityFilter.fromJson(
(l$priority as Map<String, dynamic>));
}
return Input$TorrentsFilter._(result$data);
}
@ -1111,8 +1387,8 @@ class Input$TorrentsFilter {
Input$IntFilter? get peersCount => (_$data['peersCount'] as Input$IntFilter?);
Input$BooleanFilter? get downloading =>
(_$data['downloading'] as Input$BooleanFilter?);
Input$TorrentPriorityFilter? get priority =>
(_$data['priority'] as Input$TorrentPriorityFilter?);
Map<String, dynamic> toJson() {
final result$data = <String, dynamic>{};
@ -1136,9 +1412,9 @@ class Input$TorrentsFilter {
final l$peersCount = peersCount;
result$data['peersCount'] = l$peersCount?.toJson();
}
if (_$data.containsKey('downloading')) {
final l$downloading = downloading;
result$data['downloading'] = l$downloading?.toJson();
if (_$data.containsKey('priority')) {
final l$priority = priority;
result$data['priority'] = l$priority?.toJson();
}
return result$data;
}
@ -1201,13 +1477,13 @@ class Input$TorrentsFilter {
if (l$peersCount != lOther$peersCount) {
return false;
}
final l$downloading = downloading;
final lOther$downloading = other.downloading;
if (_$data.containsKey('downloading') !=
other._$data.containsKey('downloading')) {
final l$priority = priority;
final lOther$priority = other.priority;
if (_$data.containsKey('priority') !=
other._$data.containsKey('priority')) {
return false;
}
if (l$downloading != lOther$downloading) {
if (l$priority != lOther$priority) {
return false;
}
return true;
@ -1220,14 +1496,14 @@ class Input$TorrentsFilter {
final l$bytesCompleted = bytesCompleted;
final l$bytesMissing = bytesMissing;
final l$peersCount = peersCount;
final l$downloading = downloading;
final l$priority = priority;
return Object.hashAll([
_$data.containsKey('infohash') ? l$infohash : const {},
_$data.containsKey('name') ? l$name : const {},
_$data.containsKey('bytesCompleted') ? l$bytesCompleted : const {},
_$data.containsKey('bytesMissing') ? l$bytesMissing : const {},
_$data.containsKey('peersCount') ? l$peersCount : const {},
_$data.containsKey('downloading') ? l$downloading : const {},
_$data.containsKey('priority') ? l$priority : const {},
]);
}
}
@ -1247,14 +1523,14 @@ abstract class CopyWith$Input$TorrentsFilter<TRes> {
Input$IntFilter? bytesCompleted,
Input$IntFilter? bytesMissing,
Input$IntFilter? peersCount,
Input$BooleanFilter? downloading,
Input$TorrentPriorityFilter? priority,
});
CopyWith$Input$StringFilter<TRes> get infohash;
CopyWith$Input$StringFilter<TRes> get name;
CopyWith$Input$IntFilter<TRes> get bytesCompleted;
CopyWith$Input$IntFilter<TRes> get bytesMissing;
CopyWith$Input$IntFilter<TRes> get peersCount;
CopyWith$Input$BooleanFilter<TRes> get downloading;
CopyWith$Input$TorrentPriorityFilter<TRes> get priority;
}
class _CopyWithImpl$Input$TorrentsFilter<TRes>
@ -1276,7 +1552,7 @@ class _CopyWithImpl$Input$TorrentsFilter<TRes>
Object? bytesCompleted = _undefined,
Object? bytesMissing = _undefined,
Object? peersCount = _undefined,
Object? downloading = _undefined,
Object? priority = _undefined,
}) =>
_then(Input$TorrentsFilter._({
..._instance._$data,
@ -1289,8 +1565,8 @@ class _CopyWithImpl$Input$TorrentsFilter<TRes>
'bytesMissing': (bytesMissing as Input$IntFilter?),
if (peersCount != _undefined)
'peersCount': (peersCount as Input$IntFilter?),
if (downloading != _undefined)
'downloading': (downloading as Input$BooleanFilter?),
if (priority != _undefined)
'priority': (priority as Input$TorrentPriorityFilter?),
}));
CopyWith$Input$StringFilter<TRes> get infohash {
@ -1331,12 +1607,12 @@ class _CopyWithImpl$Input$TorrentsFilter<TRes>
local$peersCount, (e) => call(peersCount: e));
}
CopyWith$Input$BooleanFilter<TRes> get downloading {
final local$downloading = _instance.downloading;
return local$downloading == null
? CopyWith$Input$BooleanFilter.stub(_then(_instance))
: CopyWith$Input$BooleanFilter(
local$downloading, (e) => call(downloading: e));
CopyWith$Input$TorrentPriorityFilter<TRes> get priority {
final local$priority = _instance.priority;
return local$priority == null
? CopyWith$Input$TorrentPriorityFilter.stub(_then(_instance))
: CopyWith$Input$TorrentPriorityFilter(
local$priority, (e) => call(priority: e));
}
}
@ -1352,7 +1628,7 @@ class _CopyWithStubImpl$Input$TorrentsFilter<TRes>
Input$IntFilter? bytesCompleted,
Input$IntFilter? bytesMissing,
Input$IntFilter? peersCount,
Input$BooleanFilter? downloading,
Input$TorrentPriorityFilter? priority,
}) =>
_res;
@ -1371,8 +1647,56 @@ class _CopyWithStubImpl$Input$TorrentsFilter<TRes>
CopyWith$Input$IntFilter<TRes> get peersCount =>
CopyWith$Input$IntFilter.stub(_res);
CopyWith$Input$BooleanFilter<TRes> get downloading =>
CopyWith$Input$BooleanFilter.stub(_res);
CopyWith$Input$TorrentPriorityFilter<TRes> get priority =>
CopyWith$Input$TorrentPriorityFilter.stub(_res);
}
enum Enum$TorrentPriority {
NONE,
NORMAL,
HIGH,
READAHEAD,
NOW,
$unknown;
factory Enum$TorrentPriority.fromJson(String value) =>
fromJson$Enum$TorrentPriority(value);
String toJson() => toJson$Enum$TorrentPriority(this);
}
String toJson$Enum$TorrentPriority(Enum$TorrentPriority e) {
switch (e) {
case Enum$TorrentPriority.NONE:
return r'NONE';
case Enum$TorrentPriority.NORMAL:
return r'NORMAL';
case Enum$TorrentPriority.HIGH:
return r'HIGH';
case Enum$TorrentPriority.READAHEAD:
return r'READAHEAD';
case Enum$TorrentPriority.NOW:
return r'NOW';
case Enum$TorrentPriority.$unknown:
return r'$unknown';
}
}
Enum$TorrentPriority fromJson$Enum$TorrentPriority(String value) {
switch (value) {
case r'NONE':
return Enum$TorrentPriority.NONE;
case r'NORMAL':
return Enum$TorrentPriority.NORMAL;
case r'HIGH':
return Enum$TorrentPriority.HIGH;
case r'READAHEAD':
return Enum$TorrentPriority.READAHEAD;
case r'NOW':
return Enum$TorrentPriority.NOW;
default:
return Enum$TorrentPriority.$unknown;
}
}
enum Enum$__TypeKind {

View file

@ -1,25 +1,21 @@
mutation MarkTorrentDownload($infohash: String!) {
downloadTorrent(infohash: $infohash) {
task {
id
}
mutation MarkTorrentDownload($infohash: String!, $priority: TorrentPriority! = NORMAL) {
torrentDaemon {
setTorrentPriority(infohash: $infohash, priority: $priority)
}
}
query ListTorrents($downloading: Boolean) {
torrents(filter: {
downloading: {
eq: $downloading
}
}) {
name
infohash
bytesCompleted
bytesMissing
peers {
ip
downloadRate
clientName
query ListTorrents {
torrentDaemon {
torrents {
name
infohash
bytesCompleted
bytesMissing
peers {
ip
downloadRate
clientName
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
query TorrentTotalStats($since: DateTime!) {
torrentDaemon {
statsHistory(since: $since) {
timestamp
downloadedBytes
uploadedBytes
totalPeers
activePeers
connectedSeeders
}
}
}

View file

@ -0,0 +1,901 @@
// ignore_for_file: type=lint
import 'dart:async';
import 'package:flutter/widgets.dart' as widgets;
import 'package:gql/ast.dart';
import 'package:graphql/client.dart' as graphql;
import 'package:graphql_flutter/graphql_flutter.dart' as graphql_flutter;
class Variables$Query$TorrentTotalStats {
factory Variables$Query$TorrentTotalStats({required DateTime since}) =>
Variables$Query$TorrentTotalStats._({
r'since': since,
});
Variables$Query$TorrentTotalStats._(this._$data);
factory Variables$Query$TorrentTotalStats.fromJson(
Map<String, dynamic> data) {
final result$data = <String, dynamic>{};
final l$since = data['since'];
result$data['since'] = DateTime.parse((l$since as String));
return Variables$Query$TorrentTotalStats._(result$data);
}
Map<String, dynamic> _$data;
DateTime get since => (_$data['since'] as DateTime);
Map<String, dynamic> toJson() {
final result$data = <String, dynamic>{};
final l$since = since;
result$data['since'] = l$since.toIso8601String();
return result$data;
}
CopyWith$Variables$Query$TorrentTotalStats<Variables$Query$TorrentTotalStats>
get copyWith => CopyWith$Variables$Query$TorrentTotalStats(
this,
(i) => i,
);
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Variables$Query$TorrentTotalStats) ||
runtimeType != other.runtimeType) {
return false;
}
final l$since = since;
final lOther$since = other.since;
if (l$since != lOther$since) {
return false;
}
return true;
}
@override
int get hashCode {
final l$since = since;
return Object.hashAll([l$since]);
}
}
abstract class CopyWith$Variables$Query$TorrentTotalStats<TRes> {
factory CopyWith$Variables$Query$TorrentTotalStats(
Variables$Query$TorrentTotalStats instance,
TRes Function(Variables$Query$TorrentTotalStats) then,
) = _CopyWithImpl$Variables$Query$TorrentTotalStats;
factory CopyWith$Variables$Query$TorrentTotalStats.stub(TRes res) =
_CopyWithStubImpl$Variables$Query$TorrentTotalStats;
TRes call({DateTime? since});
}
class _CopyWithImpl$Variables$Query$TorrentTotalStats<TRes>
implements CopyWith$Variables$Query$TorrentTotalStats<TRes> {
_CopyWithImpl$Variables$Query$TorrentTotalStats(
this._instance,
this._then,
);
final Variables$Query$TorrentTotalStats _instance;
final TRes Function(Variables$Query$TorrentTotalStats) _then;
static const _undefined = <dynamic, dynamic>{};
TRes call({Object? since = _undefined}) =>
_then(Variables$Query$TorrentTotalStats._({
..._instance._$data,
if (since != _undefined && since != null) 'since': (since as DateTime),
}));
}
class _CopyWithStubImpl$Variables$Query$TorrentTotalStats<TRes>
implements CopyWith$Variables$Query$TorrentTotalStats<TRes> {
_CopyWithStubImpl$Variables$Query$TorrentTotalStats(this._res);
TRes _res;
call({DateTime? since}) => _res;
}
class Query$TorrentTotalStats {
Query$TorrentTotalStats({
this.torrentDaemon,
this.$__typename = 'Query',
});
factory Query$TorrentTotalStats.fromJson(Map<String, dynamic> json) {
final l$torrentDaemon = json['torrentDaemon'];
final l$$__typename = json['__typename'];
return Query$TorrentTotalStats(
torrentDaemon: l$torrentDaemon == null
? null
: Query$TorrentTotalStats$torrentDaemon.fromJson(
(l$torrentDaemon as Map<String, dynamic>)),
$__typename: (l$$__typename as String),
);
}
final Query$TorrentTotalStats$torrentDaemon? torrentDaemon;
final String $__typename;
Map<String, dynamic> toJson() {
final _resultData = <String, dynamic>{};
final l$torrentDaemon = torrentDaemon;
_resultData['torrentDaemon'] = l$torrentDaemon?.toJson();
final l$$__typename = $__typename;
_resultData['__typename'] = l$$__typename;
return _resultData;
}
@override
int get hashCode {
final l$torrentDaemon = torrentDaemon;
final l$$__typename = $__typename;
return Object.hashAll([
l$torrentDaemon,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Query$TorrentTotalStats) ||
runtimeType != other.runtimeType) {
return false;
}
final l$torrentDaemon = torrentDaemon;
final lOther$torrentDaemon = other.torrentDaemon;
if (l$torrentDaemon != lOther$torrentDaemon) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$TorrentTotalStats on Query$TorrentTotalStats {
CopyWith$Query$TorrentTotalStats<Query$TorrentTotalStats> get copyWith =>
CopyWith$Query$TorrentTotalStats(
this,
(i) => i,
);
}
abstract class CopyWith$Query$TorrentTotalStats<TRes> {
factory CopyWith$Query$TorrentTotalStats(
Query$TorrentTotalStats instance,
TRes Function(Query$TorrentTotalStats) then,
) = _CopyWithImpl$Query$TorrentTotalStats;
factory CopyWith$Query$TorrentTotalStats.stub(TRes res) =
_CopyWithStubImpl$Query$TorrentTotalStats;
TRes call({
Query$TorrentTotalStats$torrentDaemon? torrentDaemon,
String? $__typename,
});
CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> get torrentDaemon;
}
class _CopyWithImpl$Query$TorrentTotalStats<TRes>
implements CopyWith$Query$TorrentTotalStats<TRes> {
_CopyWithImpl$Query$TorrentTotalStats(
this._instance,
this._then,
);
final Query$TorrentTotalStats _instance;
final TRes Function(Query$TorrentTotalStats) _then;
static const _undefined = <dynamic, dynamic>{};
TRes call({
Object? torrentDaemon = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Query$TorrentTotalStats(
torrentDaemon: torrentDaemon == _undefined
? _instance.torrentDaemon
: (torrentDaemon as Query$TorrentTotalStats$torrentDaemon?),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> get torrentDaemon {
final local$torrentDaemon = _instance.torrentDaemon;
return local$torrentDaemon == null
? CopyWith$Query$TorrentTotalStats$torrentDaemon.stub(_then(_instance))
: CopyWith$Query$TorrentTotalStats$torrentDaemon(
local$torrentDaemon, (e) => call(torrentDaemon: e));
}
}
class _CopyWithStubImpl$Query$TorrentTotalStats<TRes>
implements CopyWith$Query$TorrentTotalStats<TRes> {
_CopyWithStubImpl$Query$TorrentTotalStats(this._res);
TRes _res;
call({
Query$TorrentTotalStats$torrentDaemon? torrentDaemon,
String? $__typename,
}) =>
_res;
CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> get torrentDaemon =>
CopyWith$Query$TorrentTotalStats$torrentDaemon.stub(_res);
}
const documentNodeQueryTorrentTotalStats = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'TorrentTotalStats'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'since')),
type: NamedTypeNode(
name: NameNode(value: 'DateTime'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'torrentDaemon'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'statsHistory'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'since'),
value: VariableNode(name: NameNode(value: 'since')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'timestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'downloadedBytes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'uploadedBytes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'totalPeers'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'activePeers'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'connectedSeeders'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
Query$TorrentTotalStats _parserFn$Query$TorrentTotalStats(
Map<String, dynamic> data) =>
Query$TorrentTotalStats.fromJson(data);
typedef OnQueryComplete$Query$TorrentTotalStats = FutureOr<void> Function(
Map<String, dynamic>?,
Query$TorrentTotalStats?,
);
class Options$Query$TorrentTotalStats
extends graphql.QueryOptions<Query$TorrentTotalStats> {
Options$Query$TorrentTotalStats({
String? operationName,
required Variables$Query$TorrentTotalStats variables,
graphql.FetchPolicy? fetchPolicy,
graphql.ErrorPolicy? errorPolicy,
graphql.CacheRereadPolicy? cacheRereadPolicy,
Object? optimisticResult,
Query$TorrentTotalStats? typedOptimisticResult,
Duration? pollInterval,
graphql.Context? context,
OnQueryComplete$Query$TorrentTotalStats? onComplete,
graphql.OnQueryError? onError,
}) : onCompleteWithParsed = onComplete,
super(
variables: variables.toJson(),
operationName: operationName,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
cacheRereadPolicy: cacheRereadPolicy,
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
pollInterval: pollInterval,
context: context,
onComplete: onComplete == null
? null
: (data) => onComplete(
data,
data == null
? null
: _parserFn$Query$TorrentTotalStats(data),
),
onError: onError,
document: documentNodeQueryTorrentTotalStats,
parserFn: _parserFn$Query$TorrentTotalStats,
);
final OnQueryComplete$Query$TorrentTotalStats? onCompleteWithParsed;
@override
List<Object?> get properties => [
...super.onComplete == null
? super.properties
: super.properties.where((property) => property != onComplete),
onCompleteWithParsed,
];
}
class WatchOptions$Query$TorrentTotalStats
extends graphql.WatchQueryOptions<Query$TorrentTotalStats> {
WatchOptions$Query$TorrentTotalStats({
String? operationName,
required Variables$Query$TorrentTotalStats variables,
graphql.FetchPolicy? fetchPolicy,
graphql.ErrorPolicy? errorPolicy,
graphql.CacheRereadPolicy? cacheRereadPolicy,
Object? optimisticResult,
Query$TorrentTotalStats? typedOptimisticResult,
graphql.Context? context,
Duration? pollInterval,
bool? eagerlyFetchResults,
bool carryForwardDataOnException = true,
bool fetchResults = false,
}) : super(
variables: variables.toJson(),
operationName: operationName,
fetchPolicy: fetchPolicy,
errorPolicy: errorPolicy,
cacheRereadPolicy: cacheRereadPolicy,
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
context: context,
document: documentNodeQueryTorrentTotalStats,
pollInterval: pollInterval,
eagerlyFetchResults: eagerlyFetchResults,
carryForwardDataOnException: carryForwardDataOnException,
fetchResults: fetchResults,
parserFn: _parserFn$Query$TorrentTotalStats,
);
}
class FetchMoreOptions$Query$TorrentTotalStats
extends graphql.FetchMoreOptions {
FetchMoreOptions$Query$TorrentTotalStats({
required graphql.UpdateQuery updateQuery,
required Variables$Query$TorrentTotalStats variables,
}) : super(
updateQuery: updateQuery,
variables: variables.toJson(),
document: documentNodeQueryTorrentTotalStats,
);
}
extension ClientExtension$Query$TorrentTotalStats on graphql.GraphQLClient {
Future<graphql.QueryResult<Query$TorrentTotalStats>> query$TorrentTotalStats(
Options$Query$TorrentTotalStats options) async =>
await this.query(options);
graphql.ObservableQuery<Query$TorrentTotalStats> watchQuery$TorrentTotalStats(
WatchOptions$Query$TorrentTotalStats options) =>
this.watchQuery(options);
void writeQuery$TorrentTotalStats({
required Query$TorrentTotalStats data,
required Variables$Query$TorrentTotalStats variables,
bool broadcast = true,
}) =>
this.writeQuery(
graphql.Request(
operation:
graphql.Operation(document: documentNodeQueryTorrentTotalStats),
variables: variables.toJson(),
),
data: data.toJson(),
broadcast: broadcast,
);
Query$TorrentTotalStats? readQuery$TorrentTotalStats({
required Variables$Query$TorrentTotalStats variables,
bool optimistic = true,
}) {
final result = this.readQuery(
graphql.Request(
operation:
graphql.Operation(document: documentNodeQueryTorrentTotalStats),
variables: variables.toJson(),
),
optimistic: optimistic,
);
return result == null ? null : Query$TorrentTotalStats.fromJson(result);
}
}
graphql_flutter.QueryHookResult<Query$TorrentTotalStats>
useQuery$TorrentTotalStats(Options$Query$TorrentTotalStats options) =>
graphql_flutter.useQuery(options);
graphql.ObservableQuery<Query$TorrentTotalStats>
useWatchQuery$TorrentTotalStats(
WatchOptions$Query$TorrentTotalStats options) =>
graphql_flutter.useWatchQuery(options);
class Query$TorrentTotalStats$Widget
extends graphql_flutter.Query<Query$TorrentTotalStats> {
Query$TorrentTotalStats$Widget({
widgets.Key? key,
required Options$Query$TorrentTotalStats options,
required graphql_flutter.QueryBuilder<Query$TorrentTotalStats> builder,
}) : super(
key: key,
options: options,
builder: builder,
);
}
class Query$TorrentTotalStats$torrentDaemon {
Query$TorrentTotalStats$torrentDaemon({
required this.statsHistory,
this.$__typename = 'TorrentDaemonQuery',
});
factory Query$TorrentTotalStats$torrentDaemon.fromJson(
Map<String, dynamic> json) {
final l$statsHistory = json['statsHistory'];
final l$$__typename = json['__typename'];
return Query$TorrentTotalStats$torrentDaemon(
statsHistory: (l$statsHistory as List<dynamic>)
.map((e) =>
Query$TorrentTotalStats$torrentDaemon$statsHistory.fromJson(
(e as Map<String, dynamic>)))
.toList(),
$__typename: (l$$__typename as String),
);
}
final List<Query$TorrentTotalStats$torrentDaemon$statsHistory> statsHistory;
final String $__typename;
Map<String, dynamic> toJson() {
final _resultData = <String, dynamic>{};
final l$statsHistory = statsHistory;
_resultData['statsHistory'] =
l$statsHistory.map((e) => e.toJson()).toList();
final l$$__typename = $__typename;
_resultData['__typename'] = l$$__typename;
return _resultData;
}
@override
int get hashCode {
final l$statsHistory = statsHistory;
final l$$__typename = $__typename;
return Object.hashAll([
Object.hashAll(l$statsHistory.map((v) => v)),
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Query$TorrentTotalStats$torrentDaemon) ||
runtimeType != other.runtimeType) {
return false;
}
final l$statsHistory = statsHistory;
final lOther$statsHistory = other.statsHistory;
if (l$statsHistory.length != lOther$statsHistory.length) {
return false;
}
for (int i = 0; i < l$statsHistory.length; i++) {
final l$statsHistory$entry = l$statsHistory[i];
final lOther$statsHistory$entry = lOther$statsHistory[i];
if (l$statsHistory$entry != lOther$statsHistory$entry) {
return false;
}
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$TorrentTotalStats$torrentDaemon
on Query$TorrentTotalStats$torrentDaemon {
CopyWith$Query$TorrentTotalStats$torrentDaemon<
Query$TorrentTotalStats$torrentDaemon>
get copyWith => CopyWith$Query$TorrentTotalStats$torrentDaemon(
this,
(i) => i,
);
}
abstract class CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> {
factory CopyWith$Query$TorrentTotalStats$torrentDaemon(
Query$TorrentTotalStats$torrentDaemon instance,
TRes Function(Query$TorrentTotalStats$torrentDaemon) then,
) = _CopyWithImpl$Query$TorrentTotalStats$torrentDaemon;
factory CopyWith$Query$TorrentTotalStats$torrentDaemon.stub(TRes res) =
_CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon;
TRes call({
List<Query$TorrentTotalStats$torrentDaemon$statsHistory>? statsHistory,
String? $__typename,
});
TRes statsHistory(
Iterable<Query$TorrentTotalStats$torrentDaemon$statsHistory> Function(
Iterable<
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<
Query$TorrentTotalStats$torrentDaemon$statsHistory>>)
_fn);
}
class _CopyWithImpl$Query$TorrentTotalStats$torrentDaemon<TRes>
implements CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> {
_CopyWithImpl$Query$TorrentTotalStats$torrentDaemon(
this._instance,
this._then,
);
final Query$TorrentTotalStats$torrentDaemon _instance;
final TRes Function(Query$TorrentTotalStats$torrentDaemon) _then;
static const _undefined = <dynamic, dynamic>{};
TRes call({
Object? statsHistory = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Query$TorrentTotalStats$torrentDaemon(
statsHistory: statsHistory == _undefined || statsHistory == null
? _instance.statsHistory
: (statsHistory
as List<Query$TorrentTotalStats$torrentDaemon$statsHistory>),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
TRes statsHistory(
Iterable<Query$TorrentTotalStats$torrentDaemon$statsHistory> Function(
Iterable<
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<
Query$TorrentTotalStats$torrentDaemon$statsHistory>>)
_fn) =>
call(
statsHistory: _fn(_instance.statsHistory.map((e) =>
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory(
e,
(i) => i,
))).toList());
}
class _CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon<TRes>
implements CopyWith$Query$TorrentTotalStats$torrentDaemon<TRes> {
_CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon(this._res);
TRes _res;
call({
List<Query$TorrentTotalStats$torrentDaemon$statsHistory>? statsHistory,
String? $__typename,
}) =>
_res;
statsHistory(_fn) => _res;
}
class Query$TorrentTotalStats$torrentDaemon$statsHistory {
Query$TorrentTotalStats$torrentDaemon$statsHistory({
required this.timestamp,
required this.downloadedBytes,
required this.uploadedBytes,
required this.totalPeers,
required this.activePeers,
required this.connectedSeeders,
this.$__typename = 'TorrentStats',
});
factory Query$TorrentTotalStats$torrentDaemon$statsHistory.fromJson(
Map<String, dynamic> json) {
final l$timestamp = json['timestamp'];
final l$downloadedBytes = json['downloadedBytes'];
final l$uploadedBytes = json['uploadedBytes'];
final l$totalPeers = json['totalPeers'];
final l$activePeers = json['activePeers'];
final l$connectedSeeders = json['connectedSeeders'];
final l$$__typename = json['__typename'];
return Query$TorrentTotalStats$torrentDaemon$statsHistory(
timestamp: DateTime.parse((l$timestamp as String)),
downloadedBytes: (l$downloadedBytes as int),
uploadedBytes: (l$uploadedBytes as int),
totalPeers: (l$totalPeers as int),
activePeers: (l$activePeers as int),
connectedSeeders: (l$connectedSeeders as int),
$__typename: (l$$__typename as String),
);
}
final DateTime timestamp;
final int downloadedBytes;
final int uploadedBytes;
final int totalPeers;
final int activePeers;
final int connectedSeeders;
final String $__typename;
Map<String, dynamic> toJson() {
final _resultData = <String, dynamic>{};
final l$timestamp = timestamp;
_resultData['timestamp'] = l$timestamp.toIso8601String();
final l$downloadedBytes = downloadedBytes;
_resultData['downloadedBytes'] = l$downloadedBytes;
final l$uploadedBytes = uploadedBytes;
_resultData['uploadedBytes'] = l$uploadedBytes;
final l$totalPeers = totalPeers;
_resultData['totalPeers'] = l$totalPeers;
final l$activePeers = activePeers;
_resultData['activePeers'] = l$activePeers;
final l$connectedSeeders = connectedSeeders;
_resultData['connectedSeeders'] = l$connectedSeeders;
final l$$__typename = $__typename;
_resultData['__typename'] = l$$__typename;
return _resultData;
}
@override
int get hashCode {
final l$timestamp = timestamp;
final l$downloadedBytes = downloadedBytes;
final l$uploadedBytes = uploadedBytes;
final l$totalPeers = totalPeers;
final l$activePeers = activePeers;
final l$connectedSeeders = connectedSeeders;
final l$$__typename = $__typename;
return Object.hashAll([
l$timestamp,
l$downloadedBytes,
l$uploadedBytes,
l$totalPeers,
l$activePeers,
l$connectedSeeders,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Query$TorrentTotalStats$torrentDaemon$statsHistory) ||
runtimeType != other.runtimeType) {
return false;
}
final l$timestamp = timestamp;
final lOther$timestamp = other.timestamp;
if (l$timestamp != lOther$timestamp) {
return false;
}
final l$downloadedBytes = downloadedBytes;
final lOther$downloadedBytes = other.downloadedBytes;
if (l$downloadedBytes != lOther$downloadedBytes) {
return false;
}
final l$uploadedBytes = uploadedBytes;
final lOther$uploadedBytes = other.uploadedBytes;
if (l$uploadedBytes != lOther$uploadedBytes) {
return false;
}
final l$totalPeers = totalPeers;
final lOther$totalPeers = other.totalPeers;
if (l$totalPeers != lOther$totalPeers) {
return false;
}
final l$activePeers = activePeers;
final lOther$activePeers = other.activePeers;
if (l$activePeers != lOther$activePeers) {
return false;
}
final l$connectedSeeders = connectedSeeders;
final lOther$connectedSeeders = other.connectedSeeders;
if (l$connectedSeeders != lOther$connectedSeeders) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$TorrentTotalStats$torrentDaemon$statsHistory
on Query$TorrentTotalStats$torrentDaemon$statsHistory {
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<
Query$TorrentTotalStats$torrentDaemon$statsHistory>
get copyWith =>
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory(
this,
(i) => i,
);
}
abstract class CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<
TRes> {
factory CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory(
Query$TorrentTotalStats$torrentDaemon$statsHistory instance,
TRes Function(Query$TorrentTotalStats$torrentDaemon$statsHistory) then,
) = _CopyWithImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory;
factory CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory.stub(
TRes res) =
_CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory;
TRes call({
DateTime? timestamp,
int? downloadedBytes,
int? uploadedBytes,
int? totalPeers,
int? activePeers,
int? connectedSeeders,
String? $__typename,
});
}
class _CopyWithImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory<TRes>
implements
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<TRes> {
_CopyWithImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory(
this._instance,
this._then,
);
final Query$TorrentTotalStats$torrentDaemon$statsHistory _instance;
final TRes Function(Query$TorrentTotalStats$torrentDaemon$statsHistory) _then;
static const _undefined = <dynamic, dynamic>{};
TRes call({
Object? timestamp = _undefined,
Object? downloadedBytes = _undefined,
Object? uploadedBytes = _undefined,
Object? totalPeers = _undefined,
Object? activePeers = _undefined,
Object? connectedSeeders = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Query$TorrentTotalStats$torrentDaemon$statsHistory(
timestamp: timestamp == _undefined || timestamp == null
? _instance.timestamp
: (timestamp as DateTime),
downloadedBytes:
downloadedBytes == _undefined || downloadedBytes == null
? _instance.downloadedBytes
: (downloadedBytes as int),
uploadedBytes: uploadedBytes == _undefined || uploadedBytes == null
? _instance.uploadedBytes
: (uploadedBytes as int),
totalPeers: totalPeers == _undefined || totalPeers == null
? _instance.totalPeers
: (totalPeers as int),
activePeers: activePeers == _undefined || activePeers == null
? _instance.activePeers
: (activePeers as int),
connectedSeeders:
connectedSeeders == _undefined || connectedSeeders == null
? _instance.connectedSeeders
: (connectedSeeders as int),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
}
class _CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory<TRes>
implements
CopyWith$Query$TorrentTotalStats$torrentDaemon$statsHistory<TRes> {
_CopyWithStubImpl$Query$TorrentTotalStats$torrentDaemon$statsHistory(
this._res);
TRes _res;
call({
DateTime? timestamp,
int? downloadedBytes,
int? uploadedBytes,
int? totalPeers,
int? activePeers,
int? connectedSeeders,
String? $__typename,
}) =>
_res;
}