diff --git a/lib/database/app_database.g.dart b/lib/database/app_database.g.dart index db269630..6844c0e6 100644 --- a/lib/database/app_database.g.dart +++ b/lib/database/app_database.g.dart @@ -3,8 +3,7 @@ part of 'app_database.dart'; // ignore_for_file: type=lint -class $DownloadedMediaTable extends DownloadedMedia - with TableInfo<$DownloadedMediaTable, DownloadedMediaItem> { +class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMediaTable, DownloadedMediaItem> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -18,13 +17,9 @@ class $DownloadedMediaTable extends DownloadedMedia hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'PRIMARY KEY AUTOINCREMENT', - ), - ); - static const VerificationMeta _serverIdMeta = const VerificationMeta( - 'serverId', + defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), ); + static const VerificationMeta _serverIdMeta = const VerificationMeta('serverId'); @override late final GeneratedColumn serverId = GeneratedColumn( 'server_id', @@ -33,9 +28,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _ratingKeyMeta = const VerificationMeta( - 'ratingKey', - ); + static const VerificationMeta _ratingKeyMeta = const VerificationMeta('ratingKey'); @override late final GeneratedColumn ratingKey = GeneratedColumn( 'rating_key', @@ -44,9 +37,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _globalKeyMeta = const VerificationMeta( - 'globalKey', - ); + static const VerificationMeta _globalKeyMeta = const VerificationMeta('globalKey'); @override late final GeneratedColumn globalKey = GeneratedColumn( 'global_key', @@ -65,9 +56,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _parentRatingKeyMeta = const VerificationMeta( - 'parentRatingKey', - ); + static const VerificationMeta _parentRatingKeyMeta = const VerificationMeta('parentRatingKey'); @override late final GeneratedColumn parentRatingKey = GeneratedColumn( 'parent_rating_key', @@ -76,17 +65,15 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: false, ); - static const VerificationMeta _grandparentRatingKeyMeta = - const VerificationMeta('grandparentRatingKey'); + static const VerificationMeta _grandparentRatingKeyMeta = const VerificationMeta('grandparentRatingKey'); @override - late final GeneratedColumn grandparentRatingKey = - GeneratedColumn( - 'grandparent_rating_key', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); + late final GeneratedColumn grandparentRatingKey = GeneratedColumn( + 'grandparent_rating_key', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ); static const VerificationMeta _statusMeta = const VerificationMeta('status'); @override late final GeneratedColumn status = GeneratedColumn( @@ -96,9 +83,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _progressMeta = const VerificationMeta( - 'progress', - ); + static const VerificationMeta _progressMeta = const VerificationMeta('progress'); @override late final GeneratedColumn progress = GeneratedColumn( 'progress', @@ -108,9 +93,7 @@ class $DownloadedMediaTable extends DownloadedMedia requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _totalBytesMeta = const VerificationMeta( - 'totalBytes', - ); + static const VerificationMeta _totalBytesMeta = const VerificationMeta('totalBytes'); @override late final GeneratedColumn totalBytes = GeneratedColumn( 'total_bytes', @@ -119,9 +102,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.int, requiredDuringInsert: false, ); - static const VerificationMeta _downloadedBytesMeta = const VerificationMeta( - 'downloadedBytes', - ); + static const VerificationMeta _downloadedBytesMeta = const VerificationMeta('downloadedBytes'); @override late final GeneratedColumn downloadedBytes = GeneratedColumn( 'downloaded_bytes', @@ -131,9 +112,7 @@ class $DownloadedMediaTable extends DownloadedMedia requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _videoFilePathMeta = const VerificationMeta( - 'videoFilePath', - ); + static const VerificationMeta _videoFilePathMeta = const VerificationMeta('videoFilePath'); @override late final GeneratedColumn videoFilePath = GeneratedColumn( 'video_file_path', @@ -142,9 +121,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: false, ); - static const VerificationMeta _thumbPathMeta = const VerificationMeta( - 'thumbPath', - ); + static const VerificationMeta _thumbPathMeta = const VerificationMeta('thumbPath'); @override late final GeneratedColumn thumbPath = GeneratedColumn( 'thumb_path', @@ -153,9 +130,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: false, ); - static const VerificationMeta _downloadedAtMeta = const VerificationMeta( - 'downloadedAt', - ); + static const VerificationMeta _downloadedAtMeta = const VerificationMeta('downloadedAt'); @override late final GeneratedColumn downloadedAt = GeneratedColumn( 'downloaded_at', @@ -164,9 +139,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.int, requiredDuringInsert: false, ); - static const VerificationMeta _errorMessageMeta = const VerificationMeta( - 'errorMessage', - ); + static const VerificationMeta _errorMessageMeta = const VerificationMeta('errorMessage'); @override late final GeneratedColumn errorMessage = GeneratedColumn( 'error_message', @@ -175,9 +148,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: false, ); - static const VerificationMeta _retryCountMeta = const VerificationMeta( - 'retryCount', - ); + static const VerificationMeta _retryCountMeta = const VerificationMeta('retryCount'); @override late final GeneratedColumn retryCount = GeneratedColumn( 'retry_count', @@ -212,132 +183,78 @@ class $DownloadedMediaTable extends DownloadedMedia String get actualTableName => $name; static const String $name = 'downloaded_media'; @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { + VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('server_id')) { - context.handle( - _serverIdMeta, - serverId.isAcceptableOrUnknown(data['server_id']!, _serverIdMeta), - ); + context.handle(_serverIdMeta, serverId.isAcceptableOrUnknown(data['server_id']!, _serverIdMeta)); } else if (isInserting) { context.missing(_serverIdMeta); } if (data.containsKey('rating_key')) { - context.handle( - _ratingKeyMeta, - ratingKey.isAcceptableOrUnknown(data['rating_key']!, _ratingKeyMeta), - ); + context.handle(_ratingKeyMeta, ratingKey.isAcceptableOrUnknown(data['rating_key']!, _ratingKeyMeta)); } else if (isInserting) { context.missing(_ratingKeyMeta); } if (data.containsKey('global_key')) { - context.handle( - _globalKeyMeta, - globalKey.isAcceptableOrUnknown(data['global_key']!, _globalKeyMeta), - ); + context.handle(_globalKeyMeta, globalKey.isAcceptableOrUnknown(data['global_key']!, _globalKeyMeta)); } else if (isInserting) { context.missing(_globalKeyMeta); } if (data.containsKey('type')) { - context.handle( - _typeMeta, - type.isAcceptableOrUnknown(data['type']!, _typeMeta), - ); + context.handle(_typeMeta, type.isAcceptableOrUnknown(data['type']!, _typeMeta)); } else if (isInserting) { context.missing(_typeMeta); } if (data.containsKey('parent_rating_key')) { context.handle( _parentRatingKeyMeta, - parentRatingKey.isAcceptableOrUnknown( - data['parent_rating_key']!, - _parentRatingKeyMeta, - ), + parentRatingKey.isAcceptableOrUnknown(data['parent_rating_key']!, _parentRatingKeyMeta), ); } if (data.containsKey('grandparent_rating_key')) { context.handle( _grandparentRatingKeyMeta, - grandparentRatingKey.isAcceptableOrUnknown( - data['grandparent_rating_key']!, - _grandparentRatingKeyMeta, - ), + grandparentRatingKey.isAcceptableOrUnknown(data['grandparent_rating_key']!, _grandparentRatingKeyMeta), ); } if (data.containsKey('status')) { - context.handle( - _statusMeta, - status.isAcceptableOrUnknown(data['status']!, _statusMeta), - ); + context.handle(_statusMeta, status.isAcceptableOrUnknown(data['status']!, _statusMeta)); } else if (isInserting) { context.missing(_statusMeta); } if (data.containsKey('progress')) { - context.handle( - _progressMeta, - progress.isAcceptableOrUnknown(data['progress']!, _progressMeta), - ); + context.handle(_progressMeta, progress.isAcceptableOrUnknown(data['progress']!, _progressMeta)); } if (data.containsKey('total_bytes')) { - context.handle( - _totalBytesMeta, - totalBytes.isAcceptableOrUnknown(data['total_bytes']!, _totalBytesMeta), - ); + context.handle(_totalBytesMeta, totalBytes.isAcceptableOrUnknown(data['total_bytes']!, _totalBytesMeta)); } if (data.containsKey('downloaded_bytes')) { context.handle( _downloadedBytesMeta, - downloadedBytes.isAcceptableOrUnknown( - data['downloaded_bytes']!, - _downloadedBytesMeta, - ), + downloadedBytes.isAcceptableOrUnknown(data['downloaded_bytes']!, _downloadedBytesMeta), ); } if (data.containsKey('video_file_path')) { context.handle( _videoFilePathMeta, - videoFilePath.isAcceptableOrUnknown( - data['video_file_path']!, - _videoFilePathMeta, - ), + videoFilePath.isAcceptableOrUnknown(data['video_file_path']!, _videoFilePathMeta), ); } if (data.containsKey('thumb_path')) { - context.handle( - _thumbPathMeta, - thumbPath.isAcceptableOrUnknown(data['thumb_path']!, _thumbPathMeta), - ); + context.handle(_thumbPathMeta, thumbPath.isAcceptableOrUnknown(data['thumb_path']!, _thumbPathMeta)); } if (data.containsKey('downloaded_at')) { - context.handle( - _downloadedAtMeta, - downloadedAt.isAcceptableOrUnknown( - data['downloaded_at']!, - _downloadedAtMeta, - ), - ); + context.handle(_downloadedAtMeta, downloadedAt.isAcceptableOrUnknown(data['downloaded_at']!, _downloadedAtMeta)); } if (data.containsKey('error_message')) { - context.handle( - _errorMessageMeta, - errorMessage.isAcceptableOrUnknown( - data['error_message']!, - _errorMessageMeta, - ), - ); + context.handle(_errorMessageMeta, errorMessage.isAcceptableOrUnknown(data['error_message']!, _errorMessageMeta)); } if (data.containsKey('retry_count')) { - context.handle( - _retryCountMeta, - retryCount.isAcceptableOrUnknown(data['retry_count']!, _retryCountMeta), - ); + context.handle(_retryCountMeta, retryCount.isAcceptableOrUnknown(data['retry_count']!, _retryCountMeta)); } return context; } @@ -348,26 +265,11 @@ class $DownloadedMediaTable extends DownloadedMedia DownloadedMediaItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DownloadedMediaItem( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - serverId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}server_id'], - )!, - ratingKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}rating_key'], - )!, - globalKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}global_key'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}type'], - )!, + id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!, + serverId: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}server_id'])!, + ratingKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}rating_key'])!, + globalKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}global_key'])!, + type: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}type'])!, parentRatingKey: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}parent_rating_key'], @@ -376,42 +278,15 @@ class $DownloadedMediaTable extends DownloadedMedia DriftSqlType.string, data['${effectivePrefix}grandparent_rating_key'], ), - status: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}status'], - )!, - progress: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}progress'], - )!, - totalBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}total_bytes'], - ), - downloadedBytes: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}downloaded_bytes'], - )!, - videoFilePath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}video_file_path'], - ), - thumbPath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}thumb_path'], - ), - downloadedAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}downloaded_at'], - ), - errorMessage: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}error_message'], - ), - retryCount: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}retry_count'], - )!, + status: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}status'])!, + progress: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}progress'])!, + totalBytes: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}total_bytes']), + downloadedBytes: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}downloaded_bytes'])!, + videoFilePath: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}video_file_path']), + thumbPath: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}thumb_path']), + downloadedAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}downloaded_at']), + errorMessage: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}error_message']), + retryCount: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}retry_count'])!, ); } @@ -421,8 +296,7 @@ class $DownloadedMediaTable extends DownloadedMedia } } -class DownloadedMediaItem extends DataClass - implements Insertable { +class DownloadedMediaItem extends DataClass implements Insertable { final int id; final String serverId; final String ratingKey; @@ -500,38 +374,23 @@ class DownloadedMediaItem extends DataClass ratingKey: Value(ratingKey), globalKey: Value(globalKey), type: Value(type), - parentRatingKey: parentRatingKey == null && nullToAbsent - ? const Value.absent() - : Value(parentRatingKey), + parentRatingKey: parentRatingKey == null && nullToAbsent ? const Value.absent() : Value(parentRatingKey), grandparentRatingKey: grandparentRatingKey == null && nullToAbsent ? const Value.absent() : Value(grandparentRatingKey), status: Value(status), progress: Value(progress), - totalBytes: totalBytes == null && nullToAbsent - ? const Value.absent() - : Value(totalBytes), + totalBytes: totalBytes == null && nullToAbsent ? const Value.absent() : Value(totalBytes), downloadedBytes: Value(downloadedBytes), - videoFilePath: videoFilePath == null && nullToAbsent - ? const Value.absent() - : Value(videoFilePath), - thumbPath: thumbPath == null && nullToAbsent - ? const Value.absent() - : Value(thumbPath), - downloadedAt: downloadedAt == null && nullToAbsent - ? const Value.absent() - : Value(downloadedAt), - errorMessage: errorMessage == null && nullToAbsent - ? const Value.absent() - : Value(errorMessage), + videoFilePath: videoFilePath == null && nullToAbsent ? const Value.absent() : Value(videoFilePath), + thumbPath: thumbPath == null && nullToAbsent ? const Value.absent() : Value(thumbPath), + downloadedAt: downloadedAt == null && nullToAbsent ? const Value.absent() : Value(downloadedAt), + errorMessage: errorMessage == null && nullToAbsent ? const Value.absent() : Value(errorMessage), retryCount: Value(retryCount), ); } - factory DownloadedMediaItem.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory DownloadedMediaItem.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return DownloadedMediaItem( id: serializer.fromJson(json['id']), @@ -540,9 +399,7 @@ class DownloadedMediaItem extends DataClass globalKey: serializer.fromJson(json['globalKey']), type: serializer.fromJson(json['type']), parentRatingKey: serializer.fromJson(json['parentRatingKey']), - grandparentRatingKey: serializer.fromJson( - json['grandparentRatingKey'], - ), + grandparentRatingKey: serializer.fromJson(json['grandparentRatingKey']), status: serializer.fromJson(json['status']), progress: serializer.fromJson(json['progress']), totalBytes: serializer.fromJson(json['totalBytes']), @@ -600,19 +457,13 @@ class DownloadedMediaItem extends DataClass ratingKey: ratingKey ?? this.ratingKey, globalKey: globalKey ?? this.globalKey, type: type ?? this.type, - parentRatingKey: parentRatingKey.present - ? parentRatingKey.value - : this.parentRatingKey, - grandparentRatingKey: grandparentRatingKey.present - ? grandparentRatingKey.value - : this.grandparentRatingKey, + parentRatingKey: parentRatingKey.present ? parentRatingKey.value : this.parentRatingKey, + grandparentRatingKey: grandparentRatingKey.present ? grandparentRatingKey.value : this.grandparentRatingKey, status: status ?? this.status, progress: progress ?? this.progress, totalBytes: totalBytes.present ? totalBytes.value : this.totalBytes, downloadedBytes: downloadedBytes ?? this.downloadedBytes, - videoFilePath: videoFilePath.present - ? videoFilePath.value - : this.videoFilePath, + videoFilePath: videoFilePath.present ? videoFilePath.value : this.videoFilePath, thumbPath: thumbPath.present ? thumbPath.value : this.thumbPath, downloadedAt: downloadedAt.present ? downloadedAt.value : this.downloadedAt, errorMessage: errorMessage.present ? errorMessage.value : this.errorMessage, @@ -625,33 +476,19 @@ class DownloadedMediaItem extends DataClass ratingKey: data.ratingKey.present ? data.ratingKey.value : this.ratingKey, globalKey: data.globalKey.present ? data.globalKey.value : this.globalKey, type: data.type.present ? data.type.value : this.type, - parentRatingKey: data.parentRatingKey.present - ? data.parentRatingKey.value - : this.parentRatingKey, + parentRatingKey: data.parentRatingKey.present ? data.parentRatingKey.value : this.parentRatingKey, grandparentRatingKey: data.grandparentRatingKey.present ? data.grandparentRatingKey.value : this.grandparentRatingKey, status: data.status.present ? data.status.value : this.status, progress: data.progress.present ? data.progress.value : this.progress, - totalBytes: data.totalBytes.present - ? data.totalBytes.value - : this.totalBytes, - downloadedBytes: data.downloadedBytes.present - ? data.downloadedBytes.value - : this.downloadedBytes, - videoFilePath: data.videoFilePath.present - ? data.videoFilePath.value - : this.videoFilePath, + totalBytes: data.totalBytes.present ? data.totalBytes.value : this.totalBytes, + downloadedBytes: data.downloadedBytes.present ? data.downloadedBytes.value : this.downloadedBytes, + videoFilePath: data.videoFilePath.present ? data.videoFilePath.value : this.videoFilePath, thumbPath: data.thumbPath.present ? data.thumbPath.value : this.thumbPath, - downloadedAt: data.downloadedAt.present - ? data.downloadedAt.value - : this.downloadedAt, - errorMessage: data.errorMessage.present - ? data.errorMessage.value - : this.errorMessage, - retryCount: data.retryCount.present - ? data.retryCount.value - : this.retryCount, + downloadedAt: data.downloadedAt.present ? data.downloadedAt.value : this.downloadedAt, + errorMessage: data.errorMessage.present ? data.errorMessage.value : this.errorMessage, + retryCount: data.retryCount.present ? data.retryCount.value : this.retryCount, ); } @@ -801,8 +638,7 @@ class DownloadedMediaCompanion extends UpdateCompanion { if (globalKey != null) 'global_key': globalKey, if (type != null) 'type': type, if (parentRatingKey != null) 'parent_rating_key': parentRatingKey, - if (grandparentRatingKey != null) - 'grandparent_rating_key': grandparentRatingKey, + if (grandparentRatingKey != null) 'grandparent_rating_key': grandparentRatingKey, if (status != null) 'status': status, if (progress != null) 'progress': progress, if (totalBytes != null) 'total_bytes': totalBytes, @@ -875,9 +711,7 @@ class DownloadedMediaCompanion extends UpdateCompanion { map['parent_rating_key'] = Variable(parentRatingKey.value); } if (grandparentRatingKey.present) { - map['grandparent_rating_key'] = Variable( - grandparentRatingKey.value, - ); + map['grandparent_rating_key'] = Variable(grandparentRatingKey.value); } if (status.present) { map['status'] = Variable(status.value); @@ -933,8 +767,7 @@ class DownloadedMediaCompanion extends UpdateCompanion { } } -class $DownloadQueueTable extends DownloadQueue - with TableInfo<$DownloadQueueTable, DownloadQueueItem> { +class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTable, DownloadQueueItem> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -948,13 +781,9 @@ class $DownloadQueueTable extends DownloadQueue hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'PRIMARY KEY AUTOINCREMENT', - ), - ); - static const VerificationMeta _mediaGlobalKeyMeta = const VerificationMeta( - 'mediaGlobalKey', + defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), ); + static const VerificationMeta _mediaGlobalKeyMeta = const VerificationMeta('mediaGlobalKey'); @override late final GeneratedColumn mediaGlobalKey = GeneratedColumn( 'media_global_key', @@ -964,9 +793,7 @@ class $DownloadQueueTable extends DownloadQueue requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'), ); - static const VerificationMeta _priorityMeta = const VerificationMeta( - 'priority', - ); + static const VerificationMeta _priorityMeta = const VerificationMeta('priority'); @override late final GeneratedColumn priority = GeneratedColumn( 'priority', @@ -976,9 +803,7 @@ class $DownloadQueueTable extends DownloadQueue requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _addedAtMeta = const VerificationMeta( - 'addedAt', - ); + static const VerificationMeta _addedAtMeta = const VerificationMeta('addedAt'); @override late final GeneratedColumn addedAt = GeneratedColumn( 'added_at', @@ -987,9 +812,7 @@ class $DownloadQueueTable extends DownloadQueue type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _downloadSubtitlesMeta = const VerificationMeta( - 'downloadSubtitles', - ); + static const VerificationMeta _downloadSubtitlesMeta = const VerificationMeta('downloadSubtitles'); @override late final GeneratedColumn downloadSubtitles = GeneratedColumn( 'download_subtitles', @@ -997,14 +820,10 @@ class $DownloadQueueTable extends DownloadQueue false, type: DriftSqlType.bool, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("download_subtitles" IN (0, 1))', - ), + defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("download_subtitles" IN (0, 1))'), defaultValue: const Constant(true), ); - static const VerificationMeta _downloadArtworkMeta = const VerificationMeta( - 'downloadArtwork', - ); + static const VerificationMeta _downloadArtworkMeta = const VerificationMeta('downloadArtwork'); @override late final GeneratedColumn downloadArtwork = GeneratedColumn( 'download_artwork', @@ -1012,30 +831,18 @@ class $DownloadQueueTable extends DownloadQueue false, type: DriftSqlType.bool, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("download_artwork" IN (0, 1))', - ), + defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("download_artwork" IN (0, 1))'), defaultValue: const Constant(true), ); @override - List get $columns => [ - id, - mediaGlobalKey, - priority, - addedAt, - downloadSubtitles, - downloadArtwork, - ]; + List get $columns => [id, mediaGlobalKey, priority, addedAt, downloadSubtitles, downloadArtwork]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'download_queue'; @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { + VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -1044,44 +851,29 @@ class $DownloadQueueTable extends DownloadQueue if (data.containsKey('media_global_key')) { context.handle( _mediaGlobalKeyMeta, - mediaGlobalKey.isAcceptableOrUnknown( - data['media_global_key']!, - _mediaGlobalKeyMeta, - ), + mediaGlobalKey.isAcceptableOrUnknown(data['media_global_key']!, _mediaGlobalKeyMeta), ); } else if (isInserting) { context.missing(_mediaGlobalKeyMeta); } if (data.containsKey('priority')) { - context.handle( - _priorityMeta, - priority.isAcceptableOrUnknown(data['priority']!, _priorityMeta), - ); + context.handle(_priorityMeta, priority.isAcceptableOrUnknown(data['priority']!, _priorityMeta)); } if (data.containsKey('added_at')) { - context.handle( - _addedAtMeta, - addedAt.isAcceptableOrUnknown(data['added_at']!, _addedAtMeta), - ); + context.handle(_addedAtMeta, addedAt.isAcceptableOrUnknown(data['added_at']!, _addedAtMeta)); } else if (isInserting) { context.missing(_addedAtMeta); } if (data.containsKey('download_subtitles')) { context.handle( _downloadSubtitlesMeta, - downloadSubtitles.isAcceptableOrUnknown( - data['download_subtitles']!, - _downloadSubtitlesMeta, - ), + downloadSubtitles.isAcceptableOrUnknown(data['download_subtitles']!, _downloadSubtitlesMeta), ); } if (data.containsKey('download_artwork')) { context.handle( _downloadArtworkMeta, - downloadArtwork.isAcceptableOrUnknown( - data['download_artwork']!, - _downloadArtworkMeta, - ), + downloadArtwork.isAcceptableOrUnknown(data['download_artwork']!, _downloadArtworkMeta), ); } return context; @@ -1093,22 +885,13 @@ class $DownloadQueueTable extends DownloadQueue DownloadQueueItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return DownloadQueueItem( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, + id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!, mediaGlobalKey: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}media_global_key'], )!, - priority: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}priority'], - )!, - addedAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}added_at'], - )!, + priority: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}priority'])!, + addedAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}added_at'])!, downloadSubtitles: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}download_subtitles'], @@ -1126,8 +909,7 @@ class $DownloadQueueTable extends DownloadQueue } } -class DownloadQueueItem extends DataClass - implements Insertable { +class DownloadQueueItem extends DataClass implements Insertable { final int id; final String mediaGlobalKey; final int priority; @@ -1165,10 +947,7 @@ class DownloadQueueItem extends DataClass ); } - factory DownloadQueueItem.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory DownloadQueueItem.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return DownloadQueueItem( id: serializer.fromJson(json['id']), @@ -1210,17 +989,11 @@ class DownloadQueueItem extends DataClass DownloadQueueItem copyWithCompanion(DownloadQueueCompanion data) { return DownloadQueueItem( id: data.id.present ? data.id.value : this.id, - mediaGlobalKey: data.mediaGlobalKey.present - ? data.mediaGlobalKey.value - : this.mediaGlobalKey, + mediaGlobalKey: data.mediaGlobalKey.present ? data.mediaGlobalKey.value : this.mediaGlobalKey, priority: data.priority.present ? data.priority.value : this.priority, addedAt: data.addedAt.present ? data.addedAt.value : this.addedAt, - downloadSubtitles: data.downloadSubtitles.present - ? data.downloadSubtitles.value - : this.downloadSubtitles, - downloadArtwork: data.downloadArtwork.present - ? data.downloadArtwork.value - : this.downloadArtwork, + downloadSubtitles: data.downloadSubtitles.present ? data.downloadSubtitles.value : this.downloadSubtitles, + downloadArtwork: data.downloadArtwork.present ? data.downloadArtwork.value : this.downloadArtwork, ); } @@ -1238,14 +1011,7 @@ class DownloadQueueItem extends DataClass } @override - int get hashCode => Object.hash( - id, - mediaGlobalKey, - priority, - addedAt, - downloadSubtitles, - downloadArtwork, - ); + int get hashCode => Object.hash(id, mediaGlobalKey, priority, addedAt, downloadSubtitles, downloadArtwork); @override bool operator ==(Object other) => identical(this, other) || @@ -1356,15 +1122,12 @@ class DownloadQueueCompanion extends UpdateCompanion { } } -class $ApiCacheTable extends ApiCache - with TableInfo<$ApiCacheTable, ApiCacheData> { +class $ApiCacheTable extends ApiCache with TableInfo<$ApiCacheTable, ApiCacheData> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $ApiCacheTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _cacheKeyMeta = const VerificationMeta( - 'cacheKey', - ); + static const VerificationMeta _cacheKeyMeta = const VerificationMeta('cacheKey'); @override late final GeneratedColumn cacheKey = GeneratedColumn( 'cache_key', @@ -1390,14 +1153,10 @@ class $ApiCacheTable extends ApiCache false, type: DriftSqlType.bool, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("pinned" IN (0, 1))', - ), + defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("pinned" IN (0, 1))'), defaultValue: const Constant(false), ); - static const VerificationMeta _cachedAtMeta = const VerificationMeta( - 'cachedAt', - ); + static const VerificationMeta _cachedAtMeta = const VerificationMeta('cachedAt'); @override late final GeneratedColumn cachedAt = GeneratedColumn( 'cached_at', @@ -1415,39 +1174,24 @@ class $ApiCacheTable extends ApiCache String get actualTableName => $name; static const String $name = 'api_cache'; @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { + VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('cache_key')) { - context.handle( - _cacheKeyMeta, - cacheKey.isAcceptableOrUnknown(data['cache_key']!, _cacheKeyMeta), - ); + context.handle(_cacheKeyMeta, cacheKey.isAcceptableOrUnknown(data['cache_key']!, _cacheKeyMeta)); } else if (isInserting) { context.missing(_cacheKeyMeta); } if (data.containsKey('data')) { - context.handle( - _dataMeta, - this.data.isAcceptableOrUnknown(data['data']!, _dataMeta), - ); + context.handle(_dataMeta, this.data.isAcceptableOrUnknown(data['data']!, _dataMeta)); } else if (isInserting) { context.missing(_dataMeta); } if (data.containsKey('pinned')) { - context.handle( - _pinnedMeta, - pinned.isAcceptableOrUnknown(data['pinned']!, _pinnedMeta), - ); + context.handle(_pinnedMeta, pinned.isAcceptableOrUnknown(data['pinned']!, _pinnedMeta)); } if (data.containsKey('cached_at')) { - context.handle( - _cachedAtMeta, - cachedAt.isAcceptableOrUnknown(data['cached_at']!, _cachedAtMeta), - ); + context.handle(_cachedAtMeta, cachedAt.isAcceptableOrUnknown(data['cached_at']!, _cachedAtMeta)); } return context; } @@ -1458,22 +1202,10 @@ class $ApiCacheTable extends ApiCache ApiCacheData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ApiCacheData( - cacheKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}cache_key'], - )!, - data: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}data'], - )!, - pinned: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}pinned'], - )!, - cachedAt: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, - data['${effectivePrefix}cached_at'], - )!, + cacheKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}cache_key'])!, + data: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}data'])!, + pinned: attachedDatabase.typeMapping.read(DriftSqlType.bool, data['${effectivePrefix}pinned'])!, + cachedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}cached_at'])!, ); } @@ -1495,12 +1227,7 @@ class ApiCacheData extends DataClass implements Insertable { /// Timestamp for cache invalidation (optional future use) final DateTime cachedAt; - const ApiCacheData({ - required this.cacheKey, - required this.data, - required this.pinned, - required this.cachedAt, - }); + const ApiCacheData({required this.cacheKey, required this.data, required this.pinned, required this.cachedAt}); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -1520,10 +1247,7 @@ class ApiCacheData extends DataClass implements Insertable { ); } - factory ApiCacheData.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory ApiCacheData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return ApiCacheData( cacheKey: serializer.fromJson(json['cacheKey']), @@ -1543,12 +1267,7 @@ class ApiCacheData extends DataClass implements Insertable { }; } - ApiCacheData copyWith({ - String? cacheKey, - String? data, - bool? pinned, - DateTime? cachedAt, - }) => ApiCacheData( + ApiCacheData copyWith({String? cacheKey, String? data, bool? pinned, DateTime? cachedAt}) => ApiCacheData( cacheKey: cacheKey ?? this.cacheKey, data: data ?? this.data, pinned: pinned ?? this.pinned, @@ -1688,13 +1407,9 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'PRIMARY KEY AUTOINCREMENT', - ), - ); - static const VerificationMeta _serverIdMeta = const VerificationMeta( - 'serverId', + defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), ); + static const VerificationMeta _serverIdMeta = const VerificationMeta('serverId'); @override late final GeneratedColumn serverId = GeneratedColumn( 'server_id', @@ -1703,9 +1418,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _ratingKeyMeta = const VerificationMeta( - 'ratingKey', - ); + static const VerificationMeta _ratingKeyMeta = const VerificationMeta('ratingKey'); @override late final GeneratedColumn ratingKey = GeneratedColumn( 'rating_key', @@ -1714,9 +1427,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _globalKeyMeta = const VerificationMeta( - 'globalKey', - ); + static const VerificationMeta _globalKeyMeta = const VerificationMeta('globalKey'); @override late final GeneratedColumn globalKey = GeneratedColumn( 'global_key', @@ -1725,9 +1436,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _actionTypeMeta = const VerificationMeta( - 'actionType', - ); + static const VerificationMeta _actionTypeMeta = const VerificationMeta('actionType'); @override late final GeneratedColumn actionType = GeneratedColumn( 'action_type', @@ -1736,9 +1445,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _viewOffsetMeta = const VerificationMeta( - 'viewOffset', - ); + static const VerificationMeta _viewOffsetMeta = const VerificationMeta('viewOffset'); @override late final GeneratedColumn viewOffset = GeneratedColumn( 'view_offset', @@ -1747,9 +1454,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.int, requiredDuringInsert: false, ); - static const VerificationMeta _durationMeta = const VerificationMeta( - 'duration', - ); + static const VerificationMeta _durationMeta = const VerificationMeta('duration'); @override late final GeneratedColumn duration = GeneratedColumn( 'duration', @@ -1758,9 +1463,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.int, requiredDuringInsert: false, ); - static const VerificationMeta _shouldMarkWatchedMeta = const VerificationMeta( - 'shouldMarkWatched', - ); + static const VerificationMeta _shouldMarkWatchedMeta = const VerificationMeta('shouldMarkWatched'); @override late final GeneratedColumn shouldMarkWatched = GeneratedColumn( 'should_mark_watched', @@ -1768,14 +1471,10 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress false, type: DriftSqlType.bool, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("should_mark_watched" IN (0, 1))', - ), + defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("should_mark_watched" IN (0, 1))'), defaultValue: const Constant(false), ); - static const VerificationMeta _createdAtMeta = const VerificationMeta( - 'createdAt', - ); + static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', @@ -1784,9 +1483,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _updatedAtMeta = const VerificationMeta( - 'updatedAt', - ); + static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); @override late final GeneratedColumn updatedAt = GeneratedColumn( 'updated_at', @@ -1795,9 +1492,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _syncAttemptsMeta = const VerificationMeta( - 'syncAttempts', - ); + static const VerificationMeta _syncAttemptsMeta = const VerificationMeta('syncAttempts'); @override late final GeneratedColumn syncAttempts = GeneratedColumn( 'sync_attempts', @@ -1807,9 +1502,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _lastErrorMeta = const VerificationMeta( - 'lastError', - ); + static const VerificationMeta _lastErrorMeta = const VerificationMeta('lastError'); @override late final GeneratedColumn lastError = GeneratedColumn( 'last_error', @@ -1839,98 +1532,59 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress String get actualTableName => $name; static const String $name = 'offline_watch_progress'; @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { + VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('server_id')) { - context.handle( - _serverIdMeta, - serverId.isAcceptableOrUnknown(data['server_id']!, _serverIdMeta), - ); + context.handle(_serverIdMeta, serverId.isAcceptableOrUnknown(data['server_id']!, _serverIdMeta)); } else if (isInserting) { context.missing(_serverIdMeta); } if (data.containsKey('rating_key')) { - context.handle( - _ratingKeyMeta, - ratingKey.isAcceptableOrUnknown(data['rating_key']!, _ratingKeyMeta), - ); + context.handle(_ratingKeyMeta, ratingKey.isAcceptableOrUnknown(data['rating_key']!, _ratingKeyMeta)); } else if (isInserting) { context.missing(_ratingKeyMeta); } if (data.containsKey('global_key')) { - context.handle( - _globalKeyMeta, - globalKey.isAcceptableOrUnknown(data['global_key']!, _globalKeyMeta), - ); + context.handle(_globalKeyMeta, globalKey.isAcceptableOrUnknown(data['global_key']!, _globalKeyMeta)); } else if (isInserting) { context.missing(_globalKeyMeta); } if (data.containsKey('action_type')) { - context.handle( - _actionTypeMeta, - actionType.isAcceptableOrUnknown(data['action_type']!, _actionTypeMeta), - ); + context.handle(_actionTypeMeta, actionType.isAcceptableOrUnknown(data['action_type']!, _actionTypeMeta)); } else if (isInserting) { context.missing(_actionTypeMeta); } if (data.containsKey('view_offset')) { - context.handle( - _viewOffsetMeta, - viewOffset.isAcceptableOrUnknown(data['view_offset']!, _viewOffsetMeta), - ); + context.handle(_viewOffsetMeta, viewOffset.isAcceptableOrUnknown(data['view_offset']!, _viewOffsetMeta)); } if (data.containsKey('duration')) { - context.handle( - _durationMeta, - duration.isAcceptableOrUnknown(data['duration']!, _durationMeta), - ); + context.handle(_durationMeta, duration.isAcceptableOrUnknown(data['duration']!, _durationMeta)); } if (data.containsKey('should_mark_watched')) { context.handle( _shouldMarkWatchedMeta, - shouldMarkWatched.isAcceptableOrUnknown( - data['should_mark_watched']!, - _shouldMarkWatchedMeta, - ), + shouldMarkWatched.isAcceptableOrUnknown(data['should_mark_watched']!, _shouldMarkWatchedMeta), ); } if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); + context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); } else if (isInserting) { context.missing(_createdAtMeta); } if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); + context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); } else if (isInserting) { context.missing(_updatedAtMeta); } if (data.containsKey('sync_attempts')) { - context.handle( - _syncAttemptsMeta, - syncAttempts.isAcceptableOrUnknown( - data['sync_attempts']!, - _syncAttemptsMeta, - ), - ); + context.handle(_syncAttemptsMeta, syncAttempts.isAcceptableOrUnknown(data['sync_attempts']!, _syncAttemptsMeta)); } if (data.containsKey('last_error')) { - context.handle( - _lastErrorMeta, - lastError.isAcceptableOrUnknown(data['last_error']!, _lastErrorMeta), - ); + context.handle(_lastErrorMeta, lastError.isAcceptableOrUnknown(data['last_error']!, _lastErrorMeta)); } return context; } @@ -1938,60 +1592,24 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress @override Set get $primaryKey => {id}; @override - OfflineWatchProgressItem map( - Map data, { - String? tablePrefix, - }) { + OfflineWatchProgressItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return OfflineWatchProgressItem( - id: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}id'], - )!, - serverId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}server_id'], - )!, - ratingKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}rating_key'], - )!, - globalKey: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}global_key'], - )!, - actionType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}action_type'], - )!, - viewOffset: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}view_offset'], - ), - duration: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}duration'], - ), + id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!, + serverId: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}server_id'])!, + ratingKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}rating_key'])!, + globalKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}global_key'])!, + actionType: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}action_type'])!, + viewOffset: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}view_offset']), + duration: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}duration']), shouldMarkWatched: attachedDatabase.typeMapping.read( DriftSqlType.bool, data['${effectivePrefix}should_mark_watched'], )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}updated_at'], - )!, - syncAttempts: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}sync_attempts'], - )!, - lastError: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}last_error'], - ), + createdAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}created_at'])!, + updatedAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}updated_at'])!, + syncAttempts: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}sync_attempts'])!, + lastError: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}last_error']), ); } @@ -2001,8 +1619,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress } } -class OfflineWatchProgressItem extends DataClass - implements Insertable { +class OfflineWatchProgressItem extends DataClass implements Insertable { /// Auto-incrementing primary key final int id; @@ -2084,26 +1701,17 @@ class OfflineWatchProgressItem extends DataClass ratingKey: Value(ratingKey), globalKey: Value(globalKey), actionType: Value(actionType), - viewOffset: viewOffset == null && nullToAbsent - ? const Value.absent() - : Value(viewOffset), - duration: duration == null && nullToAbsent - ? const Value.absent() - : Value(duration), + viewOffset: viewOffset == null && nullToAbsent ? const Value.absent() : Value(viewOffset), + duration: duration == null && nullToAbsent ? const Value.absent() : Value(duration), shouldMarkWatched: Value(shouldMarkWatched), createdAt: Value(createdAt), updatedAt: Value(updatedAt), syncAttempts: Value(syncAttempts), - lastError: lastError == null && nullToAbsent - ? const Value.absent() - : Value(lastError), + lastError: lastError == null && nullToAbsent ? const Value.absent() : Value(lastError), ); } - factory OfflineWatchProgressItem.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory OfflineWatchProgressItem.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return OfflineWatchProgressItem( id: serializer.fromJson(json['id']), @@ -2166,29 +1774,19 @@ class OfflineWatchProgressItem extends DataClass syncAttempts: syncAttempts ?? this.syncAttempts, lastError: lastError.present ? lastError.value : this.lastError, ); - OfflineWatchProgressItem copyWithCompanion( - OfflineWatchProgressCompanion data, - ) { + OfflineWatchProgressItem copyWithCompanion(OfflineWatchProgressCompanion data) { return OfflineWatchProgressItem( id: data.id.present ? data.id.value : this.id, serverId: data.serverId.present ? data.serverId.value : this.serverId, ratingKey: data.ratingKey.present ? data.ratingKey.value : this.ratingKey, globalKey: data.globalKey.present ? data.globalKey.value : this.globalKey, - actionType: data.actionType.present - ? data.actionType.value - : this.actionType, - viewOffset: data.viewOffset.present - ? data.viewOffset.value - : this.viewOffset, + actionType: data.actionType.present ? data.actionType.value : this.actionType, + viewOffset: data.viewOffset.present ? data.viewOffset.value : this.viewOffset, duration: data.duration.present ? data.duration.value : this.duration, - shouldMarkWatched: data.shouldMarkWatched.present - ? data.shouldMarkWatched.value - : this.shouldMarkWatched, + shouldMarkWatched: data.shouldMarkWatched.present ? data.shouldMarkWatched.value : this.shouldMarkWatched, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - syncAttempts: data.syncAttempts.present - ? data.syncAttempts.value - : this.syncAttempts, + syncAttempts: data.syncAttempts.present ? data.syncAttempts.value : this.syncAttempts, lastError: data.lastError.present ? data.lastError.value : this.lastError, ); } @@ -2245,8 +1843,7 @@ class OfflineWatchProgressItem extends DataClass other.lastError == this.lastError); } -class OfflineWatchProgressCompanion - extends UpdateCompanion { +class OfflineWatchProgressCompanion extends UpdateCompanion { final Value id; final Value serverId; final Value ratingKey; @@ -2417,23 +2014,14 @@ class OfflineWatchProgressCompanion abstract class _$AppDatabase extends GeneratedDatabase { _$AppDatabase(QueryExecutor e) : super(e); $AppDatabaseManager get managers => $AppDatabaseManager(this); - late final $DownloadedMediaTable downloadedMedia = $DownloadedMediaTable( - this, - ); + late final $DownloadedMediaTable downloadedMedia = $DownloadedMediaTable(this); late final $DownloadQueueTable downloadQueue = $DownloadQueueTable(this); late final $ApiCacheTable apiCache = $ApiCacheTable(this); - late final $OfflineWatchProgressTable offlineWatchProgress = - $OfflineWatchProgressTable(this); + late final $OfflineWatchProgressTable offlineWatchProgress = $OfflineWatchProgressTable(this); @override - Iterable> get allTables => - allSchemaEntities.whereType>(); + Iterable> get allTables => allSchemaEntities.whereType>(); @override - List get allSchemaEntities => [ - downloadedMedia, - downloadQueue, - apiCache, - offlineWatchProgress, - ]; + List get allSchemaEntities => [downloadedMedia, downloadQueue, apiCache, offlineWatchProgress]; } typedef $$DownloadedMediaTableCreateCompanionBuilder = @@ -2475,8 +2063,7 @@ typedef $$DownloadedMediaTableUpdateCompanionBuilder = Value retryCount, }); -class $$DownloadedMediaTableFilterComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableFilterComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableFilterComposer({ required super.$db, required super.$table, @@ -2484,89 +2071,54 @@ class $$DownloadedMediaTableFilterComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); - ColumnFilters get serverId => $composableBuilder( - column: $table.serverId, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get serverId => + $composableBuilder(column: $table.serverId, builder: (column) => ColumnFilters(column)); - ColumnFilters get ratingKey => $composableBuilder( - column: $table.ratingKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get ratingKey => + $composableBuilder(column: $table.ratingKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get globalKey => $composableBuilder( - column: $table.globalKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get globalKey => + $composableBuilder(column: $table.globalKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get type => $composableBuilder( - column: $table.type, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get type => $composableBuilder(column: $table.type, builder: (column) => ColumnFilters(column)); - ColumnFilters get parentRatingKey => $composableBuilder( - column: $table.parentRatingKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get parentRatingKey => + $composableBuilder(column: $table.parentRatingKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get grandparentRatingKey => $composableBuilder( - column: $table.grandparentRatingKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get grandparentRatingKey => + $composableBuilder(column: $table.grandparentRatingKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get status => $composableBuilder( - column: $table.status, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get status => + $composableBuilder(column: $table.status, builder: (column) => ColumnFilters(column)); - ColumnFilters get progress => $composableBuilder( - column: $table.progress, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get progress => + $composableBuilder(column: $table.progress, builder: (column) => ColumnFilters(column)); - ColumnFilters get totalBytes => $composableBuilder( - column: $table.totalBytes, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get totalBytes => + $composableBuilder(column: $table.totalBytes, builder: (column) => ColumnFilters(column)); - ColumnFilters get downloadedBytes => $composableBuilder( - column: $table.downloadedBytes, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get downloadedBytes => + $composableBuilder(column: $table.downloadedBytes, builder: (column) => ColumnFilters(column)); - ColumnFilters get videoFilePath => $composableBuilder( - column: $table.videoFilePath, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get videoFilePath => + $composableBuilder(column: $table.videoFilePath, builder: (column) => ColumnFilters(column)); - ColumnFilters get thumbPath => $composableBuilder( - column: $table.thumbPath, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get thumbPath => + $composableBuilder(column: $table.thumbPath, builder: (column) => ColumnFilters(column)); - ColumnFilters get downloadedAt => $composableBuilder( - column: $table.downloadedAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get downloadedAt => + $composableBuilder(column: $table.downloadedAt, builder: (column) => ColumnFilters(column)); - ColumnFilters get errorMessage => $composableBuilder( - column: $table.errorMessage, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get errorMessage => + $composableBuilder(column: $table.errorMessage, builder: (column) => ColumnFilters(column)); - ColumnFilters get retryCount => $composableBuilder( - column: $table.retryCount, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get retryCount => + $composableBuilder(column: $table.retryCount, builder: (column) => ColumnFilters(column)); } -class $$DownloadedMediaTableOrderingComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableOrderingComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableOrderingComposer({ required super.$db, required super.$table, @@ -2574,89 +2126,55 @@ class $$DownloadedMediaTableOrderingComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get serverId => $composableBuilder( - column: $table.serverId, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get serverId => + $composableBuilder(column: $table.serverId, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get ratingKey => $composableBuilder( - column: $table.ratingKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get ratingKey => + $composableBuilder(column: $table.ratingKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get globalKey => $composableBuilder( - column: $table.globalKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get globalKey => + $composableBuilder(column: $table.globalKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get type => + $composableBuilder(column: $table.type, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get parentRatingKey => $composableBuilder( - column: $table.parentRatingKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get parentRatingKey => + $composableBuilder(column: $table.parentRatingKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get grandparentRatingKey => $composableBuilder( - column: $table.grandparentRatingKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get grandparentRatingKey => + $composableBuilder(column: $table.grandparentRatingKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get status => $composableBuilder( - column: $table.status, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get status => + $composableBuilder(column: $table.status, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get progress => $composableBuilder( - column: $table.progress, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get progress => + $composableBuilder(column: $table.progress, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get totalBytes => $composableBuilder( - column: $table.totalBytes, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get totalBytes => + $composableBuilder(column: $table.totalBytes, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get downloadedBytes => $composableBuilder( - column: $table.downloadedBytes, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get downloadedBytes => + $composableBuilder(column: $table.downloadedBytes, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get videoFilePath => $composableBuilder( - column: $table.videoFilePath, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get videoFilePath => + $composableBuilder(column: $table.videoFilePath, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get thumbPath => $composableBuilder( - column: $table.thumbPath, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get thumbPath => + $composableBuilder(column: $table.thumbPath, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get downloadedAt => $composableBuilder( - column: $table.downloadedAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get downloadedAt => + $composableBuilder(column: $table.downloadedAt, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get errorMessage => $composableBuilder( - column: $table.errorMessage, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get errorMessage => + $composableBuilder(column: $table.errorMessage, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get retryCount => $composableBuilder( - column: $table.retryCount, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get retryCount => + $composableBuilder(column: $table.retryCount, builder: (column) => ColumnOrderings(column)); } -class $$DownloadedMediaTableAnnotationComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableAnnotationComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableAnnotationComposer({ required super.$db, required super.$table, @@ -2664,69 +2182,42 @@ class $$DownloadedMediaTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); - GeneratedColumn get serverId => - $composableBuilder(column: $table.serverId, builder: (column) => column); + GeneratedColumn get serverId => $composableBuilder(column: $table.serverId, builder: (column) => column); - GeneratedColumn get ratingKey => - $composableBuilder(column: $table.ratingKey, builder: (column) => column); + GeneratedColumn get ratingKey => $composableBuilder(column: $table.ratingKey, builder: (column) => column); - GeneratedColumn get globalKey => - $composableBuilder(column: $table.globalKey, builder: (column) => column); + GeneratedColumn get globalKey => $composableBuilder(column: $table.globalKey, builder: (column) => column); - GeneratedColumn get type => - $composableBuilder(column: $table.type, builder: (column) => column); + GeneratedColumn get type => $composableBuilder(column: $table.type, builder: (column) => column); - GeneratedColumn get parentRatingKey => $composableBuilder( - column: $table.parentRatingKey, - builder: (column) => column, - ); + GeneratedColumn get parentRatingKey => + $composableBuilder(column: $table.parentRatingKey, builder: (column) => column); - GeneratedColumn get grandparentRatingKey => $composableBuilder( - column: $table.grandparentRatingKey, - builder: (column) => column, - ); + GeneratedColumn get grandparentRatingKey => + $composableBuilder(column: $table.grandparentRatingKey, builder: (column) => column); - GeneratedColumn get status => - $composableBuilder(column: $table.status, builder: (column) => column); + GeneratedColumn get status => $composableBuilder(column: $table.status, builder: (column) => column); - GeneratedColumn get progress => - $composableBuilder(column: $table.progress, builder: (column) => column); + GeneratedColumn get progress => $composableBuilder(column: $table.progress, builder: (column) => column); - GeneratedColumn get totalBytes => $composableBuilder( - column: $table.totalBytes, - builder: (column) => column, - ); + GeneratedColumn get totalBytes => $composableBuilder(column: $table.totalBytes, builder: (column) => column); - GeneratedColumn get downloadedBytes => $composableBuilder( - column: $table.downloadedBytes, - builder: (column) => column, - ); + GeneratedColumn get downloadedBytes => + $composableBuilder(column: $table.downloadedBytes, builder: (column) => column); - GeneratedColumn get videoFilePath => $composableBuilder( - column: $table.videoFilePath, - builder: (column) => column, - ); + GeneratedColumn get videoFilePath => + $composableBuilder(column: $table.videoFilePath, builder: (column) => column); - GeneratedColumn get thumbPath => - $composableBuilder(column: $table.thumbPath, builder: (column) => column); + GeneratedColumn get thumbPath => $composableBuilder(column: $table.thumbPath, builder: (column) => column); - GeneratedColumn get downloadedAt => $composableBuilder( - column: $table.downloadedAt, - builder: (column) => column, - ); + GeneratedColumn get downloadedAt => $composableBuilder(column: $table.downloadedAt, builder: (column) => column); - GeneratedColumn get errorMessage => $composableBuilder( - column: $table.errorMessage, - builder: (column) => column, - ); + GeneratedColumn get errorMessage => + $composableBuilder(column: $table.errorMessage, builder: (column) => column); - GeneratedColumn get retryCount => $composableBuilder( - column: $table.retryCount, - builder: (column) => column, - ); + GeneratedColumn get retryCount => $composableBuilder(column: $table.retryCount, builder: (column) => column); } class $$DownloadedMediaTableTableManager @@ -2740,30 +2231,18 @@ class $$DownloadedMediaTableTableManager $$DownloadedMediaTableAnnotationComposer, $$DownloadedMediaTableCreateCompanionBuilder, $$DownloadedMediaTableUpdateCompanionBuilder, - ( - DownloadedMediaItem, - BaseReferences< - _$AppDatabase, - $DownloadedMediaTable, - DownloadedMediaItem - >, - ), + (DownloadedMediaItem, BaseReferences<_$AppDatabase, $DownloadedMediaTable, DownloadedMediaItem>), DownloadedMediaItem, PrefetchHooks Function() > { - $$DownloadedMediaTableTableManager( - _$AppDatabase db, - $DownloadedMediaTable table, - ) : super( + $$DownloadedMediaTableTableManager(_$AppDatabase db, $DownloadedMediaTable table) + : super( TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$DownloadedMediaTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$DownloadedMediaTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$DownloadedMediaTableAnnotationComposer($db: db, $table: table), + createFilteringComposer: () => $$DownloadedMediaTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$DownloadedMediaTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => $$DownloadedMediaTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), @@ -2836,9 +2315,7 @@ class $$DownloadedMediaTableTableManager errorMessage: errorMessage, retryCount: retryCount, ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -2854,14 +2331,7 @@ typedef $$DownloadedMediaTableProcessedTableManager = $$DownloadedMediaTableAnnotationComposer, $$DownloadedMediaTableCreateCompanionBuilder, $$DownloadedMediaTableUpdateCompanionBuilder, - ( - DownloadedMediaItem, - BaseReferences< - _$AppDatabase, - $DownloadedMediaTable, - DownloadedMediaItem - >, - ), + (DownloadedMediaItem, BaseReferences<_$AppDatabase, $DownloadedMediaTable, DownloadedMediaItem>), DownloadedMediaItem, PrefetchHooks Function() >; @@ -2884,8 +2354,7 @@ typedef $$DownloadQueueTableUpdateCompanionBuilder = Value downloadArtwork, }); -class $$DownloadQueueTableFilterComposer - extends Composer<_$AppDatabase, $DownloadQueueTable> { +class $$DownloadQueueTableFilterComposer extends Composer<_$AppDatabase, $DownloadQueueTable> { $$DownloadQueueTableFilterComposer({ required super.$db, required super.$table, @@ -2893,39 +2362,25 @@ class $$DownloadQueueTableFilterComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); - ColumnFilters get mediaGlobalKey => $composableBuilder( - column: $table.mediaGlobalKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get mediaGlobalKey => + $composableBuilder(column: $table.mediaGlobalKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get priority => $composableBuilder( - column: $table.priority, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get priority => + $composableBuilder(column: $table.priority, builder: (column) => ColumnFilters(column)); - ColumnFilters get addedAt => $composableBuilder( - column: $table.addedAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get addedAt => + $composableBuilder(column: $table.addedAt, builder: (column) => ColumnFilters(column)); - ColumnFilters get downloadSubtitles => $composableBuilder( - column: $table.downloadSubtitles, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get downloadSubtitles => + $composableBuilder(column: $table.downloadSubtitles, builder: (column) => ColumnFilters(column)); - ColumnFilters get downloadArtwork => $composableBuilder( - column: $table.downloadArtwork, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get downloadArtwork => + $composableBuilder(column: $table.downloadArtwork, builder: (column) => ColumnFilters(column)); } -class $$DownloadQueueTableOrderingComposer - extends Composer<_$AppDatabase, $DownloadQueueTable> { +class $$DownloadQueueTableOrderingComposer extends Composer<_$AppDatabase, $DownloadQueueTable> { $$DownloadQueueTableOrderingComposer({ required super.$db, required super.$table, @@ -2933,39 +2388,25 @@ class $$DownloadQueueTableOrderingComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get mediaGlobalKey => $composableBuilder( - column: $table.mediaGlobalKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get mediaGlobalKey => + $composableBuilder(column: $table.mediaGlobalKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get priority => $composableBuilder( - column: $table.priority, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get priority => + $composableBuilder(column: $table.priority, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get addedAt => $composableBuilder( - column: $table.addedAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get addedAt => + $composableBuilder(column: $table.addedAt, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get downloadSubtitles => $composableBuilder( - column: $table.downloadSubtitles, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get downloadSubtitles => + $composableBuilder(column: $table.downloadSubtitles, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get downloadArtwork => $composableBuilder( - column: $table.downloadArtwork, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get downloadArtwork => + $composableBuilder(column: $table.downloadArtwork, builder: (column) => ColumnOrderings(column)); } -class $$DownloadQueueTableAnnotationComposer - extends Composer<_$AppDatabase, $DownloadQueueTable> { +class $$DownloadQueueTableAnnotationComposer extends Composer<_$AppDatabase, $DownloadQueueTable> { $$DownloadQueueTableAnnotationComposer({ required super.$db, required super.$table, @@ -2973,29 +2414,20 @@ class $$DownloadQueueTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); - GeneratedColumn get mediaGlobalKey => $composableBuilder( - column: $table.mediaGlobalKey, - builder: (column) => column, - ); + GeneratedColumn get mediaGlobalKey => + $composableBuilder(column: $table.mediaGlobalKey, builder: (column) => column); - GeneratedColumn get priority => - $composableBuilder(column: $table.priority, builder: (column) => column); + GeneratedColumn get priority => $composableBuilder(column: $table.priority, builder: (column) => column); - GeneratedColumn get addedAt => - $composableBuilder(column: $table.addedAt, builder: (column) => column); + GeneratedColumn get addedAt => $composableBuilder(column: $table.addedAt, builder: (column) => column); - GeneratedColumn get downloadSubtitles => $composableBuilder( - column: $table.downloadSubtitles, - builder: (column) => column, - ); + GeneratedColumn get downloadSubtitles => + $composableBuilder(column: $table.downloadSubtitles, builder: (column) => column); - GeneratedColumn get downloadArtwork => $composableBuilder( - column: $table.downloadArtwork, - builder: (column) => column, - ); + GeneratedColumn get downloadArtwork => + $composableBuilder(column: $table.downloadArtwork, builder: (column) => column); } class $$DownloadQueueTableTableManager @@ -3009,14 +2441,7 @@ class $$DownloadQueueTableTableManager $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - ( - DownloadQueueItem, - BaseReferences< - _$AppDatabase, - $DownloadQueueTable, - DownloadQueueItem - >, - ), + (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), DownloadQueueItem, PrefetchHooks Function() > { @@ -3025,12 +2450,9 @@ class $$DownloadQueueTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$DownloadQueueTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$DownloadQueueTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$DownloadQueueTableAnnotationComposer($db: db, $table: table), + createFilteringComposer: () => $$DownloadQueueTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$DownloadQueueTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => $$DownloadQueueTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), @@ -3063,9 +2485,7 @@ class $$DownloadQueueTableTableManager downloadSubtitles: downloadSubtitles, downloadArtwork: downloadArtwork, ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -3081,10 +2501,7 @@ typedef $$DownloadQueueTableProcessedTableManager = $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - ( - DownloadQueueItem, - BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>, - ), + (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), DownloadQueueItem, PrefetchHooks Function() >; @@ -3105,8 +2522,7 @@ typedef $$ApiCacheTableUpdateCompanionBuilder = Value rowid, }); -class $$ApiCacheTableFilterComposer - extends Composer<_$AppDatabase, $ApiCacheTable> { +class $$ApiCacheTableFilterComposer extends Composer<_$AppDatabase, $ApiCacheTable> { $$ApiCacheTableFilterComposer({ required super.$db, required super.$table, @@ -3114,29 +2530,19 @@ class $$ApiCacheTableFilterComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnFilters get cacheKey => $composableBuilder( - column: $table.cacheKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get cacheKey => + $composableBuilder(column: $table.cacheKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get data => $composableBuilder( - column: $table.data, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get data => $composableBuilder(column: $table.data, builder: (column) => ColumnFilters(column)); - ColumnFilters get pinned => $composableBuilder( - column: $table.pinned, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get pinned => + $composableBuilder(column: $table.pinned, builder: (column) => ColumnFilters(column)); - ColumnFilters get cachedAt => $composableBuilder( - column: $table.cachedAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get cachedAt => + $composableBuilder(column: $table.cachedAt, builder: (column) => ColumnFilters(column)); } -class $$ApiCacheTableOrderingComposer - extends Composer<_$AppDatabase, $ApiCacheTable> { +class $$ApiCacheTableOrderingComposer extends Composer<_$AppDatabase, $ApiCacheTable> { $$ApiCacheTableOrderingComposer({ required super.$db, required super.$table, @@ -3144,29 +2550,20 @@ class $$ApiCacheTableOrderingComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnOrderings get cacheKey => $composableBuilder( - column: $table.cacheKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get cacheKey => + $composableBuilder(column: $table.cacheKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get data => $composableBuilder( - column: $table.data, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get data => + $composableBuilder(column: $table.data, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get pinned => $composableBuilder( - column: $table.pinned, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get pinned => + $composableBuilder(column: $table.pinned, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get cachedAt => $composableBuilder( - column: $table.cachedAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get cachedAt => + $composableBuilder(column: $table.cachedAt, builder: (column) => ColumnOrderings(column)); } -class $$ApiCacheTableAnnotationComposer - extends Composer<_$AppDatabase, $ApiCacheTable> { +class $$ApiCacheTableAnnotationComposer extends Composer<_$AppDatabase, $ApiCacheTable> { $$ApiCacheTableAnnotationComposer({ required super.$db, required super.$table, @@ -3174,17 +2571,13 @@ class $$ApiCacheTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get cacheKey => - $composableBuilder(column: $table.cacheKey, builder: (column) => column); + GeneratedColumn get cacheKey => $composableBuilder(column: $table.cacheKey, builder: (column) => column); - GeneratedColumn get data => - $composableBuilder(column: $table.data, builder: (column) => column); + GeneratedColumn get data => $composableBuilder(column: $table.data, builder: (column) => column); - GeneratedColumn get pinned => - $composableBuilder(column: $table.pinned, builder: (column) => column); + GeneratedColumn get pinned => $composableBuilder(column: $table.pinned, builder: (column) => column); - GeneratedColumn get cachedAt => - $composableBuilder(column: $table.cachedAt, builder: (column) => column); + GeneratedColumn get cachedAt => $composableBuilder(column: $table.cachedAt, builder: (column) => column); } class $$ApiCacheTableTableManager @@ -3198,10 +2591,7 @@ class $$ApiCacheTableTableManager $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - ( - ApiCacheData, - BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, - ), + (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), ApiCacheData, PrefetchHooks Function() > { @@ -3210,12 +2600,9 @@ class $$ApiCacheTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$ApiCacheTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ApiCacheTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ApiCacheTableAnnotationComposer($db: db, $table: table), + createFilteringComposer: () => $$ApiCacheTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$ApiCacheTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => $$ApiCacheTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value cacheKey = const Value.absent(), @@ -3223,13 +2610,7 @@ class $$ApiCacheTableTableManager Value pinned = const Value.absent(), Value cachedAt = const Value.absent(), Value rowid = const Value.absent(), - }) => ApiCacheCompanion( - cacheKey: cacheKey, - data: data, - pinned: pinned, - cachedAt: cachedAt, - rowid: rowid, - ), + }) => ApiCacheCompanion(cacheKey: cacheKey, data: data, pinned: pinned, cachedAt: cachedAt, rowid: rowid), createCompanionCallback: ({ required String cacheKey, @@ -3244,9 +2625,7 @@ class $$ApiCacheTableTableManager cachedAt: cachedAt, rowid: rowid, ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -3262,10 +2641,7 @@ typedef $$ApiCacheTableProcessedTableManager = $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - ( - ApiCacheData, - BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, - ), + (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), ApiCacheData, PrefetchHooks Function() >; @@ -3300,8 +2676,7 @@ typedef $$OfflineWatchProgressTableUpdateCompanionBuilder = Value lastError, }); -class $$OfflineWatchProgressTableFilterComposer - extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { +class $$OfflineWatchProgressTableFilterComposer extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { $$OfflineWatchProgressTableFilterComposer({ required super.$db, required super.$table, @@ -3309,69 +2684,43 @@ class $$OfflineWatchProgressTableFilterComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); - ColumnFilters get serverId => $composableBuilder( - column: $table.serverId, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get serverId => + $composableBuilder(column: $table.serverId, builder: (column) => ColumnFilters(column)); - ColumnFilters get ratingKey => $composableBuilder( - column: $table.ratingKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get ratingKey => + $composableBuilder(column: $table.ratingKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get globalKey => $composableBuilder( - column: $table.globalKey, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get globalKey => + $composableBuilder(column: $table.globalKey, builder: (column) => ColumnFilters(column)); - ColumnFilters get actionType => $composableBuilder( - column: $table.actionType, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get actionType => + $composableBuilder(column: $table.actionType, builder: (column) => ColumnFilters(column)); - ColumnFilters get viewOffset => $composableBuilder( - column: $table.viewOffset, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get viewOffset => + $composableBuilder(column: $table.viewOffset, builder: (column) => ColumnFilters(column)); - ColumnFilters get duration => $composableBuilder( - column: $table.duration, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get duration => + $composableBuilder(column: $table.duration, builder: (column) => ColumnFilters(column)); - ColumnFilters get shouldMarkWatched => $composableBuilder( - column: $table.shouldMarkWatched, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get shouldMarkWatched => + $composableBuilder(column: $table.shouldMarkWatched, builder: (column) => ColumnFilters(column)); - ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => ColumnFilters(column)); - ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get updatedAt => + $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnFilters(column)); - ColumnFilters get syncAttempts => $composableBuilder( - column: $table.syncAttempts, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get syncAttempts => + $composableBuilder(column: $table.syncAttempts, builder: (column) => ColumnFilters(column)); - ColumnFilters get lastError => $composableBuilder( - column: $table.lastError, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get lastError => + $composableBuilder(column: $table.lastError, builder: (column) => ColumnFilters(column)); } -class $$OfflineWatchProgressTableOrderingComposer - extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { +class $$OfflineWatchProgressTableOrderingComposer extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { $$OfflineWatchProgressTableOrderingComposer({ required super.$db, required super.$table, @@ -3379,69 +2728,43 @@ class $$OfflineWatchProgressTableOrderingComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get serverId => $composableBuilder( - column: $table.serverId, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get serverId => + $composableBuilder(column: $table.serverId, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get ratingKey => $composableBuilder( - column: $table.ratingKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get ratingKey => + $composableBuilder(column: $table.ratingKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get globalKey => $composableBuilder( - column: $table.globalKey, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get globalKey => + $composableBuilder(column: $table.globalKey, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get actionType => $composableBuilder( - column: $table.actionType, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get actionType => + $composableBuilder(column: $table.actionType, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get viewOffset => $composableBuilder( - column: $table.viewOffset, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get viewOffset => + $composableBuilder(column: $table.viewOffset, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get duration => $composableBuilder( - column: $table.duration, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get duration => + $composableBuilder(column: $table.duration, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get shouldMarkWatched => $composableBuilder( - column: $table.shouldMarkWatched, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get shouldMarkWatched => + $composableBuilder(column: $table.shouldMarkWatched, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get updatedAt => + $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get syncAttempts => $composableBuilder( - column: $table.syncAttempts, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get syncAttempts => + $composableBuilder(column: $table.syncAttempts, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get lastError => $composableBuilder( - column: $table.lastError, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get lastError => + $composableBuilder(column: $table.lastError, builder: (column) => ColumnOrderings(column)); } -class $$OfflineWatchProgressTableAnnotationComposer - extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { +class $$OfflineWatchProgressTableAnnotationComposer extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { $$OfflineWatchProgressTableAnnotationComposer({ required super.$db, required super.$table, @@ -3449,49 +2772,30 @@ class $$OfflineWatchProgressTableAnnotationComposer super.$addJoinBuilderToRootComposer, super.$removeJoinBuilderFromRootComposer, }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); + GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); - GeneratedColumn get serverId => - $composableBuilder(column: $table.serverId, builder: (column) => column); + GeneratedColumn get serverId => $composableBuilder(column: $table.serverId, builder: (column) => column); - GeneratedColumn get ratingKey => - $composableBuilder(column: $table.ratingKey, builder: (column) => column); + GeneratedColumn get ratingKey => $composableBuilder(column: $table.ratingKey, builder: (column) => column); - GeneratedColumn get globalKey => - $composableBuilder(column: $table.globalKey, builder: (column) => column); + GeneratedColumn get globalKey => $composableBuilder(column: $table.globalKey, builder: (column) => column); - GeneratedColumn get actionType => $composableBuilder( - column: $table.actionType, - builder: (column) => column, - ); + GeneratedColumn get actionType => $composableBuilder(column: $table.actionType, builder: (column) => column); - GeneratedColumn get viewOffset => $composableBuilder( - column: $table.viewOffset, - builder: (column) => column, - ); + GeneratedColumn get viewOffset => $composableBuilder(column: $table.viewOffset, builder: (column) => column); - GeneratedColumn get duration => - $composableBuilder(column: $table.duration, builder: (column) => column); + GeneratedColumn get duration => $composableBuilder(column: $table.duration, builder: (column) => column); - GeneratedColumn get shouldMarkWatched => $composableBuilder( - column: $table.shouldMarkWatched, - builder: (column) => column, - ); + GeneratedColumn get shouldMarkWatched => + $composableBuilder(column: $table.shouldMarkWatched, builder: (column) => column); - GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); + GeneratedColumn get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); - GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); + GeneratedColumn get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); - GeneratedColumn get syncAttempts => $composableBuilder( - column: $table.syncAttempts, - builder: (column) => column, - ); + GeneratedColumn get syncAttempts => $composableBuilder(column: $table.syncAttempts, builder: (column) => column); - GeneratedColumn get lastError => - $composableBuilder(column: $table.lastError, builder: (column) => column); + GeneratedColumn get lastError => $composableBuilder(column: $table.lastError, builder: (column) => column); } class $$OfflineWatchProgressTableTableManager @@ -3507,34 +2811,19 @@ class $$OfflineWatchProgressTableTableManager $$OfflineWatchProgressTableUpdateCompanionBuilder, ( OfflineWatchProgressItem, - BaseReferences< - _$AppDatabase, - $OfflineWatchProgressTable, - OfflineWatchProgressItem - >, + BaseReferences<_$AppDatabase, $OfflineWatchProgressTable, OfflineWatchProgressItem>, ), OfflineWatchProgressItem, PrefetchHooks Function() > { - $$OfflineWatchProgressTableTableManager( - _$AppDatabase db, - $OfflineWatchProgressTable table, - ) : super( + $$OfflineWatchProgressTableTableManager(_$AppDatabase db, $OfflineWatchProgressTable table) + : super( TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$OfflineWatchProgressTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$OfflineWatchProgressTableOrderingComposer( - $db: db, - $table: table, - ), - createComputedFieldComposer: () => - $$OfflineWatchProgressTableAnnotationComposer( - $db: db, - $table: table, - ), + createFilteringComposer: () => $$OfflineWatchProgressTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$OfflineWatchProgressTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => $$OfflineWatchProgressTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), @@ -3591,9 +2880,7 @@ class $$OfflineWatchProgressTableTableManager syncAttempts: syncAttempts, lastError: lastError, ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), + withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), prefetchHooksCallback: null, ), ); @@ -3609,14 +2896,7 @@ typedef $$OfflineWatchProgressTableProcessedTableManager = $$OfflineWatchProgressTableAnnotationComposer, $$OfflineWatchProgressTableCreateCompanionBuilder, $$OfflineWatchProgressTableUpdateCompanionBuilder, - ( - OfflineWatchProgressItem, - BaseReferences< - _$AppDatabase, - $OfflineWatchProgressTable, - OfflineWatchProgressItem - >, - ), + (OfflineWatchProgressItem, BaseReferences<_$AppDatabase, $OfflineWatchProgressTable, OfflineWatchProgressItem>), OfflineWatchProgressItem, PrefetchHooks Function() >; @@ -3626,10 +2906,8 @@ class $AppDatabaseManager { $AppDatabaseManager(this._db); $$DownloadedMediaTableTableManager get downloadedMedia => $$DownloadedMediaTableTableManager(_db, _db.downloadedMedia); - $$DownloadQueueTableTableManager get downloadQueue => - $$DownloadQueueTableTableManager(_db, _db.downloadQueue); - $$ApiCacheTableTableManager get apiCache => - $$ApiCacheTableTableManager(_db, _db.apiCache); + $$DownloadQueueTableTableManager get downloadQueue => $$DownloadQueueTableTableManager(_db, _db.downloadQueue); + $$ApiCacheTableTableManager get apiCache => $$ApiCacheTableTableManager(_db, _db.apiCache); $$OfflineWatchProgressTableTableManager get offlineWatchProgress => $$OfflineWatchProgressTableTableManager(_db, _db.offlineWatchProgress); } diff --git a/lib/models/companion_remote/recent_remote_session.dart b/lib/models/companion_remote/recent_remote_session.dart index b49f7213..18a72877 100644 --- a/lib/models/companion_remote/recent_remote_session.dart +++ b/lib/models/companion_remote/recent_remote_session.dart @@ -10,6 +10,7 @@ class RecentRemoteSession { final String deviceName; final String platform; final DateTime lastConnected; + final String? hostAddress; // Format: "ip:port" RecentRemoteSession({ required this.sessionId, @@ -17,25 +18,32 @@ class RecentRemoteSession { required this.deviceName, required this.platform, required this.lastConnected, + this.hostAddress, }); factory RecentRemoteSession.fromJson(Map json) => _$RecentRemoteSessionFromJson(json); Map toJson() => _$RecentRemoteSessionToJson(this); - /// Create from QR code data (format: "sessionId:pin:deviceName:platform") + /// Create from QR code data (format: "ip|port|sessionId|pin") factory RecentRemoteSession.fromQrData(String qrData) { - final parts = qrData.split(':'); - if (parts.length < 2) { - throw FormatException('Invalid QR code format'); + final parts = qrData.split('|'); + if (parts.length < 4) { + throw FormatException('Invalid QR code format - expected ip|port|sessionId|pin'); } + final ip = parts[0]; + final port = parts[1]; + final sessionId = parts[2]; + final pin = parts[3]; + return RecentRemoteSession( - sessionId: parts[0], - pin: parts[1], - deviceName: parts.length > 2 ? parts[2] : 'Unknown Device', - platform: parts.length > 3 ? parts[3] : 'unknown', + sessionId: sessionId, + pin: pin, + deviceName: 'Unknown Device', + platform: 'unknown', lastConnected: DateTime.now(), + hostAddress: '$ip:$port', ); } diff --git a/lib/models/companion_remote/recent_remote_session.g.dart b/lib/models/companion_remote/recent_remote_session.g.dart index 6f5f0685..4a97dfe5 100644 --- a/lib/models/companion_remote/recent_remote_session.g.dart +++ b/lib/models/companion_remote/recent_remote_session.g.dart @@ -12,6 +12,7 @@ RecentRemoteSession _$RecentRemoteSessionFromJson(Map json) => deviceName: json['deviceName'] as String, platform: json['platform'] as String, lastConnected: DateTime.parse(json['lastConnected'] as String), + hostAddress: json['hostAddress'] as String?, ); Map _$RecentRemoteSessionToJson(RecentRemoteSession instance) => { @@ -20,4 +21,5 @@ Map _$RecentRemoteSessionToJson(RecentRemoteSession instance) = 'deviceName': instance.deviceName, 'platform': instance.platform, 'lastConnected': instance.lastConnected.toIso8601String(), + 'hostAddress': instance.hostAddress, }; diff --git a/lib/models/companion_remote/remote_session.dart b/lib/models/companion_remote/remote_session.dart index a984ac7d..e7b98c4b 100644 --- a/lib/models/companion_remote/remote_session.dart +++ b/lib/models/companion_remote/remote_session.dart @@ -90,17 +90,19 @@ class RemoteSession { RemoteSessionRole? role, RemoteSessionStatus? status, RemoteDevice? connectedDevice, + bool clearConnectedDevice = false, DateTime? createdAt, String? errorMessage, + bool clearErrorMessage = false, }) { return RemoteSession( sessionId: sessionId ?? this.sessionId, pin: pin ?? this.pin, role: role ?? this.role, status: status ?? this.status, - connectedDevice: connectedDevice ?? this.connectedDevice, + connectedDevice: clearConnectedDevice ? null : (connectedDevice ?? this.connectedDevice), createdAt: createdAt ?? this.createdAt, - errorMessage: errorMessage ?? this.errorMessage, + errorMessage: clearErrorMessage ? null : (errorMessage ?? this.errorMessage), ); } } diff --git a/lib/models/play_queue_response.g.dart b/lib/models/play_queue_response.g.dart index 8f8e3aa9..7a197697 100644 --- a/lib/models/play_queue_response.g.dart +++ b/lib/models/play_queue_response.g.dart @@ -6,23 +6,15 @@ part of 'play_queue_response.dart'; // JsonSerializableGenerator // ************************************************************************** -PlayQueueResponse _$PlayQueueResponseFromJson(Map json) => - PlayQueueResponse( - playQueueID: (json['playQueueID'] as num).toInt(), - playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?) - ?.toInt(), - playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?) - ?.toInt(), - playQueueSelectedMetadataItemID: - json['playQueueSelectedMetadataItemID'] as String?, - playQueueShuffled: const BoolOrIntConverter().fromJson( - json['playQueueShuffled'] as Object, - ), - playQueueSourceURI: json['playQueueSourceURI'] as String?, - playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(), - playQueueVersion: (json['playQueueVersion'] as num).toInt(), - size: (json['size'] as num?)?.toInt(), - items: (json['Metadata'] as List?) - ?.map((e) => PlexMetadata.fromJson(e as Map)) - .toList(), - ); +PlayQueueResponse _$PlayQueueResponseFromJson(Map json) => PlayQueueResponse( + playQueueID: (json['playQueueID'] as num).toInt(), + playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?)?.toInt(), + playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?)?.toInt(), + playQueueSelectedMetadataItemID: json['playQueueSelectedMetadataItemID'] as String?, + playQueueShuffled: const BoolOrIntConverter().fromJson(json['playQueueShuffled'] as Object), + playQueueSourceURI: json['playQueueSourceURI'] as String?, + playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(), + playQueueVersion: (json['playQueueVersion'] as num).toInt(), + size: (json['size'] as num?)?.toInt(), + items: (json['Metadata'] as List?)?.map((e) => PlexMetadata.fromJson(e as Map)).toList(), +); diff --git a/lib/models/plex_library.g.dart b/lib/models/plex_library.g.dart index 78565719..cbca367d 100644 --- a/lib/models/plex_library.g.dart +++ b/lib/models/plex_library.g.dart @@ -19,16 +19,15 @@ PlexLibrary _$PlexLibraryFromJson(Map json) => PlexLibrary( hidden: (json['hidden'] as num?)?.toInt(), ); -Map _$PlexLibraryToJson(PlexLibrary instance) => - { - 'key': instance.key, - 'title': instance.title, - 'type': instance.type, - 'agent': instance.agent, - 'scanner': instance.scanner, - 'language': instance.language, - 'uuid': instance.uuid, - 'updatedAt': instance.updatedAt, - 'createdAt': instance.createdAt, - 'hidden': instance.hidden, - }; +Map _$PlexLibraryToJson(PlexLibrary instance) => { + 'key': instance.key, + 'title': instance.title, + 'type': instance.type, + 'agent': instance.agent, + 'scanner': instance.scanner, + 'language': instance.language, + 'uuid': instance.uuid, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + 'hidden': instance.hidden, +}; diff --git a/lib/models/plex_metadata.g.dart b/lib/models/plex_metadata.g.dart index adf96e91..d67a5fe4 100644 --- a/lib/models/plex_metadata.g.dart +++ b/lib/models/plex_metadata.g.dart @@ -41,9 +41,7 @@ PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( leafCount: (json['leafCount'] as num?)?.toInt(), viewedLeafCount: (json['viewedLeafCount'] as num?)?.toInt(), childCount: (json['childCount'] as num?)?.toInt(), - role: (json['Role'] as List?) - ?.map((e) => PlexRole.fromJson(e as Map)) - .toList(), + role: (json['Role'] as List?)?.map((e) => PlexRole.fromJson(e as Map)).toList(), audioLanguage: json['audioLanguage'] as String?, subtitleLanguage: json['subtitleLanguage'] as String?, playlistItemID: (json['playlistItemID'] as num?)?.toInt(), @@ -54,49 +52,48 @@ PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( clearLogo: json['clearLogo'] as String?, ); -Map _$PlexMetadataToJson(PlexMetadata instance) => - { - 'ratingKey': instance.ratingKey, - 'key': instance.key, - 'guid': instance.guid, - 'studio': instance.studio, - 'type': instance.type, - 'title': instance.title, - 'titleSort': instance.titleSort, - 'contentRating': instance.contentRating, - 'summary': instance.summary, - 'rating': instance.rating, - 'audienceRating': instance.audienceRating, - 'year': instance.year, - 'originallyAvailableAt': instance.originallyAvailableAt, - 'thumb': instance.thumb, - 'art': instance.art, - 'duration': instance.duration, - 'addedAt': instance.addedAt, - 'updatedAt': instance.updatedAt, - 'lastViewedAt': instance.lastViewedAt, - 'grandparentTitle': instance.grandparentTitle, - 'grandparentThumb': instance.grandparentThumb, - 'grandparentArt': instance.grandparentArt, - 'grandparentRatingKey': instance.grandparentRatingKey, - 'parentTitle': instance.parentTitle, - 'parentThumb': instance.parentThumb, - 'parentRatingKey': instance.parentRatingKey, - 'parentIndex': instance.parentIndex, - 'index': instance.index, - 'grandparentTheme': instance.grandparentTheme, - 'viewOffset': instance.viewOffset, - 'viewCount': instance.viewCount, - 'leafCount': instance.leafCount, - 'viewedLeafCount': instance.viewedLeafCount, - 'childCount': instance.childCount, - 'Role': instance.role, - 'audioLanguage': instance.audioLanguage, - 'subtitleLanguage': instance.subtitleLanguage, - 'playlistItemID': instance.playlistItemID, - 'playQueueItemID': instance.playQueueItemID, - 'librarySectionID': instance.librarySectionID, - 'ratingImage': instance.ratingImage, - 'audienceRatingImage': instance.audienceRatingImage, - 'clearLogo': instance.clearLogo, - }; +Map _$PlexMetadataToJson(PlexMetadata instance) => { + 'ratingKey': instance.ratingKey, + 'key': instance.key, + 'guid': instance.guid, + 'studio': instance.studio, + 'type': instance.type, + 'title': instance.title, + 'titleSort': instance.titleSort, + 'contentRating': instance.contentRating, + 'summary': instance.summary, + 'rating': instance.rating, + 'audienceRating': instance.audienceRating, + 'year': instance.year, + 'originallyAvailableAt': instance.originallyAvailableAt, + 'thumb': instance.thumb, + 'art': instance.art, + 'duration': instance.duration, + 'addedAt': instance.addedAt, + 'updatedAt': instance.updatedAt, + 'lastViewedAt': instance.lastViewedAt, + 'grandparentTitle': instance.grandparentTitle, + 'grandparentThumb': instance.grandparentThumb, + 'grandparentArt': instance.grandparentArt, + 'grandparentRatingKey': instance.grandparentRatingKey, + 'parentTitle': instance.parentTitle, + 'parentThumb': instance.parentThumb, + 'parentRatingKey': instance.parentRatingKey, + 'parentIndex': instance.parentIndex, + 'index': instance.index, + 'grandparentTheme': instance.grandparentTheme, + 'viewOffset': instance.viewOffset, + 'viewCount': instance.viewCount, + 'leafCount': instance.leafCount, + 'viewedLeafCount': instance.viewedLeafCount, + 'childCount': instance.childCount, + 'Role': instance.role, + 'audioLanguage': instance.audioLanguage, + 'subtitleLanguage': instance.subtitleLanguage, + 'playlistItemID': instance.playlistItemID, + 'playQueueItemID': instance.playQueueItemID, + 'librarySectionID': instance.librarySectionID, + 'ratingImage': instance.ratingImage, + 'audienceRatingImage': instance.audienceRatingImage, + 'clearLogo': instance.clearLogo, +}; diff --git a/lib/models/plex_playlist.g.dart b/lib/models/plex_playlist.g.dart index 96647865..a21f8f84 100644 --- a/lib/models/plex_playlist.g.dart +++ b/lib/models/plex_playlist.g.dart @@ -26,23 +26,22 @@ PlexPlaylist _$PlexPlaylistFromJson(Map json) => PlexPlaylist( thumb: json['thumb'] as String?, ); -Map _$PlexPlaylistToJson(PlexPlaylist instance) => - { - 'ratingKey': instance.ratingKey, - 'key': instance.key, - 'type': instance.type, - 'title': instance.title, - 'summary': instance.summary, - 'smart': instance.smart, - 'playlistType': instance.playlistType, - 'duration': instance.duration, - 'leafCount': instance.leafCount, - 'composite': instance.composite, - 'addedAt': instance.addedAt, - 'updatedAt': instance.updatedAt, - 'lastViewedAt': instance.lastViewedAt, - 'viewCount': instance.viewCount, - 'content': instance.content, - 'guid': instance.guid, - 'thumb': instance.thumb, - }; +Map _$PlexPlaylistToJson(PlexPlaylist instance) => { + 'ratingKey': instance.ratingKey, + 'key': instance.key, + 'type': instance.type, + 'title': instance.title, + 'summary': instance.summary, + 'smart': instance.smart, + 'playlistType': instance.playlistType, + 'duration': instance.duration, + 'leafCount': instance.leafCount, + 'composite': instance.composite, + 'addedAt': instance.addedAt, + 'updatedAt': instance.updatedAt, + 'lastViewedAt': instance.lastViewedAt, + 'viewCount': instance.viewCount, + 'content': instance.content, + 'guid': instance.guid, + 'thumb': instance.thumb, +}; diff --git a/lib/providers/companion_remote_provider.dart b/lib/providers/companion_remote_provider.dart index f44935f3..01416abc 100644 --- a/lib/providers/companion_remote_provider.dart +++ b/lib/providers/companion_remote_provider.dart @@ -36,6 +36,7 @@ class CompanionRemoteProvider with ChangeNotifier { bool _intentionalDisconnect = false; String? _lastSessionId; String? _lastPin; + String? _lastHostAddress; int get reconnectAttempts => _reconnectAttempts; @@ -130,7 +131,10 @@ class CompanionRemoteProvider with ChangeNotifier { _deviceDisconnectedSubscription = _peerService!.onDeviceDisconnected.listen((_) { appLogger.d('CompanionRemote: Device disconnected (intentional: $_intentionalDisconnect)'); if (_intentionalDisconnect) { - _session = _session?.copyWith(status: RemoteSessionStatus.disconnected, connectedDevice: null); + _session = _session?.copyWith( + status: RemoteSessionStatus.disconnected, + clearConnectedDevice: true, + ); notifyListeners(); } else { _session = _session?.copyWith(status: RemoteSessionStatus.reconnecting); @@ -182,7 +186,7 @@ class CompanionRemoteProvider with ChangeNotifier { _statusSubscription = null; } - Future<({String sessionId, String pin})> createSession() async { + Future<({String sessionId, String pin, String address})> createSession() async { await leaveSession(); appLogger.d('CompanionRemote: Creating session as host'); @@ -201,7 +205,9 @@ class CompanionRemoteProvider with ChangeNotifier { ); notifyListeners(); - appLogger.d('CompanionRemote: Session created - ID: ${result.sessionId}, PIN: ${result.pin}'); + appLogger.d( + 'CompanionRemote: Session created - ID: ${result.sessionId}, PIN: ${result.pin}, Address: ${result.address}', + ); return result; } catch (e) { @@ -218,13 +224,14 @@ class CompanionRemoteProvider with ChangeNotifier { } } - Future joinSession(String sessionId, String pin) async { + Future joinSession(String sessionId, String pin, String hostAddress) async { await leaveSession(); _lastSessionId = sessionId; _lastPin = pin; + _lastHostAddress = hostAddress; - appLogger.d('CompanionRemote: Joining session - ID: $sessionId'); + appLogger.d('CompanionRemote: Joining session - ID: $sessionId, Host: $hostAddress'); _peerService = CompanionRemotePeerService(); _setupPeerServiceListeners(); @@ -238,7 +245,7 @@ class CompanionRemoteProvider with ChangeNotifier { notifyListeners(); try { - await _peerService!.joinSession(sessionId, pin, _deviceName, _platform); + await _peerService!.joinSession(sessionId, pin, _deviceName, _platform, hostAddress); _session = _session?.copyWith(status: RemoteSessionStatus.connected); notifyListeners(); @@ -289,7 +296,7 @@ class CompanionRemoteProvider with ChangeNotifier { } Future _attemptReconnect() async { - if (_lastSessionId == null || _lastPin == null) { + if (_lastSessionId == null || _lastPin == null || _lastHostAddress == null) { appLogger.w('CompanionRemote: No stored credentials for reconnect'); _session = _session?.copyWith(status: RemoteSessionStatus.error, errorMessage: 'Connection lost'); notifyListeners(); @@ -305,7 +312,7 @@ class CompanionRemoteProvider with ChangeNotifier { _peerService = CompanionRemotePeerService(); _setupPeerServiceListeners(); - await _peerService!.joinSession(_lastSessionId!, _lastPin!, _deviceName, _platform); + await _peerService!.joinSession(_lastSessionId!, _lastPin!, _deviceName, _platform, _lastHostAddress!); _session = _session?.copyWith(status: RemoteSessionStatus.connected); _reconnectAttempts = 0; @@ -330,7 +337,10 @@ class CompanionRemoteProvider with ChangeNotifier { void cancelReconnect() { _reconnectTimer?.cancel(); _reconnectAttempts = 0; - _session = _session?.copyWith(status: RemoteSessionStatus.disconnected, connectedDevice: null); + _session = _session?.copyWith( + status: RemoteSessionStatus.disconnected, + clearConnectedDevice: true, + ); notifyListeners(); } @@ -479,6 +489,7 @@ class CompanionRemoteProvider with ChangeNotifier { deviceName: deviceToSave.name, platform: deviceToSave.platform, lastConnected: DateTime.now(), + hostAddress: _peerService?.hostAddress, ); if (_discoveryService != null) { @@ -488,7 +499,13 @@ class CompanionRemoteProvider with ChangeNotifier { /// Connect to a recent session Future connectToRecentSession(RecentRemoteSession session) async { - await joinSession(session.sessionId, session.pin); + if (session.hostAddress == null) { + throw const RemotePeerError( + type: RemotePeerErrorType.invalidSession, + message: 'No host address available for this session. Please scan a new QR code.', + ); + } + await joinSession(session.sessionId, session.pin, session.hostAddress!); } /// Remove a recent session diff --git a/lib/screens/companion_remote/mobile_remote_screen.dart b/lib/screens/companion_remote/mobile_remote_screen.dart index 53f164dc..4d39db5d 100644 --- a/lib/screens/companion_remote/mobile_remote_screen.dart +++ b/lib/screens/companion_remote/mobile_remote_screen.dart @@ -35,14 +35,8 @@ class _MobileRemoteScreenState extends State { title: const Text('Disconnect'), content: const Text('Do you want to disconnect from the remote session?'), actions: [ - TextButton( - onPressed: () => Navigator.pop(context, false), - child: const Text('Cancel'), - ), - TextButton( - onPressed: () => Navigator.pop(context, true), - child: const Text('Disconnect'), - ), + TextButton(onPressed: () => Navigator.pop(context, false), child: const Text('Cancel')), + TextButton(onPressed: () => Navigator.pop(context, true), child: const Text('Disconnect')), ], ), ); @@ -68,10 +62,7 @@ class _MobileRemoteScreenState extends State { children: [ const CircularProgressIndicator(), const SizedBox(height: 24), - Text( - 'Reconnecting...', - style: Theme.of(context).textTheme.titleLarge, - ), + Text('Reconnecting...', style: Theme.of(context).textTheme.titleLarge), const SizedBox(height: 8), Text( 'Attempt ${provider.reconnectAttempts} of 5', @@ -81,15 +72,9 @@ class _MobileRemoteScreenState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - OutlinedButton( - onPressed: () => provider.cancelReconnect(), - child: const Text('Cancel'), - ), + OutlinedButton(onPressed: () => provider.cancelReconnect(), child: const Text('Cancel')), const SizedBox(width: 16), - FilledButton( - onPressed: () => provider.retryReconnectNow(), - child: const Text('Retry Now'), - ), + FilledButton(onPressed: () => provider.retryReconnectNow(), child: const Text('Retry Now')), ], ), ], @@ -114,10 +99,7 @@ class _MobileRemoteScreenState extends State { const SizedBox(height: 32), FilledButton.icon( onPressed: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const PairingScreen()), - ); + Navigator.push(context, MaterialPageRoute(builder: (context) => const PairingScreen())); }, icon: const Icon(Icons.link), label: const Text('Connect to Device'), @@ -141,10 +123,7 @@ class _RemoteControlLayout extends StatelessWidget { Widget build(BuildContext context) { if (PlatformDetector.isDesktop(context)) { return Center( - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 400), - child: const _RemoteControlContent(), - ), + child: ConstrainedBox(constraints: const BoxConstraints(maxWidth: 400), child: const _RemoteControlContent()), ); } @@ -195,10 +174,7 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { color: Theme.of(context).colorScheme.primaryContainer, child: Row( children: [ - Icon( - Icons.computer, - color: Theme.of(context).colorScheme.onPrimaryContainer, - ), + Icon(Icons.computer, color: Theme.of(context).colorScheme.onPrimaryContainer), const SizedBox(width: 12), Expanded( child: Column( @@ -206,15 +182,15 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { children: [ Text( device.name, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Theme.of(context).colorScheme.onPrimaryContainer, - ), + style: Theme.of( + context, + ).textTheme.titleMedium?.copyWith(color: Theme.of(context).colorScheme.onPrimaryContainer), ), Text( device.platform, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Theme.of(context).colorScheme.onPrimaryContainer, - ), + style: Theme.of( + context, + ).textTheme.bodySmall?.copyWith(color: Theme.of(context).colorScheme.onPrimaryContainer), ), ], ), @@ -222,10 +198,7 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { Container( width: 8, height: 8, - decoration: BoxDecoration( - color: Colors.green, - shape: BoxShape.circle, - ), + decoration: BoxDecoration(color: Colors.green, shape: BoxShape.circle), ), ], ), @@ -269,16 +242,8 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - _RemoteButton( - icon: Icons.home, - label: 'Home', - onPressed: () => _sendCommand(RemoteCommandType.home), - ), - _RemoteButton( - icon: Icons.arrow_back, - label: 'Back', - onPressed: () => _sendCommand(RemoteCommandType.back), - ), + _RemoteButton(icon: Icons.home, label: 'Home', onPressed: () => _sendCommand(RemoteCommandType.home)), + _RemoteButton(icon: Icons.arrow_back, label: 'Back', onPressed: () => _sendCommand(RemoteCommandType.back)), _RemoteButton( icon: Icons.menu, label: 'Menu', @@ -287,14 +252,9 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { ], ), const SizedBox(height: 32), - Center( - child: _DPad(onCommand: _sendCommand), - ), + Center(child: _DPad(onCommand: _sendCommand)), const SizedBox(height: 32), - Text( - 'Tab Navigation', - style: Theme.of(context).textTheme.titleMedium, - ), + Text('Tab Navigation', style: Theme.of(context).textTheme.titleMedium), const SizedBox(height: 16), Wrap( spacing: 8, @@ -370,11 +330,7 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { onPressed: () => _sendCommand(RemoteCommandType.seekBackward), ), const SizedBox(width: 16), - _RemoteButton( - icon: Icons.stop, - label: 'Stop', - onPressed: () => _sendCommand(RemoteCommandType.stop), - ), + _RemoteButton(icon: Icons.stop, label: 'Stop', onPressed: () => _sendCommand(RemoteCommandType.stop)), const SizedBox(width: 16), _RemoteButton( icon: Icons.forward_10, @@ -384,10 +340,7 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { ], ), const SizedBox(height: 32), - Text( - 'Volume', - style: Theme.of(context).textTheme.titleMedium, - ), + Text('Volume', style: Theme.of(context).textTheme.titleMedium), const SizedBox(height: 16), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -424,11 +377,7 @@ class _RemoteControlContentState extends State<_RemoteControlContent> { runSpacing: 12, alignment: WrapAlignment.center, children: [ - _RemoteCard( - icon: Icons.search, - label: 'Search', - onPressed: _showSearchSheet, - ), + _RemoteCard(icon: Icons.search, label: 'Search', onPressed: _showSearchSheet), _RemoteCard( icon: Icons.fullscreen, label: 'Fullscreen', @@ -583,19 +532,12 @@ class _RemoteButton extends StatelessWidget { HapticFeedback.lightImpact(); onPressed(); }, - style: FilledButton.styleFrom( - padding: EdgeInsets.zero, - shape: const CircleBorder(), - ), + style: FilledButton.styleFrom(padding: EdgeInsets.zero, shape: const CircleBorder()), child: Icon(icon, size: iconSize), ), ), const SizedBox(height: 4), - Text( - label, - style: Theme.of(context).textTheme.bodySmall, - textAlign: TextAlign.center, - ), + Text(label, style: Theme.of(context).textTheme.bodySmall, textAlign: TextAlign.center), ], ); } @@ -606,11 +548,7 @@ class _RemoteChip extends StatelessWidget { final String label; final VoidCallback onPressed; - const _RemoteChip({ - required this.icon, - required this.label, - required this.onPressed, - }); + const _RemoteChip({required this.icon, required this.label, required this.onPressed}); @override Widget build(BuildContext context) { @@ -654,12 +592,7 @@ class _SearchBottomSheetState extends State<_SearchBottomSheet> { @override Widget build(BuildContext context) { return Padding( - padding: EdgeInsets.only( - bottom: MediaQuery.viewInsetsOf(context).bottom, - left: 16, - right: 16, - top: 16, - ), + padding: EdgeInsets.only(bottom: MediaQuery.viewInsetsOf(context).bottom, left: 16, right: 16, top: 16), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -669,13 +602,8 @@ class _SearchBottomSheetState extends State<_SearchBottomSheet> { decoration: InputDecoration( hintText: 'Search on desktop...', prefixIcon: const Icon(Icons.search), - suffixIcon: IconButton( - icon: const Icon(Icons.send), - onPressed: () => _submit(_controller.text), - ), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(100), - ), + suffixIcon: IconButton(icon: const Icon(Icons.send), onPressed: () => _submit(_controller.text)), + border: OutlineInputBorder(borderRadius: BorderRadius.circular(100)), ), onSubmitted: _submit, ), @@ -691,11 +619,7 @@ class _RemoteCard extends StatelessWidget { final String label; final VoidCallback onPressed; - const _RemoteCard({ - required this.icon, - required this.label, - required this.onPressed, - }); + const _RemoteCard({required this.icon, required this.label, required this.onPressed}); @override Widget build(BuildContext context) { @@ -714,11 +638,7 @@ class _RemoteCard extends StatelessWidget { children: [ Icon(icon, size: 32), const SizedBox(height: 8), - Text( - label, - style: Theme.of(context).textTheme.bodySmall, - textAlign: TextAlign.center, - ), + Text(label, style: Theme.of(context).textTheme.bodySmall, textAlign: TextAlign.center), ], ), ), diff --git a/lib/screens/companion_remote/pairing_screen.dart b/lib/screens/companion_remote/pairing_screen.dart index 96bff012..d06956ff 100644 --- a/lib/screens/companion_remote/pairing_screen.dart +++ b/lib/screens/companion_remote/pairing_screen.dart @@ -17,6 +17,7 @@ class PairingScreen extends StatefulWidget { } class _PairingScreenState extends State { + final _hostAddressController = TextEditingController(); final _sessionIdController = TextEditingController(); final _pinController = TextEditingController(); final _formKey = GlobalKey(); @@ -44,6 +45,7 @@ class _PairingScreenState extends State { @override void dispose() { + _hostAddressController.dispose(); _sessionIdController.dispose(); _pinController.dispose(); _scannerController?.dispose(); @@ -105,7 +107,11 @@ class _PairingScreenState extends State { try { final provider = context.read(); - await provider.joinSession(_sessionIdController.text.trim().toUpperCase(), _pinController.text.trim()); + await provider.joinSession( + _sessionIdController.text.trim().toUpperCase(), + _pinController.text.trim(), + _hostAddressController.text.trim(), + ); if (mounted) { Navigator.of(context).pop(); @@ -133,26 +139,33 @@ class _PairingScreenState extends State { if (data == _lastScannedCode) return; _lastScannedCode = data; - final parts = data.split(':'); - if (parts.length == 2) { + // New format: ip|port|sessionId|pin (4 parts separated by pipe) + final parts = data.split('|'); + if (parts.length == 4) { + final ip = parts[0]; + final port = parts[1]; + final sessionId = parts[2]; + final pin = parts[3]; + final hostAddress = '$ip:$port'; + _scannerController?.stop(); setState(() { _errorMessage = null; _isConnecting = true; }); // Connect directly instead of going through _connect() which requires Form validation - _connectWithCredentials(parts[0], parts[1]); + _connectWithCredentials(sessionId, pin, hostAddress); } else { setState(() { - _errorMessage = 'Invalid QR code format'; + _errorMessage = 'Invalid QR code format - expected 4 parts (ip|port|sessionId|pin)'; }); } } - Future _connectWithCredentials(String sessionId, String pin) async { + Future _connectWithCredentials(String sessionId, String pin, String hostAddress) async { try { final provider = context.read(); - await provider.joinSession(sessionId.trim().toUpperCase(), pin.trim()); + await provider.joinSession(sessionId.trim().toUpperCase(), pin.trim(), hostAddress.trim()); if (mounted) { Navigator.of(context).pop(); @@ -472,6 +485,33 @@ class _PairingScreenState extends State { ), const SizedBox(height: 16), ], + TextFormField( + controller: _hostAddressController, + decoration: InputDecoration( + labelText: 'Host Address', + hintText: '192.168.1.100:48632', + border: const OutlineInputBorder(), + prefixIcon: const Icon(Icons.computer), + suffixIcon: IconButton( + icon: const Icon(Icons.paste), + onPressed: () => _pasteFromClipboard(_hostAddressController), + tooltip: 'Paste', + ), + ), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter host address'; + } + // Validate IP:port format + final parts = value.split(':'); + if (parts.length != 2) { + return 'Format must be IP:port (e.g., 192.168.1.100:48632)'; + } + return null; + }, + enabled: !_isConnecting, + ), + const SizedBox(height: 16), TextFormField( controller: _sessionIdController, decoration: InputDecoration( diff --git a/lib/screens/discover_screen.dart b/lib/screens/discover_screen.dart index c2c326fc..beb6874b 100644 --- a/lib/screens/discover_screen.dart +++ b/lib/screens/discover_screen.dart @@ -1129,7 +1129,9 @@ class _DiscoverScreenState extends State onKeyEvent: isDesktop ? _handleCompanionRemoteKeyEvent : null, child: Container( decoration: BoxDecoration( - color: isDesktop && _isCompanionRemoteFocused ? Colors.white.withValues(alpha: 0.2) : Colors.transparent, + color: isDesktop && _isCompanionRemoteFocused + ? Colors.white.withValues(alpha: 0.2) + : Colors.transparent, borderRadius: BorderRadius.circular(20), ), child: Stack( @@ -1144,10 +1146,7 @@ class _DiscoverScreenState extends State if (isDesktop) { RemoteSessionDialog.show(context); } else { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => MobileRemoteScreen()), - ); + Navigator.push(context, MaterialPageRoute(builder: (context) => MobileRemoteScreen())); } }, tooltip: 'Companion Remote', @@ -1372,12 +1371,7 @@ class _DiscoverScreenState extends State // Overlaid app bar — excluded from default focus traversal so that // initial/tab-switch focus lands on content (hero/hubs), not the toolbar. // Toolbar buttons are still reachable via explicit UP from hero section. - Positioned( - top: 0, - left: 0, - right: 0, - child: ExcludeFocusTraversal(child: _buildOverlaidAppBar()), - ), + Positioned(top: 0, left: 0, right: 0, child: ExcludeFocusTraversal(child: _buildOverlaidAppBar())), ], ), ); diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 14f4de84..cee45320 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -816,10 +816,7 @@ class _SettingsScreenState extends State with FocusableTab { : const Text('Control a desktop device'), trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1), onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const MobileRemoteScreen()), - ); + Navigator.push(context, MaterialPageRoute(builder: (context) => const MobileRemoteScreen())); }, ), ], diff --git a/lib/services/companion_remote/companion_remote_peer_service.dart b/lib/services/companion_remote/companion_remote_peer_service.dart index 72dfccbd..697d9649 100644 --- a/lib/services/companion_remote/companion_remote_peer_service.dart +++ b/lib/services/companion_remote/companion_remote_peer_service.dart @@ -1,7 +1,9 @@ import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; import 'dart:math'; -import 'package:peerdart/peerdart.dart'; +import 'package:web_socket_channel/io.dart'; import '../../models/companion_remote/remote_command.dart'; import '../../models/companion_remote/remote_command_type.dart'; @@ -15,6 +17,8 @@ enum RemotePeerErrorType { serverError, timeout, invalidSession, + authFailed, + networkError, unknown, } @@ -23,22 +27,24 @@ class RemotePeerError { final String message; final dynamic originalError; - const RemotePeerError({ - required this.type, - required this.message, - this.originalError, - }); + const RemotePeerError({required this.type, required this.message, this.originalError}); @override String toString() => 'RemotePeerError($type): $message'; } class CompanionRemotePeerService { - Peer? _peer; - DataConnection? _connection; + // Server-side (host) fields + HttpServer? _server; + WebSocket? _clientSocket; + + // Client-side (remote) fields + IOWebSocketChannel? _channel; + String? _sessionId; String? _pin; String? _myPeerId; + String? _hostAddress; // Format: "ip:port" RemoteSessionRole? _role; final _commandReceivedController = StreamController.broadcast(); @@ -47,9 +53,6 @@ class CompanionRemotePeerService { final _errorController = StreamController.broadcast(); final _connectionStateController = StreamController.broadcast(); - int _reconnectAttempts = 0; - static const int _maxReconnectAttempts = 3; - Timer? _reconnectTimer; Timer? _pingTimer; Stream get onCommandReceived => _commandReceivedController.stream; @@ -61,9 +64,10 @@ class CompanionRemotePeerService { String? get sessionId => _sessionId; String? get pin => _pin; String? get myPeerId => _myPeerId; + String? get hostAddress => _hostAddress; RemoteSessionRole? get role => _role; bool get isHost => _role == RemoteSessionRole.host; - bool get isConnected => _connection != null; + bool get isConnected => _clientSocket != null || (_channel != null && _channel?.closeCode == null); String _generateSessionId() { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; @@ -76,263 +80,368 @@ class CompanionRemotePeerService { return List.generate(6, (index) => random.nextInt(10).toString()).join(); } - void _attachCommonPeerListeners({ - required Completer completer, - required RemotePeerErrorType errorType, - required String errorMessage, - }) { - _peer!.on('disconnected').listen((_) { - appLogger.w('CompanionRemote: Peer disconnected from server'); - _handleDisconnectedFromServer(); - }); + Future _getLocalIpAddress() async { + try { + final interfaces = await NetworkInterface.list(type: InternetAddressType.IPv4); - _peer!.on('close').listen((_) { - appLogger.d('CompanionRemote: Peer closed'); - _connectionStateController.add(RemoteSessionStatus.disconnected); - }); + // Prefer WiFi interface, then any non-loopback + for (final interface in interfaces) { + // Skip loopback + if (interface.name.toLowerCase().contains('lo')) continue; - _peer!.on('error').listen((error) { - appLogger.e('CompanionRemote: Peer error', error: error); - _errorController.add( - RemotePeerError( - type: errorType, - message: '$errorMessage: $error', - originalError: error, - ), - ); - if (!completer.isCompleted) { - completer.completeError(error); + for (final addr in interface.addresses) { + if (!addr.isLoopback && addr.type == InternetAddressType.IPv4) { + // Prefer names that suggest WiFi/Ethernet + if (interface.name.toLowerCase().contains('en') || + interface.name.toLowerCase().contains('wl') || + interface.name.toLowerCase().contains('eth')) { + return addr.address; + } + } + } } - }); + + // Fallback: return any non-loopback IPv4 + for (final interface in interfaces) { + for (final addr in interface.addresses) { + if (!addr.isLoopback && addr.type == InternetAddressType.IPv4) { + return addr.address; + } + } + } + + throw const RemotePeerError(type: RemotePeerErrorType.networkError, message: 'No network interface found'); + } catch (e) { + appLogger.e('CompanionRemote: Failed to get local IP', error: e); + rethrow; + } } - Future<({String sessionId, String pin})> createSession(String deviceName, String platform) async { - if (_peer != null) { + Future<({String sessionId, String pin, String address})> createSession(String deviceName, String platform) async { + if (_server != null) { await disconnect(); } _role = RemoteSessionRole.host; _sessionId = _generateSessionId(); _pin = _generatePin(); - _reconnectAttempts = 0; - - final completer = Completer<({String sessionId, String pin})>(); + _myPeerId = 'host-$_sessionId'; try { - _peer = Peer(id: 'cr-$_sessionId-$_pin'); + // Try preferred port first, fallback to OS-assigned port + const int preferredPort = 48632; - _peer!.on('open').listen((id) { - _myPeerId = id as String; - appLogger.d('CompanionRemote: Host peer opened with ID: $_myPeerId'); - _connectionStateController.add(RemoteSessionStatus.connected); - if (!completer.isCompleted) { - completer.complete((sessionId: _sessionId!, pin: _pin!)); + try { + _server = await HttpServer.bind(InternetAddress.anyIPv4, preferredPort); + appLogger.d('CompanionRemote: Server bound to port $preferredPort'); + } catch (e) { + appLogger.w('CompanionRemote: Port $preferredPort occupied, using random port'); + _server = await HttpServer.bind(InternetAddress.anyIPv4, 0); + } + + final localIp = await _getLocalIpAddress(); + final port = _server!.port; + _hostAddress = '$localIp:$port'; + + appLogger.d('CompanionRemote: Host server started at $_hostAddress'); + + // Listen for WebSocket connections + _server!.listen((HttpRequest request) async { + if (request.uri.path == '/ws') { + try { + final socket = await WebSocketTransformer.upgrade(request); + _handleNewWebSocketConnection(socket, deviceName, platform); + } catch (e) { + appLogger.e('CompanionRemote: Failed to upgrade WebSocket', error: e); + } + } else { + request.response.statusCode = HttpStatus.notFound; + request.response.close(); } }); - _peer!.on('connection').listen((conn) { - final dataConn = conn as DataConnection; - _handleNewConnection(dataConn, deviceName, platform); - }); + _connectionStateController.add(RemoteSessionStatus.connected); - _attachCommonPeerListeners( - completer: completer, - errorType: RemotePeerErrorType.serverError, - errorMessage: 'Server error', - ); + return (sessionId: _sessionId!, pin: _pin!, address: _hostAddress!); } catch (e) { - appLogger.e('CompanionRemote: Failed to create peer', error: e); - if (!completer.isCompleted) { - completer.completeError(e); - } + appLogger.e('CompanionRemote: Failed to create server', error: e); + _errorController.add( + RemotePeerError( + type: RemotePeerErrorType.serverError, + message: 'Failed to create server: $e', + originalError: e, + ), + ); + rethrow; } + } - return completer.future.timeout( - const Duration(seconds: 10), - onTimeout: () { - throw RemotePeerError( - type: RemotePeerErrorType.timeout, - message: 'Timed out creating session', + void _handleNewWebSocketConnection(WebSocket socket, String hostDeviceName, String hostPlatform) { + appLogger.d('CompanionRemote: New WebSocket connection'); + + bool isAuthenticated = false; + Timer? authTimeout; + + // Authentication timeout + authTimeout = Timer(const Duration(seconds: 10), () { + if (!isAuthenticated) { + appLogger.w('CompanionRemote: Authentication timeout'); + socket.close(4001, 'Authentication timeout'); + } + }); + + socket.listen( + (data) { + try { + final json = jsonDecode(data as String) as Map; + + if (!isAuthenticated) { + // First message must be authentication + if (json['type'] == 'auth') { + final sessionId = json['sessionId'] as String?; + final pin = json['pin'] as String?; + final deviceName = json['deviceName'] as String?; + final platform = json['platform'] as String?; + + if (sessionId == _sessionId && pin == _pin) { + isAuthenticated = true; + authTimeout?.cancel(); + + // Close existing client if present + if (_clientSocket != null) { + appLogger.d('CompanionRemote: Replacing existing client connection'); + _clientSocket!.close(4004, 'Replaced by new connection'); + } + + _clientSocket = socket; + + appLogger.d('CompanionRemote: Client authenticated: $deviceName ($platform)'); + + // Send auth success + socket.add(jsonEncode({'type': 'authSuccess'})); + + // Notify connection + final device = RemoteDevice( + id: 'remote-client', + name: deviceName ?? 'Unknown Device', + platform: platform ?? 'unknown', + ); + _deviceConnectedController.add(device); + _connectionStateController.add(RemoteSessionStatus.connected); + + // Send device info + sendDeviceInfo(hostDeviceName, hostPlatform); + + // Note: Client sends keepalive pings, host only responds with pongs + } else { + appLogger.w('CompanionRemote: Invalid credentials'); + socket.add(jsonEncode({'type': 'authFailed', 'message': 'Invalid session ID or PIN'})); + socket.close(4003, 'Invalid credentials'); + } + } else { + appLogger.w('CompanionRemote: Expected auth, got ${json['type']}'); + socket.close(4002, 'Authentication required'); + } + } else { + // Handle regular commands + final command = RemoteCommand.fromJson(json); + appLogger.d('CompanionRemote: Received command: ${command.type}'); + + // Send acknowledgment for non-ping/pong/ack commands + if (command.type != RemoteCommandType.ping && + command.type != RemoteCommandType.pong && + command.type != RemoteCommandType.ack && + command.type != RemoteCommandType.deviceInfo) { + final ackCommand = RemoteCommand( + type: RemoteCommandType.ack, + deviceId: _myPeerId ?? 'unknown', + deviceName: hostDeviceName, + data: {'originalCommand': command.type.toString()}, + ); + socket.add(jsonEncode(ackCommand.toJson())); + } + + _commandReceivedController.add(command); + + if (command.type == RemoteCommandType.ping) { + _sendPong(hostDeviceName, hostPlatform); + } + } + } catch (e) { + appLogger.e('CompanionRemote: Failed to process message', error: e); + } + }, + onDone: () { + authTimeout?.cancel(); + appLogger.d('CompanionRemote: WebSocket connection closed'); + if (isAuthenticated) { + _clientSocket = null; + _deviceDisconnectedController.add(null); + _connectionStateController.add(RemoteSessionStatus.disconnected); + _stopPingTimer(); + } + }, + onError: (error) { + authTimeout?.cancel(); + appLogger.e('CompanionRemote: WebSocket error', error: error); + _errorController.add( + RemotePeerError( + type: RemotePeerErrorType.dataChannelError, + message: 'WebSocket error: $error', + originalError: error, + ), ); }, ); } - Future joinSession( - String sessionId, - String pin, - String deviceName, - String platform, - ) async { - if (_peer != null) { + Future joinSession(String sessionId, String pin, String deviceName, String platform, String hostAddress) async { + if (_channel != null) { await disconnect(); } _role = RemoteSessionRole.remote; _sessionId = sessionId.toUpperCase(); _pin = pin; - _reconnectAttempts = 0; + _hostAddress = hostAddress; + _myPeerId = 'remote-${Random().nextInt(99999)}'; final completer = Completer(); try { - _peer = Peer(); + final url = 'ws://$hostAddress/ws'; + appLogger.d('CompanionRemote: Connecting to $url'); - _peer!.on('open').listen((id) { - _myPeerId = id as String; - appLogger.d('CompanionRemote: Remote peer opened with ID: $_myPeerId'); + _connectionStateController.add(RemoteSessionStatus.connecting); - final hostPeerId = 'cr-$_sessionId-$_pin'; - appLogger.d('CompanionRemote: Connecting to host: $hostPeerId'); + _channel = IOWebSocketChannel.connect(Uri.parse(url)); - _connectionStateController.add(RemoteSessionStatus.connecting); - - final conn = _peer!.connect(hostPeerId, options: PeerConnectOption(reliable: true)); - _handleNewConnection(conn, deviceName, platform, isOutgoing: true, completer: completer); + // Send authentication message + final authMessage = jsonEncode({ + 'type': 'auth', + 'sessionId': _sessionId, + 'pin': _pin, + 'deviceName': deviceName, + 'platform': platform, }); + _channel!.sink.add(authMessage); - _attachCommonPeerListeners( - completer: completer, - errorType: RemotePeerErrorType.connectionFailed, - errorMessage: 'Failed to connect to session', + // Listen for messages + _channel!.stream.listen( + (data) { + try { + final json = jsonDecode(data as String) as Map; + final messageType = json['type'] as String?; + + if (messageType == 'authSuccess') { + appLogger.d('CompanionRemote: Authentication successful'); + + if (!completer.isCompleted) { + completer.complete(); + } + + final device = RemoteDevice(id: 'host', name: 'Desktop', platform: 'desktop'); + _deviceConnectedController.add(device); + _connectionStateController.add(RemoteSessionStatus.connected); + + // Send device info + sendDeviceInfo(deviceName, platform); + + // Start ping timer + _startPingTimer(); + } else if (messageType == 'authFailed') { + final message = json['message'] as String? ?? 'Authentication failed'; + appLogger.w('CompanionRemote: $message'); + + if (!completer.isCompleted) { + completer.completeError(RemotePeerError(type: RemotePeerErrorType.authFailed, message: message)); + } + + _errorController.add(RemotePeerError(type: RemotePeerErrorType.authFailed, message: message)); + _connectionStateController.add(RemoteSessionStatus.error); + } else { + // Regular command + final command = RemoteCommand.fromJson(json); + appLogger.d('CompanionRemote: Received command: ${command.type}'); + + // Send acknowledgment for non-ping/pong/ack commands + if (command.type != RemoteCommandType.ping && + command.type != RemoteCommandType.pong && + command.type != RemoteCommandType.ack && + command.type != RemoteCommandType.deviceInfo) { + final ackCommand = RemoteCommand( + type: RemoteCommandType.ack, + deviceId: _myPeerId ?? 'unknown', + deviceName: deviceName, + data: {'originalCommand': command.type.toString()}, + ); + _channel!.sink.add(jsonEncode(ackCommand.toJson())); + } + + _commandReceivedController.add(command); + + if (command.type == RemoteCommandType.ping) { + _sendPong(deviceName, platform); + } + } + } catch (e) { + appLogger.e('CompanionRemote: Failed to parse message', error: e); + } + }, + onDone: () { + appLogger.d('CompanionRemote: Connection closed'); + _deviceDisconnectedController.add(null); + _connectionStateController.add(RemoteSessionStatus.disconnected); + _stopPingTimer(); + // Reconnection is handled by CompanionRemoteProvider + }, + onError: (error) { + appLogger.e('CompanionRemote: Connection error', error: error); + + if (!completer.isCompleted) { + completer.completeError(error); + } + + _errorController.add( + RemotePeerError( + type: RemotePeerErrorType.connectionFailed, + message: 'Connection error: $error', + originalError: error, + ), + ); + _connectionStateController.add(RemoteSessionStatus.error); + }, ); } catch (e) { - appLogger.e('CompanionRemote: Failed to create peer for joining', error: e); + appLogger.e('CompanionRemote: Failed to connect', error: e); + if (!completer.isCompleted) { completer.completeError(e); } + + _errorController.add( + RemotePeerError(type: RemotePeerErrorType.connectionFailed, message: 'Failed to connect: $e', originalError: e), + ); } return completer.future.timeout( const Duration(seconds: 15), - onTimeout: () { - throw RemotePeerError( - type: RemotePeerErrorType.timeout, - message: 'Timed out joining session', - ); + onTimeout: () async { + // Clean up channel on timeout + if (_channel != null) { + await _channel!.sink.close(); + _channel = null; + } + throw const RemotePeerError(type: RemotePeerErrorType.timeout, message: 'Timed out joining session'); }, ); } - void _handleNewConnection( - DataConnection conn, - String deviceName, - String platform, { - bool isOutgoing = false, - Completer? completer, - }) { - final peerId = conn.peer; - appLogger.d('CompanionRemote: New connection ${isOutgoing ? "to" : "from"}: $peerId'); - - conn.on('open').listen((_) { - appLogger.d('CompanionRemote: Data channel opened with: $peerId'); - _connection = conn; - _connectionStateController.add(RemoteSessionStatus.connected); - - final device = RemoteDevice( - id: peerId, - name: deviceName, - platform: platform, - ); - - _deviceConnectedController.add(device); - - _startPingTimer(); - - sendDeviceInfo(deviceName, platform); - - if (completer != null && !completer.isCompleted) { - completer.complete(); - } - }); - - conn.on('data').listen((data) { - try { - final json = data as Map; - final command = RemoteCommand.fromJson(json); - appLogger.d('CompanionRemote: Received command: ${command.type} from $peerId'); - - // Send acknowledgment for non-ping/pong/ack commands - if (command.type != RemoteCommandType.ping && - command.type != RemoteCommandType.pong && - command.type != RemoteCommandType.ack && - command.type != RemoteCommandType.deviceInfo) { - final ackCommand = RemoteCommand( - type: RemoteCommandType.ack, - deviceId: _myPeerId ?? 'unknown', - deviceName: deviceName, - data: {'originalCommand': command.type.toString()}, - ); - _connection?.send(ackCommand.toJson()); - } - - _commandReceivedController.add(command); - - if (command.type == RemoteCommandType.ping) { - _sendPong(deviceName, platform); - } else if (command.type == RemoteCommandType.ack) { - appLogger.d('CompanionRemote: Received ACK for: ${json['data']?['originalCommand']}'); - } - } catch (e) { - appLogger.e('CompanionRemote: Failed to parse command', error: e); - } - }); - - conn.on('close').listen((_) { - appLogger.d('CompanionRemote: Connection closed with: $peerId'); - _connection = null; - _deviceDisconnectedController.add(null); - _connectionStateController.add(RemoteSessionStatus.disconnected); - _stopPingTimer(); - }); - - conn.on('error').listen((error) { - appLogger.e('CompanionRemote: Connection error with $peerId', error: error); - _errorController.add( - RemotePeerError( - type: RemotePeerErrorType.dataChannelError, - message: 'Connection error with peer: $error', - originalError: error, - ), - ); - _connectionStateController.add(RemoteSessionStatus.error); - }); - } - - void _handleDisconnectedFromServer() { - if (_reconnectAttempts < _maxReconnectAttempts) { - _reconnectAttempts++; - final delay = Duration(seconds: _reconnectAttempts * 2); - - appLogger.d( - 'CompanionRemote: Attempting reconnect $_reconnectAttempts/$_maxReconnectAttempts in ${delay.inSeconds}s', - ); - - _reconnectTimer?.cancel(); - _reconnectTimer = Timer(delay, () { - _peer?.reconnect(); - }); - } else { - appLogger.e('CompanionRemote: Max reconnect attempts reached'); - _errorController.add( - const RemotePeerError( - type: RemotePeerErrorType.connectionFailed, - message: 'Lost connection to server after multiple reconnect attempts', - ), - ); - _connectionStateController.add(RemoteSessionStatus.error); - } - } - void _startPingTimer() { _stopPingTimer(); _pingTimer = Timer.periodic(const Duration(seconds: 5), (_) { - if (_connection != null) { - sendCommand(RemoteCommand( - type: RemoteCommandType.ping, - deviceId: _myPeerId ?? 'unknown', - deviceName: 'local', - )); + if (isConnected) { + sendCommand(RemoteCommand(type: RemoteCommandType.ping, deviceId: _myPeerId ?? 'unknown', deviceName: 'local')); } }); } @@ -343,36 +452,40 @@ class CompanionRemotePeerService { } void _sendPong(String deviceName, String platform) { - sendCommand(RemoteCommand( - type: RemoteCommandType.pong, - deviceId: _myPeerId ?? 'unknown', - deviceName: deviceName, - data: {'platform': platform}, - )); + sendCommand( + RemoteCommand( + type: RemoteCommandType.pong, + deviceId: _myPeerId ?? 'unknown', + deviceName: deviceName, + data: {'platform': platform}, + ), + ); } void sendDeviceInfo(String deviceName, String platform) { - sendCommand(RemoteCommand( - type: RemoteCommandType.deviceInfo, - deviceId: _myPeerId ?? 'unknown', - deviceName: deviceName, - data: { - 'platform': platform, - 'role': _role?.name, - }, - )); + sendCommand( + RemoteCommand( + type: RemoteCommandType.deviceInfo, + deviceId: _myPeerId ?? 'unknown', + deviceName: deviceName, + data: {'platform': platform, 'role': _role?.name}, + ), + ); } void sendCommand(RemoteCommand command) { - if (_connection == null) { - appLogger.w('CompanionRemote: No connection to send command'); - return; - } - try { - final json = command.toJson(); - _connection!.send(json); - appLogger.d('CompanionRemote: Sent command: ${command.type}'); + final json = jsonEncode(command.toJson()); + + if (_role == RemoteSessionRole.host && _clientSocket != null) { + _clientSocket!.add(json); + appLogger.d('CompanionRemote: Sent command (host): ${command.type}'); + } else if (_role == RemoteSessionRole.remote && _channel != null) { + _channel!.sink.add(json); + appLogger.d('CompanionRemote: Sent command (remote): ${command.type}'); + } else { + appLogger.w('CompanionRemote: No connection to send command'); + } } catch (e) { appLogger.e('CompanionRemote: Failed to send command', error: e); _errorController.add( @@ -389,29 +502,37 @@ class CompanionRemotePeerService { appLogger.d('CompanionRemote: Disconnecting'); _stopPingTimer(); - _reconnectTimer?.cancel(); - _connection?.close(); - _connection = null; + if (_clientSocket != null) { + await _clientSocket!.close(); + _clientSocket = null; + } - _peer?.dispose(); - _peer = null; + if (_channel != null) { + await _channel!.sink.close(); + _channel = null; + } + + if (_server != null) { + await _server!.close(); + _server = null; + } _sessionId = null; _pin = null; _myPeerId = null; + _hostAddress = null; _role = null; - _reconnectAttempts = 0; _connectionStateController.add(RemoteSessionStatus.disconnected); } - void dispose() { - disconnect(); - _commandReceivedController.close(); - _deviceConnectedController.close(); - _deviceDisconnectedController.close(); - _errorController.close(); - _connectionStateController.close(); + Future dispose() async { + await disconnect(); + await _commandReceivedController.close(); + await _deviceConnectedController.close(); + await _deviceDisconnectedController.close(); + await _errorController.close(); + await _connectionStateController.close(); } } diff --git a/lib/services/gamepad_service.dart b/lib/services/gamepad_service.dart index 78fe94c8..27efd8ea 100644 --- a/lib/services/gamepad_service.dart +++ b/lib/services/gamepad_service.dart @@ -343,5 +343,4 @@ class GamepadService { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; } } - } diff --git a/lib/widgets/companion_remote/remote_session_dialog.dart b/lib/widgets/companion_remote/remote_session_dialog.dart index 08f2b027..7fcc0bd4 100644 --- a/lib/widgets/companion_remote/remote_session_dialog.dart +++ b/lib/widgets/companion_remote/remote_session_dialog.dart @@ -24,6 +24,7 @@ class RemoteSessionDialog extends StatefulWidget { class _RemoteSessionDialogState extends State { bool _isCreatingSession = false; String? _errorMessage; + String? _hostAddress; // Format: "ip:port" @override void initState() { @@ -35,14 +36,16 @@ class _RemoteSessionDialogState extends State { setState(() { _isCreatingSession = true; _errorMessage = null; + _hostAddress = null; }); try { final provider = context.read(); - await provider.createSession(); + final result = await provider.createSession(); setState(() { _isCreatingSession = false; + _hostAddress = result.address; }); } catch (e) { appLogger.e('Failed to create companion remote session', error: e); @@ -55,12 +58,9 @@ class _RemoteSessionDialogState extends State { void _copyToClipboard(String text, String label) { Clipboard.setData(ClipboardData(text: text)); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text('$label copied to clipboard'), - duration: const Duration(seconds: 2), - ), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('$label copied to clipboard'), duration: const Duration(seconds: 2))); } @override @@ -76,10 +76,7 @@ class _RemoteSessionDialogState extends State { children: [ const CircularProgressIndicator(), const SizedBox(height: 16), - Text( - 'Creating remote session...', - style: Theme.of(context).textTheme.titleMedium, - ), + Text('Creating remote session...', style: Theme.of(context).textTheme.titleMedium), ], ), ), @@ -95,40 +92,32 @@ class _RemoteSessionDialogState extends State { children: [ const Text('Failed to create remote session:'), const SizedBox(height: 8), - Text( - _errorMessage!, - style: const TextStyle(fontFamily: 'monospace'), - ), + Text(_errorMessage!, style: const TextStyle(fontFamily: 'monospace')), ], ), actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: const Text('Close'), - ), - TextButton( - onPressed: _createSession, - child: const Text('Retry'), - ), + TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Close')), + TextButton(onPressed: _createSession, child: const Text('Retry')), ], ); } final session = provider.session; - if (session == null) { + if (session == null || _hostAddress == null) { return AlertDialog( title: const Text('Error'), content: const Text('No session available'), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(), - child: const Text('Close'), - ), - ], + actions: [TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Close'))], ); } - final qrData = '${session.sessionId}:${session.pin}'; + // Parse IP and port from hostAddress + final addressParts = _hostAddress!.split(':'); + final ip = addressParts[0]; + final port = addressParts[1]; + + // New QR format: ip|port|sessionId|pin (using pipe separator) + final qrData = '$ip|$port|${session.sessionId}|${session.pin}'; return Dialog( child: ConstrainedBox( @@ -147,45 +136,32 @@ class _RemoteSessionDialogState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - 'Companion Remote', - style: Theme.of(context).textTheme.headlineSmall, - ), + Text('Companion Remote', style: Theme.of(context).textTheme.headlineSmall), const SizedBox(height: 4), Text( session.connectedDevice != null ? 'Connected to ${session.connectedDevice!.name}' : 'Waiting for connection...', style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: session.connectedDevice != null - ? Colors.green - : Theme.of(context).textTheme.bodySmall?.color, - ), + color: session.connectedDevice != null + ? Colors.green + : Theme.of(context).textTheme.bodySmall?.color, + ), ), ], ), ), - IconButton( - icon: const Icon(Icons.close), - onPressed: () => Navigator.of(context).pop(), - ), + IconButton(icon: const Icon(Icons.close), onPressed: () => Navigator.of(context).pop()), ], ), const SizedBox(height: 24), if (session.connectedDevice == null) ...[ - Text( - 'Scan QR Code', - style: Theme.of(context).textTheme.titleMedium, - textAlign: TextAlign.center, - ), + Text('Scan QR Code', style: Theme.of(context).textTheme.titleMedium, textAlign: TextAlign.center), const SizedBox(height: 16), Center( child: Container( padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: QrImageView( data: qrData, version: QrVersions.auto, @@ -203,6 +179,13 @@ class _RemoteSessionDialogState extends State { textAlign: TextAlign.center, ), const SizedBox(height: 16), + _buildCodeCard( + context, + 'Host Address', + _hostAddress!, + onCopy: () => _copyToClipboard(_hostAddress!, 'Host Address'), + ), + const SizedBox(height: 12), _buildCodeCard( context, 'Session ID', @@ -210,37 +193,19 @@ class _RemoteSessionDialogState extends State { onCopy: () => _copyToClipboard(session.sessionId, 'Session ID'), ), const SizedBox(height: 12), - _buildCodeCard( - context, - 'PIN', - session.pin, - onCopy: () => _copyToClipboard(session.pin, 'PIN'), - ), + _buildCodeCard(context, 'PIN', session.pin, onCopy: () => _copyToClipboard(session.pin, 'PIN')), ] else ...[ Card( child: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ - const Icon( - Icons.check_circle, - color: Colors.green, - size: 48, - ), + const Icon(Icons.check_circle, color: Colors.green, size: 48), const SizedBox(height: 8), - Text( - 'Connected', - style: Theme.of(context).textTheme.titleLarge, - ), + Text('Connected', style: Theme.of(context).textTheme.titleLarge), const SizedBox(height: 8), - Text( - session.connectedDevice!.name, - style: Theme.of(context).textTheme.bodyLarge, - ), - Text( - session.connectedDevice!.platform, - style: Theme.of(context).textTheme.bodySmall, - ), + Text(session.connectedDevice!.name, style: Theme.of(context).textTheme.bodyLarge), + Text(session.connectedDevice!.platform, style: Theme.of(context).textTheme.bodySmall), ], ), ), @@ -276,10 +241,7 @@ class _RemoteSessionDialogState extends State { child: const Text('Disconnect'), ), const SizedBox(width: 8), - FilledButton( - onPressed: () => Navigator.of(context).pop(), - child: const Text('Minimize'), - ), + FilledButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Minimize')), ], ), ], @@ -291,12 +253,7 @@ class _RemoteSessionDialogState extends State { ); } - Widget _buildCodeCard( - BuildContext context, - String label, - String code, { - VoidCallback? onCopy, - }) { + Widget _buildCodeCard(BuildContext context, String label, String code, {VoidCallback? onCopy}) { return Card( child: Padding( padding: const EdgeInsets.all(16.0), @@ -306,26 +263,16 @@ class _RemoteSessionDialogState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - label, - style: Theme.of(context).textTheme.bodySmall, - ), + Text(label, style: Theme.of(context).textTheme.bodySmall), const SizedBox(height: 4), Text( code, - style: Theme.of(context).textTheme.titleLarge?.copyWith( - fontFamily: 'monospace', - letterSpacing: 2, - ), + style: Theme.of(context).textTheme.titleLarge?.copyWith(fontFamily: 'monospace', letterSpacing: 2), ), ], ), ), - IconButton( - icon: const Icon(Icons.copy), - onPressed: onCopy, - tooltip: 'Copy to clipboard', - ), + IconButton(icon: const Icon(Icons.copy), onPressed: onCopy, tooltip: 'Copy to clipboard'), ], ), ), diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 69e7208d..0a25aa35 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,7 +6,6 @@ #include "generated_plugin_registrant.h" -#include #include #include #include @@ -15,9 +14,6 @@ #include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin"); - flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar); g_autoptr(FlPluginRegistrar) os_media_controls_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "OsMediaControlsPlugin"); os_media_controls_plugin_register_with_registrar(os_media_controls_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index a560d685..eb699977 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - flutter_webrtc os_media_controls screen_retriever_linux sqlite3_flutter_libs diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index dc700d78..718fe9a5 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,7 +8,6 @@ import Foundation import connectivity_plus import device_info_plus import file_picker -import flutter_webrtc import in_app_review import mobile_scanner import os_media_controls @@ -27,7 +26,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) - FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin")) InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) OsMediaControlsPlugin.register(with: registry.registrar(forPlugin: "OsMediaControlsPlugin")) diff --git a/macos/Podfile.lock b/macos/Podfile.lock index db8f2cab..d0b49723 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -5,9 +5,6 @@ PODS: - FlutterMacOS - file_picker (0.0.1): - FlutterMacOS - - flutter_webrtc (1.2.0): - - FlutterMacOS - - WebRTC-SDK (= 137.7151.04) - FlutterMacOS (1.0.0) - in_app_review (2.0.0): - FlutterMacOS @@ -59,7 +56,6 @@ PODS: - FlutterMacOS - wakelock_plus (0.0.1): - FlutterMacOS - - WebRTC-SDK (137.7151.04) - window_manager (0.5.0): - FlutterMacOS @@ -67,7 +63,6 @@ DEPENDENCIES: - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) - - flutter_webrtc (from `Flutter/ephemeral/.symlinks/plugins/flutter_webrtc/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - in_app_review (from `Flutter/ephemeral/.symlinks/plugins/in_app_review/macos`) - mobile_scanner (from `Flutter/ephemeral/.symlinks/plugins/mobile_scanner/macos`) @@ -86,7 +81,6 @@ DEPENDENCIES: SPEC REPOS: trunk: - sqlite3 - - WebRTC-SDK EXTERNAL SOURCES: connectivity_plus: @@ -95,8 +89,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos file_picker: :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos - flutter_webrtc: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_webrtc/macos FlutterMacOS: :path: Flutter/ephemeral in_app_review: @@ -130,7 +122,6 @@ SPEC CHECKSUMS: connectivity_plus: 4adf20a405e25b42b9c9f87feff8f4b6fde18a4e device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a - flutter_webrtc: 718eae22a371cd94e5d56aa4f301443ebc5bb737 FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 in_app_review: 66e7680752b632d83f4f0e88b34d52ed303fbff4 mobile_scanner: 0e365ed56cad24f28c0fd858ca04edefb40dfac3 @@ -145,7 +136,6 @@ SPEC CHECKSUMS: universal_gamepad: 8922f1f238f62d6847de887228976d5b572b57da url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd wakelock_plus: 917609be14d812ddd9e9528876538b2263aaa03b - WebRTC-SDK: 40d4f5ba05cadff14e4db5614aec402a633f007e window_manager: b729e31d38fb04905235df9ea896128991cad99e PODFILE CHECKSUM: d16f5e5d196d1ca9863d7a71d5885cad7ffa7d2d diff --git a/pubspec.lock b/pubspec.lock index 442ce73b..0a9efc48 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -297,14 +297,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" - dart_webrtc: - dependency: transitive - description: - name: dart_webrtc - sha256: "4ed7b9fa9924e5a81eb39271e2c2356739dd1039d60a13b86ba6c5f448625086" - url: "https://pub.dev" - source: hosted - version: "1.7.0" dbus: dependency: transitive description: @@ -369,14 +361,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.3" - events_emitter: - dependency: transitive - description: - name: events_emitter - sha256: a075477bdf9c8c0c31bb7c7b7bdd357b4486c34f30163119f96de4e7f54abeff - url: "https://pub.dev" - source: hosted - version: "0.5.2" fake_async: dependency: transitive description: @@ -493,14 +477,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_webrtc: - dependency: "direct overridden" - description: - name: flutter_webrtc - sha256: "0f86b518e9349e71a136a96e0ea11294cad8a8531b2bc9ae99e69df332ac898a" - url: "https://pub.dev" - source: hosted - version: "1.3.0" frontend_server_client: dependency: transitive description: @@ -838,14 +814,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" - peerdart: - dependency: "direct main" - description: - name: peerdart - sha256: "1d0db041d42194f42e57d8889d029fb8d107610bf1062b39f43f4651de547e3c" - url: "https://pub.dev" - source: hosted - version: "0.5.6" petitparser: dependency: transitive description: @@ -1451,14 +1419,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" - webrtc_interface: - dependency: transitive - description: - name: webrtc_interface - sha256: ad0e5786b2acd3be72a3219ef1dde9e1cac071cf4604c685f11b61d63cdd6eb3 - url: "https://pub.dev" - source: hosted - version: "1.4.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4c939f30..39a4a1f4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,10 +49,6 @@ dependencies: dart_discord_presence: ^1.1.0 flutter_svg: ^2.2.3 mobile_scanner: ^6.0.2 - peerdart: ^0.5.6 - -dependency_overrides: - flutter_webrtc: ^1.3.0 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 88e1c798..bc3ebff2 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,7 +7,6 @@ #include "generated_plugin_registrant.h" #include -#include #include #include #include @@ -18,8 +17,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { ConnectivityPlusWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - FlutterWebRTCPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterWebRTCPlugin")); OsMediaControlsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("OsMediaControlsPluginCApi")); ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 1dca6fac..db77f229 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus - flutter_webrtc os_media_controls screen_retriever_windows sqlite3_flutter_libs