diff --git a/analysis_options.yaml b/analysis_options.yaml index f6b14e01..d1edb40a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,6 +7,16 @@ analyzer: plugins: - dart_code_linter +linter: + rules: + unawaited_futures: true + cancel_subscriptions: true + close_sinks: true + use_super_parameters: true + prefer_final_locals: true + prefer_final_in_for_each: true + avoid_print: true + dart_code_linter: extends: - package:dart_code_linter/presets/recommended.yaml diff --git a/lib/database/app_database.g.dart b/lib/database/app_database.g.dart index 1a3aa882..555aca00 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', @@ -187,9 +158,7 @@ class $DownloadedMediaTable extends DownloadedMedia requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _bgTaskIdMeta = const VerificationMeta( - 'bgTaskId', - ); + static const VerificationMeta _bgTaskIdMeta = const VerificationMeta('bgTaskId'); @override late final GeneratedColumn bgTaskId = GeneratedColumn( 'bg_task_id', @@ -198,9 +167,7 @@ class $DownloadedMediaTable extends DownloadedMedia type: DriftSqlType.string, requiredDuringInsert: false, ); - static const VerificationMeta _mediaIndexMeta = const VerificationMeta( - 'mediaIndex', - ); + static const VerificationMeta _mediaIndexMeta = const VerificationMeta('mediaIndex'); @override late final GeneratedColumn mediaIndex = GeneratedColumn( 'media_index', @@ -237,144 +204,84 @@ 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)); } if (data.containsKey('bg_task_id')) { - context.handle( - _bgTaskIdMeta, - bgTaskId.isAcceptableOrUnknown(data['bg_task_id']!, _bgTaskIdMeta), - ); + context.handle(_bgTaskIdMeta, bgTaskId.isAcceptableOrUnknown(data['bg_task_id']!, _bgTaskIdMeta)); } if (data.containsKey('media_index')) { - context.handle( - _mediaIndexMeta, - mediaIndex.isAcceptableOrUnknown(data['media_index']!, _mediaIndexMeta), - ); + context.handle(_mediaIndexMeta, mediaIndex.isAcceptableOrUnknown(data['media_index']!, _mediaIndexMeta)); } return context; } @@ -385,26 +292,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'], @@ -413,50 +305,17 @@ 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'], - )!, - bgTaskId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}bg_task_id'], - ), - mediaIndex: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}media_index'], - )!, + 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'])!, + bgTaskId: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}bg_task_id']), + mediaIndex: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}media_index'])!, ); } @@ -466,8 +325,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; @@ -553,42 +411,25 @@ 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), - bgTaskId: bgTaskId == null && nullToAbsent - ? const Value.absent() - : Value(bgTaskId), + bgTaskId: bgTaskId == null && nullToAbsent ? const Value.absent() : Value(bgTaskId), mediaIndex: Value(mediaIndex), ); } - factory DownloadedMediaItem.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory DownloadedMediaItem.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return DownloadedMediaItem( id: serializer.fromJson(json['id']), @@ -597,9 +438,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']), @@ -663,19 +502,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, @@ -690,37 +523,21 @@ 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, bgTaskId: data.bgTaskId.present ? data.bgTaskId.value : this.bgTaskId, - mediaIndex: data.mediaIndex.present - ? data.mediaIndex.value - : this.mediaIndex, + mediaIndex: data.mediaIndex.present ? data.mediaIndex.value : this.mediaIndex, ); } @@ -884,8 +701,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, @@ -964,9 +780,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); @@ -1030,8 +844,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; @@ -1045,13 +858,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', @@ -1061,9 +870,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', @@ -1073,9 +880,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', @@ -1084,9 +889,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', @@ -1094,14 +897,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', @@ -1109,30 +908,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')) { @@ -1141,44 +928,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; @@ -1190,22 +962,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'], @@ -1223,8 +986,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; @@ -1262,10 +1024,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']), @@ -1307,17 +1066,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, ); } @@ -1335,14 +1088,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) || @@ -1453,15 +1199,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', @@ -1487,14 +1230,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', @@ -1512,39 +1251,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; } @@ -1555,22 +1279,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'])!, ); } @@ -1592,12 +1304,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 = {}; @@ -1617,10 +1324,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']), @@ -1640,12 +1344,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, @@ -1785,13 +1484,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', @@ -1800,9 +1495,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', @@ -1811,9 +1504,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', @@ -1822,9 +1513,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', @@ -1833,9 +1522,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', @@ -1844,9 +1531,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', @@ -1855,9 +1540,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', @@ -1865,14 +1548,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', @@ -1881,9 +1560,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', @@ -1892,9 +1569,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', @@ -1904,9 +1579,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', @@ -1936,98 +1609,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; } @@ -2035,60 +1669,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']), ); } @@ -2098,8 +1696,7 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress } } -class OfflineWatchProgressItem extends DataClass - implements Insertable { +class OfflineWatchProgressItem extends DataClass implements Insertable { /// Auto-incrementing primary key final int id; @@ -2181,26 +1778,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']), @@ -2263,29 +1851,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, ); } @@ -2342,8 +1920,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; @@ -2511,8 +2088,7 @@ class OfflineWatchProgressCompanion } } -class $SyncRulesTable extends SyncRules - with TableInfo<$SyncRulesTable, SyncRuleItem> { +class $SyncRulesTable extends SyncRules with TableInfo<$SyncRulesTable, SyncRuleItem> { @override final GeneratedDatabase attachedDatabase; final String? _alias; @@ -2526,13 +2102,9 @@ class $SyncRulesTable extends SyncRules 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', @@ -2541,9 +2113,7 @@ class $SyncRulesTable extends SyncRules 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', @@ -2552,9 +2122,7 @@ class $SyncRulesTable extends SyncRules 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', @@ -2564,9 +2132,7 @@ class $SyncRulesTable extends SyncRules requiredDuringInsert: true, defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'), ); - static const VerificationMeta _targetTypeMeta = const VerificationMeta( - 'targetType', - ); + static const VerificationMeta _targetTypeMeta = const VerificationMeta('targetType'); @override late final GeneratedColumn targetType = GeneratedColumn( 'target_type', @@ -2575,9 +2141,7 @@ class $SyncRulesTable extends SyncRules type: DriftSqlType.string, requiredDuringInsert: true, ); - static const VerificationMeta _episodeCountMeta = const VerificationMeta( - 'episodeCount', - ); + static const VerificationMeta _episodeCountMeta = const VerificationMeta('episodeCount'); @override late final GeneratedColumn episodeCount = GeneratedColumn( 'episode_count', @@ -2586,9 +2150,7 @@ class $SyncRulesTable extends SyncRules type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _enabledMeta = const VerificationMeta( - 'enabled', - ); + static const VerificationMeta _enabledMeta = const VerificationMeta('enabled'); @override late final GeneratedColumn enabled = GeneratedColumn( 'enabled', @@ -2596,14 +2158,10 @@ class $SyncRulesTable extends SyncRules false, type: DriftSqlType.bool, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("enabled" IN (0, 1))', - ), + defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("enabled" IN (0, 1))'), defaultValue: const Constant(true), ); - static const VerificationMeta _createdAtMeta = const VerificationMeta( - 'createdAt', - ); + static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); @override late final GeneratedColumn createdAt = GeneratedColumn( 'created_at', @@ -2612,9 +2170,7 @@ class $SyncRulesTable extends SyncRules type: DriftSqlType.int, requiredDuringInsert: true, ); - static const VerificationMeta _lastExecutedAtMeta = const VerificationMeta( - 'lastExecutedAt', - ); + static const VerificationMeta _lastExecutedAtMeta = const VerificationMeta('lastExecutedAt'); @override late final GeneratedColumn lastExecutedAt = GeneratedColumn( 'last_executed_at', @@ -2623,9 +2179,7 @@ class $SyncRulesTable extends SyncRules type: DriftSqlType.int, requiredDuringInsert: false, ); - static const VerificationMeta _mediaIndexMeta = const VerificationMeta( - 'mediaIndex', - ); + static const VerificationMeta _mediaIndexMeta = const VerificationMeta('mediaIndex'); @override late final GeneratedColumn mediaIndex = GeneratedColumn( 'media_index', @@ -2635,9 +2189,7 @@ class $SyncRulesTable extends SyncRules requiredDuringInsert: false, defaultValue: const Constant(0), ); - static const VerificationMeta _downloadFilterMeta = const VerificationMeta( - 'downloadFilter', - ); + static const VerificationMeta _downloadFilterMeta = const VerificationMeta('downloadFilter'); @override late final GeneratedColumn downloadFilter = GeneratedColumn( 'download_filter', @@ -2667,94 +2219,58 @@ class $SyncRulesTable extends SyncRules String get actualTableName => $name; static const String $name = 'sync_rules'; @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('target_type')) { - context.handle( - _targetTypeMeta, - targetType.isAcceptableOrUnknown(data['target_type']!, _targetTypeMeta), - ); + context.handle(_targetTypeMeta, targetType.isAcceptableOrUnknown(data['target_type']!, _targetTypeMeta)); } else if (isInserting) { context.missing(_targetTypeMeta); } if (data.containsKey('episode_count')) { - context.handle( - _episodeCountMeta, - episodeCount.isAcceptableOrUnknown( - data['episode_count']!, - _episodeCountMeta, - ), - ); + context.handle(_episodeCountMeta, episodeCount.isAcceptableOrUnknown(data['episode_count']!, _episodeCountMeta)); } else if (isInserting) { context.missing(_episodeCountMeta); } if (data.containsKey('enabled')) { - context.handle( - _enabledMeta, - enabled.isAcceptableOrUnknown(data['enabled']!, _enabledMeta), - ); + context.handle(_enabledMeta, enabled.isAcceptableOrUnknown(data['enabled']!, _enabledMeta)); } 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('last_executed_at')) { context.handle( _lastExecutedAtMeta, - lastExecutedAt.isAcceptableOrUnknown( - data['last_executed_at']!, - _lastExecutedAtMeta, - ), + lastExecutedAt.isAcceptableOrUnknown(data['last_executed_at']!, _lastExecutedAtMeta), ); } if (data.containsKey('media_index')) { - context.handle( - _mediaIndexMeta, - mediaIndex.isAcceptableOrUnknown(data['media_index']!, _mediaIndexMeta), - ); + context.handle(_mediaIndexMeta, mediaIndex.isAcceptableOrUnknown(data['media_index']!, _mediaIndexMeta)); } if (data.containsKey('download_filter')) { context.handle( _downloadFilterMeta, - downloadFilter.isAcceptableOrUnknown( - data['download_filter']!, - _downloadFilterMeta, - ), + downloadFilter.isAcceptableOrUnknown(data['download_filter']!, _downloadFilterMeta), ); } return context; @@ -2766,46 +2282,16 @@ class $SyncRulesTable extends SyncRules SyncRuleItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return SyncRuleItem( - 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'], - )!, - targetType: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}target_type'], - )!, - episodeCount: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}episode_count'], - )!, - enabled: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}enabled'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}created_at'], - )!, - lastExecutedAt: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}last_executed_at'], - ), - mediaIndex: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}media_index'], - )!, + 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'])!, + targetType: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}target_type'])!, + episodeCount: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}episode_count'])!, + enabled: attachedDatabase.typeMapping.read(DriftSqlType.bool, data['${effectivePrefix}enabled'])!, + createdAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}created_at'])!, + lastExecutedAt: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}last_executed_at']), + mediaIndex: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}media_index'])!, downloadFilter: attachedDatabase.typeMapping.read( DriftSqlType.string, data['${effectivePrefix}download_filter'], @@ -2873,18 +2359,13 @@ class SyncRuleItem extends DataClass implements Insertable { episodeCount: Value(episodeCount), enabled: Value(enabled), createdAt: Value(createdAt), - lastExecutedAt: lastExecutedAt == null && nullToAbsent - ? const Value.absent() - : Value(lastExecutedAt), + lastExecutedAt: lastExecutedAt == null && nullToAbsent ? const Value.absent() : Value(lastExecutedAt), mediaIndex: Value(mediaIndex), downloadFilter: Value(downloadFilter), ); } - factory SyncRuleItem.fromJson( - Map json, { - ValueSerializer? serializer, - }) { + factory SyncRuleItem.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return SyncRuleItem( id: serializer.fromJson(json['id']), @@ -2939,9 +2420,7 @@ class SyncRuleItem extends DataClass implements Insertable { episodeCount: episodeCount ?? this.episodeCount, enabled: enabled ?? this.enabled, createdAt: createdAt ?? this.createdAt, - lastExecutedAt: lastExecutedAt.present - ? lastExecutedAt.value - : this.lastExecutedAt, + lastExecutedAt: lastExecutedAt.present ? lastExecutedAt.value : this.lastExecutedAt, mediaIndex: mediaIndex ?? this.mediaIndex, downloadFilter: downloadFilter ?? this.downloadFilter, ); @@ -2951,23 +2430,13 @@ class SyncRuleItem extends DataClass implements Insertable { 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, - targetType: data.targetType.present - ? data.targetType.value - : this.targetType, - episodeCount: data.episodeCount.present - ? data.episodeCount.value - : this.episodeCount, + targetType: data.targetType.present ? data.targetType.value : this.targetType, + episodeCount: data.episodeCount.present ? data.episodeCount.value : this.episodeCount, enabled: data.enabled.present ? data.enabled.value : this.enabled, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - lastExecutedAt: data.lastExecutedAt.present - ? data.lastExecutedAt.value - : this.lastExecutedAt, - mediaIndex: data.mediaIndex.present - ? data.mediaIndex.value - : this.mediaIndex, - downloadFilter: data.downloadFilter.present - ? data.downloadFilter.value - : this.downloadFilter, + lastExecutedAt: data.lastExecutedAt.present ? data.lastExecutedAt.value : this.lastExecutedAt, + mediaIndex: data.mediaIndex.present ? data.mediaIndex.value : this.mediaIndex, + downloadFilter: data.downloadFilter.present ? data.downloadFilter.value : this.downloadFilter, ); } @@ -3180,13 +2649,10 @@ class SyncRulesCompanion extends UpdateCompanion { 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); late final $SyncRulesTable syncRules = $SyncRulesTable(this); late final Index idxDownloadedMediaStatus = Index( 'idx_downloaded_media_status', @@ -3205,8 +2671,7 @@ abstract class _$AppDatabase extends GeneratedDatabase { 'CREATE INDEX idx_downloaded_media_grandparent ON downloaded_media (grandparent_rating_key)', ); @override - Iterable> get allTables => - allSchemaEntities.whereType>(); + Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ downloadedMedia, @@ -3264,8 +2729,7 @@ typedef $$DownloadedMediaTableUpdateCompanionBuilder = Value mediaIndex, }); -class $$DownloadedMediaTableFilterComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableFilterComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableFilterComposer({ required super.$db, required super.$table, @@ -3273,99 +2737,60 @@ 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)); - ColumnFilters get bgTaskId => $composableBuilder( - column: $table.bgTaskId, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get bgTaskId => + $composableBuilder(column: $table.bgTaskId, builder: (column) => ColumnFilters(column)); - ColumnFilters get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get mediaIndex => + $composableBuilder(column: $table.mediaIndex, builder: (column) => ColumnFilters(column)); } -class $$DownloadedMediaTableOrderingComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableOrderingComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableOrderingComposer({ required super.$db, required super.$table, @@ -3373,99 +2798,61 @@ 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)); - ColumnOrderings get bgTaskId => $composableBuilder( - column: $table.bgTaskId, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get bgTaskId => + $composableBuilder(column: $table.bgTaskId, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get mediaIndex => + $composableBuilder(column: $table.mediaIndex, builder: (column) => ColumnOrderings(column)); } -class $$DownloadedMediaTableAnnotationComposer - extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableAnnotationComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableAnnotationComposer({ required super.$db, required super.$table, @@ -3473,77 +2860,46 @@ 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); - GeneratedColumn get bgTaskId => - $composableBuilder(column: $table.bgTaskId, builder: (column) => column); + GeneratedColumn get bgTaskId => $composableBuilder(column: $table.bgTaskId, builder: (column) => column); - GeneratedColumn get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => column, - ); + GeneratedColumn get mediaIndex => $composableBuilder(column: $table.mediaIndex, builder: (column) => column); } class $$DownloadedMediaTableTableManager @@ -3557,30 +2913,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(), @@ -3661,9 +3005,7 @@ class $$DownloadedMediaTableTableManager bgTaskId: bgTaskId, mediaIndex: mediaIndex, ), - 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, ), ); @@ -3679,14 +3021,7 @@ typedef $$DownloadedMediaTableProcessedTableManager = $$DownloadedMediaTableAnnotationComposer, $$DownloadedMediaTableCreateCompanionBuilder, $$DownloadedMediaTableUpdateCompanionBuilder, - ( - DownloadedMediaItem, - BaseReferences< - _$AppDatabase, - $DownloadedMediaTable, - DownloadedMediaItem - >, - ), + (DownloadedMediaItem, BaseReferences<_$AppDatabase, $DownloadedMediaTable, DownloadedMediaItem>), DownloadedMediaItem, PrefetchHooks Function() >; @@ -3709,8 +3044,7 @@ typedef $$DownloadQueueTableUpdateCompanionBuilder = Value downloadArtwork, }); -class $$DownloadQueueTableFilterComposer - extends Composer<_$AppDatabase, $DownloadQueueTable> { +class $$DownloadQueueTableFilterComposer extends Composer<_$AppDatabase, $DownloadQueueTable> { $$DownloadQueueTableFilterComposer({ required super.$db, required super.$table, @@ -3718,39 +3052,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, @@ -3758,39 +3078,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, @@ -3798,29 +3104,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 @@ -3834,14 +3131,7 @@ class $$DownloadQueueTableTableManager $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - ( - DownloadQueueItem, - BaseReferences< - _$AppDatabase, - $DownloadQueueTable, - DownloadQueueItem - >, - ), + (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), DownloadQueueItem, PrefetchHooks Function() > { @@ -3850,12 +3140,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(), @@ -3888,9 +3175,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, ), ); @@ -3906,10 +3191,7 @@ typedef $$DownloadQueueTableProcessedTableManager = $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - ( - DownloadQueueItem, - BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>, - ), + (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), DownloadQueueItem, PrefetchHooks Function() >; @@ -3930,8 +3212,7 @@ typedef $$ApiCacheTableUpdateCompanionBuilder = Value rowid, }); -class $$ApiCacheTableFilterComposer - extends Composer<_$AppDatabase, $ApiCacheTable> { +class $$ApiCacheTableFilterComposer extends Composer<_$AppDatabase, $ApiCacheTable> { $$ApiCacheTableFilterComposer({ required super.$db, required super.$table, @@ -3939,29 +3220,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, @@ -3969,29 +3240,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, @@ -3999,17 +3261,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 @@ -4023,10 +3281,7 @@ class $$ApiCacheTableTableManager $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - ( - ApiCacheData, - BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, - ), + (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), ApiCacheData, PrefetchHooks Function() > { @@ -4035,12 +3290,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(), @@ -4048,13 +3300,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, @@ -4069,9 +3315,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, ), ); @@ -4087,10 +3331,7 @@ typedef $$ApiCacheTableProcessedTableManager = $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - ( - ApiCacheData, - BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, - ), + (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), ApiCacheData, PrefetchHooks Function() >; @@ -4125,8 +3366,7 @@ typedef $$OfflineWatchProgressTableUpdateCompanionBuilder = Value lastError, }); -class $$OfflineWatchProgressTableFilterComposer - extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { +class $$OfflineWatchProgressTableFilterComposer extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { $$OfflineWatchProgressTableFilterComposer({ required super.$db, required super.$table, @@ -4134,69 +3374,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, @@ -4204,69 +3418,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, @@ -4274,49 +3462,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 @@ -4332,34 +3501,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(), @@ -4416,9 +3570,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, ), ); @@ -4434,14 +3586,7 @@ typedef $$OfflineWatchProgressTableProcessedTableManager = $$OfflineWatchProgressTableAnnotationComposer, $$OfflineWatchProgressTableCreateCompanionBuilder, $$OfflineWatchProgressTableUpdateCompanionBuilder, - ( - OfflineWatchProgressItem, - BaseReferences< - _$AppDatabase, - $OfflineWatchProgressTable, - OfflineWatchProgressItem - >, - ), + (OfflineWatchProgressItem, BaseReferences<_$AppDatabase, $OfflineWatchProgressTable, OfflineWatchProgressItem>), OfflineWatchProgressItem, PrefetchHooks Function() >; @@ -4474,8 +3619,7 @@ typedef $$SyncRulesTableUpdateCompanionBuilder = Value downloadFilter, }); -class $$SyncRulesTableFilterComposer - extends Composer<_$AppDatabase, $SyncRulesTable> { +class $$SyncRulesTableFilterComposer extends Composer<_$AppDatabase, $SyncRulesTable> { $$SyncRulesTableFilterComposer({ required super.$db, required super.$table, @@ -4483,64 +3627,40 @@ class $$SyncRulesTableFilterComposer 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 targetType => $composableBuilder( - column: $table.targetType, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get targetType => + $composableBuilder(column: $table.targetType, builder: (column) => ColumnFilters(column)); - ColumnFilters get episodeCount => $composableBuilder( - column: $table.episodeCount, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get episodeCount => + $composableBuilder(column: $table.episodeCount, builder: (column) => ColumnFilters(column)); - ColumnFilters get enabled => $composableBuilder( - column: $table.enabled, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get enabled => + $composableBuilder(column: $table.enabled, 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 lastExecutedAt => $composableBuilder( - column: $table.lastExecutedAt, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get lastExecutedAt => + $composableBuilder(column: $table.lastExecutedAt, builder: (column) => ColumnFilters(column)); - ColumnFilters get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get mediaIndex => + $composableBuilder(column: $table.mediaIndex, builder: (column) => ColumnFilters(column)); - ColumnFilters get downloadFilter => $composableBuilder( - column: $table.downloadFilter, - builder: (column) => ColumnFilters(column), - ); + ColumnFilters get downloadFilter => + $composableBuilder(column: $table.downloadFilter, builder: (column) => ColumnFilters(column)); } -class $$SyncRulesTableOrderingComposer - extends Composer<_$AppDatabase, $SyncRulesTable> { +class $$SyncRulesTableOrderingComposer extends Composer<_$AppDatabase, $SyncRulesTable> { $$SyncRulesTableOrderingComposer({ required super.$db, required super.$table, @@ -4548,64 +3668,40 @@ class $$SyncRulesTableOrderingComposer 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 targetType => $composableBuilder( - column: $table.targetType, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get targetType => + $composableBuilder(column: $table.targetType, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get episodeCount => $composableBuilder( - column: $table.episodeCount, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get episodeCount => + $composableBuilder(column: $table.episodeCount, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get enabled => $composableBuilder( - column: $table.enabled, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get enabled => + $composableBuilder(column: $table.enabled, 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 lastExecutedAt => $composableBuilder( - column: $table.lastExecutedAt, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get lastExecutedAt => + $composableBuilder(column: $table.lastExecutedAt, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get mediaIndex => + $composableBuilder(column: $table.mediaIndex, builder: (column) => ColumnOrderings(column)); - ColumnOrderings get downloadFilter => $composableBuilder( - column: $table.downloadFilter, - builder: (column) => ColumnOrderings(column), - ); + ColumnOrderings get downloadFilter => + $composableBuilder(column: $table.downloadFilter, builder: (column) => ColumnOrderings(column)); } -class $$SyncRulesTableAnnotationComposer - extends Composer<_$AppDatabase, $SyncRulesTable> { +class $$SyncRulesTableAnnotationComposer extends Composer<_$AppDatabase, $SyncRulesTable> { $$SyncRulesTableAnnotationComposer({ required super.$db, required super.$table, @@ -4613,48 +3709,29 @@ class $$SyncRulesTableAnnotationComposer 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 targetType => $composableBuilder( - column: $table.targetType, - builder: (column) => column, - ); + GeneratedColumn get targetType => $composableBuilder(column: $table.targetType, builder: (column) => column); - GeneratedColumn get episodeCount => $composableBuilder( - column: $table.episodeCount, - builder: (column) => column, - ); + GeneratedColumn get episodeCount => $composableBuilder(column: $table.episodeCount, builder: (column) => column); - GeneratedColumn get enabled => - $composableBuilder(column: $table.enabled, builder: (column) => column); + GeneratedColumn get enabled => $composableBuilder(column: $table.enabled, 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 lastExecutedAt => $composableBuilder( - column: $table.lastExecutedAt, - builder: (column) => column, - ); + GeneratedColumn get lastExecutedAt => + $composableBuilder(column: $table.lastExecutedAt, builder: (column) => column); - GeneratedColumn get mediaIndex => $composableBuilder( - column: $table.mediaIndex, - builder: (column) => column, - ); + GeneratedColumn get mediaIndex => $composableBuilder(column: $table.mediaIndex, builder: (column) => column); - GeneratedColumn get downloadFilter => $composableBuilder( - column: $table.downloadFilter, - builder: (column) => column, - ); + GeneratedColumn get downloadFilter => + $composableBuilder(column: $table.downloadFilter, builder: (column) => column); } class $$SyncRulesTableTableManager @@ -4668,10 +3745,7 @@ class $$SyncRulesTableTableManager $$SyncRulesTableAnnotationComposer, $$SyncRulesTableCreateCompanionBuilder, $$SyncRulesTableUpdateCompanionBuilder, - ( - SyncRuleItem, - BaseReferences<_$AppDatabase, $SyncRulesTable, SyncRuleItem>, - ), + (SyncRuleItem, BaseReferences<_$AppDatabase, $SyncRulesTable, SyncRuleItem>), SyncRuleItem, PrefetchHooks Function() > { @@ -4680,12 +3754,9 @@ class $$SyncRulesTableTableManager TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$SyncRulesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$SyncRulesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$SyncRulesTableAnnotationComposer($db: db, $table: table), + createFilteringComposer: () => $$SyncRulesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => $$SyncRulesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => $$SyncRulesTableAnnotationComposer($db: db, $table: table), updateCompanionCallback: ({ Value id = const Value.absent(), @@ -4738,9 +3809,7 @@ class $$SyncRulesTableTableManager mediaIndex: mediaIndex, downloadFilter: downloadFilter, ), - 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, ), ); @@ -4756,10 +3825,7 @@ typedef $$SyncRulesTableProcessedTableManager = $$SyncRulesTableAnnotationComposer, $$SyncRulesTableCreateCompanionBuilder, $$SyncRulesTableUpdateCompanionBuilder, - ( - SyncRuleItem, - BaseReferences<_$AppDatabase, $SyncRulesTable, SyncRuleItem>, - ), + (SyncRuleItem, BaseReferences<_$AppDatabase, $SyncRulesTable, SyncRuleItem>), SyncRuleItem, PrefetchHooks Function() >; @@ -4769,12 +3835,9 @@ 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); - $$SyncRulesTableTableManager get syncRules => - $$SyncRulesTableTableManager(_db, _db.syncRules); + $$SyncRulesTableTableManager get syncRules => $$SyncRulesTableTableManager(_db, _db.syncRules); } diff --git a/lib/main.dart b/lib/main.dart index ae390900..ad0c8d97 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io' show Platform, ProcessInfo; import 'dart:ui' show AppExitResponse; import 'package:flutter/foundation.dart'; +// ignore: depend_on_referenced_packages import 'package:shared_preferences_foundation/shared_preferences_foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/gestures.dart'; @@ -138,7 +139,7 @@ Future _bootstrapApp() async { final savedLocale = settings.read(SettingsService.appLocale); // Initialize localization with saved locale - LocaleSettings.setLocale(savedLocale); + unawaited(LocaleSettings.setLocale(savedLocale)); // Needed for formatting dates in different locales await initializeDateFormatting(savedLocale.languageCode, null); @@ -212,7 +213,7 @@ Future _bootstrapApp() async { // Desktop-only services if (PlatformDetector.isDesktopOS()) { - DiscordRPCService.instance.initialize(); + unawaited(DiscordRPCService.instance.initialize()); } // Trakt scrobble service (all platforms) @@ -251,7 +252,7 @@ FutureOr _beforeSend(SentryEvent event, Hint _) { if (instance != null && !instance.read(SettingsService.crashReporting)) return null; // Drop unactionable errors - var exceptions = event.exceptions; + final exceptions = event.exceptions; if (exceptions != null) { bool shouldDrop(SentryException e) { final v = e.value; @@ -917,7 +918,7 @@ class _SetupScreenState extends State { // Check network connectivity early to fast-path airplane mode. // Timeout guards against connectivity_plus hanging on some Android TV devices after force-close. bool hasNetwork; - Sentry.addBreadcrumb(Breadcrumb(message: 'Checking network connectivity', category: 'setup')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Checking network connectivity', category: 'setup'))); try { final connectivityResult = await Connectivity().checkConnectivity().timeout( const Duration(seconds: 3), @@ -929,7 +930,9 @@ class _SetupScreenState extends State { hasNetwork = true; } - Sentry.addBreadcrumb(Breadcrumb(message: 'Network check done: hasNetwork=$hasNetwork', category: 'setup')); + unawaited( + Sentry.addBreadcrumb(Breadcrumb(message: 'Network check done: hasNetwork=$hasNetwork', category: 'setup')), + ); if (hasNetwork) { _setStatus(t.common.refreshingServers); @@ -941,7 +944,7 @@ class _SetupScreenState extends State { if (refreshResult == ServerRefreshResult.authError) { await storage.clearCredentials(); if (mounted) { - Navigator.pushReplacement(context, fadeRoute(const AuthScreen())); + unawaited(Navigator.pushReplacement(context, fadeRoute(const AuthScreen()))); } return; } @@ -954,7 +957,7 @@ class _SetupScreenState extends State { if (servers.isEmpty) { if (mounted) { - Navigator.pushReplacement(context, fadeRoute(const AuthScreen())); + unawaited(Navigator.pushReplacement(context, fadeRoute(const AuthScreen()))); } return; } @@ -966,11 +969,13 @@ class _SetupScreenState extends State { _setStatus(t.common.startingOfflineMode); await context.read().ensureInitialized(); if (!mounted) return; - Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true))); + unawaited(Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true)))); return; } - Sentry.addBreadcrumb(Breadcrumb(message: 'Connecting to ${servers.length} server(s)', category: 'setup')); + unawaited( + Sentry.addBreadcrumb(Breadcrumb(message: 'Connecting to ${servers.length} server(s)', category: 'setup')), + ); _setStatus(t.common.connectingToServers); // Populate per-server status for splash display @@ -1006,16 +1011,18 @@ class _SetupScreenState extends State { if (result.hasConnections && result.firstClient != null) { // Resume any downloads that were interrupted by app kill final downloadProvider = context.read(); - downloadProvider.ensureInitialized().then((_) { - downloadProvider.resumeQueuedDownloads(result.firstClient!); - }); + unawaited( + downloadProvider.ensureInitialized().then((_) { + downloadProvider.resumeQueuedDownloads(result.firstClient!); + }), + ); - Navigator.pushReplacement(context, fadeRoute(MainScreen(client: result.firstClient!))); + unawaited(Navigator.pushReplacement(context, fadeRoute(MainScreen(client: result.firstClient!)))); } else { _setStatus(t.common.startingOfflineMode); await context.read().ensureInitialized(); if (!mounted) return; - Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true))); + unawaited(Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true)))); } } catch (e, stackTrace) { appLogger.e('Error during multi-server connection', error: e, stackTrace: stackTrace); @@ -1024,7 +1031,7 @@ class _SetupScreenState extends State { _setStatus(t.common.startingOfflineMode); await context.read().ensureInitialized(); if (!mounted) return; - Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true))); + unawaited(Navigator.pushReplacement(context, fadeRoute(const MainScreen(isOfflineMode: true)))); } } } diff --git a/lib/models/companion_remote/remote_session.g.dart b/lib/models/companion_remote/remote_session.g.dart index ee6f3c4e..ca1084a8 100644 --- a/lib/models/companion_remote/remote_session.g.dart +++ b/lib/models/companion_remote/remote_session.g.dart @@ -10,62 +10,44 @@ RemoteDevice _$RemoteDeviceFromJson(Map json) => RemoteDevice( id: json['id'] as String, name: json['name'] as String, platform: json['platform'] as String, - connectedAt: json['connectedAt'] == null - ? null - : DateTime.parse(json['connectedAt'] as String), - capabilities: (json['capabilities'] as Map?)?.map( - (k, e) => MapEntry(k, e as bool), - ), + connectedAt: json['connectedAt'] == null ? null : DateTime.parse(json['connectedAt'] as String), + capabilities: (json['capabilities'] as Map?)?.map((k, e) => MapEntry(k, e as bool)), ); -Map _$RemoteDeviceToJson(RemoteDevice instance) => - { - 'id': instance.id, - 'name': instance.name, - 'platform': instance.platform, - 'connectedAt': instance.connectedAt.toIso8601String(), - 'capabilities': instance.capabilities, - }; - -RemoteSession _$RemoteSessionFromJson(Map json) => - RemoteSession( - role: $enumDecode( - _$RemoteSessionRoleEnumMap, - json['role'], - unknownValue: RemoteSessionRole.remote, - ), - status: - $enumDecodeNullable( - _$RemoteSessionStatusEnumMap, - json['status'], - unknownValue: RemoteSessionStatus.disconnected, - ) ?? - RemoteSessionStatus.disconnected, - connectedDevice: json['connectedDevice'] == null - ? null - : RemoteDevice.fromJson( - json['connectedDevice'] as Map, - ), - createdAt: json['createdAt'] == null - ? null - : DateTime.parse(json['createdAt'] as String), - errorMessage: json['errorMessage'] as String?, - ); - -Map _$RemoteSessionToJson(RemoteSession instance) => - { - 'role': _$RemoteSessionRoleEnumMap[instance.role]!, - 'status': _$RemoteSessionStatusEnumMap[instance.status]!, - 'connectedDevice': instance.connectedDevice, - 'createdAt': instance.createdAt.toIso8601String(), - 'errorMessage': instance.errorMessage, - }; - -const _$RemoteSessionRoleEnumMap = { - RemoteSessionRole.host: 'host', - RemoteSessionRole.remote: 'remote', +Map _$RemoteDeviceToJson(RemoteDevice instance) => { + 'id': instance.id, + 'name': instance.name, + 'platform': instance.platform, + 'connectedAt': instance.connectedAt.toIso8601String(), + 'capabilities': instance.capabilities, }; +RemoteSession _$RemoteSessionFromJson(Map json) => RemoteSession( + role: $enumDecode(_$RemoteSessionRoleEnumMap, json['role'], unknownValue: RemoteSessionRole.remote), + status: + $enumDecodeNullable( + _$RemoteSessionStatusEnumMap, + json['status'], + unknownValue: RemoteSessionStatus.disconnected, + ) ?? + RemoteSessionStatus.disconnected, + connectedDevice: json['connectedDevice'] == null + ? null + : RemoteDevice.fromJson(json['connectedDevice'] as Map), + createdAt: json['createdAt'] == null ? null : DateTime.parse(json['createdAt'] as String), + errorMessage: json['errorMessage'] as String?, +); + +Map _$RemoteSessionToJson(RemoteSession instance) => { + 'role': _$RemoteSessionRoleEnumMap[instance.role]!, + 'status': _$RemoteSessionStatusEnumMap[instance.status]!, + 'connectedDevice': instance.connectedDevice, + 'createdAt': instance.createdAt.toIso8601String(), + 'errorMessage': instance.errorMessage, +}; + +const _$RemoteSessionRoleEnumMap = {RemoteSessionRole.host: 'host', RemoteSessionRole.remote: 'remote'}; + const _$RemoteSessionStatusEnumMap = { RemoteSessionStatus.disconnected: 'disconnected', RemoteSessionStatus.connecting: 'connecting', diff --git a/lib/models/play_queue_response.g.dart b/lib/models/play_queue_response.g.dart index 576098f0..70e8cd5a 100644 --- a/lib/models/play_queue_response.g.dart +++ b/lib/models/play_queue_response.g.dart @@ -6,21 +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: flexibleBool(json['playQueueShuffled']), - 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: flexibleBool(json['playQueueShuffled']), + 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_home.g.dart b/lib/models/plex_home.g.dart index d9c51148..2bbb85d8 100644 --- a/lib/models/plex_home.g.dart +++ b/lib/models/plex_home.g.dart @@ -13,11 +13,7 @@ PlexHome _$PlexHomeFromJson(Map json) => PlexHome( guestUserUUID: json['guestUserUUID'] as String? ?? '', guestEnabled: json['guestEnabled'] as bool? ?? false, subscription: json['subscription'] as bool? ?? false, - users: - (json['users'] as List?) - ?.map((e) => PlexHomeUser.fromJson(e as Map)) - .toList() ?? - [], + users: (json['users'] as List?)?.map((e) => PlexHomeUser.fromJson(e as Map)).toList() ?? [], ); Map _$PlexHomeToJson(PlexHome instance) => { diff --git a/lib/models/plex_home_user.g.dart b/lib/models/plex_home_user.g.dart index 56d5e7d6..5d68af50 100644 --- a/lib/models/plex_home_user.g.dart +++ b/lib/models/plex_home_user.g.dart @@ -22,19 +22,18 @@ PlexHomeUser _$PlexHomeUserFromJson(Map json) => PlexHomeUser( protected: json['protected'] as bool? ?? false, ); -Map _$PlexHomeUserToJson(PlexHomeUser instance) => - { - 'id': instance.id, - 'uuid': instance.uuid, - 'title': instance.title, - 'username': instance.username, - 'email': instance.email, - 'friendlyName': instance.friendlyName, - 'thumb': instance.thumb, - 'hasPassword': instance.hasPassword, - 'restricted': instance.restricted, - 'updatedAt': instance.updatedAt, - 'admin': instance.admin, - 'guest': instance.guest, - 'protected': instance.protected, - }; +Map _$PlexHomeUserToJson(PlexHomeUser instance) => { + 'id': instance.id, + 'uuid': instance.uuid, + 'title': instance.title, + 'username': instance.username, + 'email': instance.email, + 'friendlyName': instance.friendlyName, + 'thumb': instance.thumb, + 'hasPassword': instance.hasPassword, + 'restricted': instance.restricted, + 'updatedAt': instance.updatedAt, + 'admin': instance.admin, + 'guest': instance.guest, + 'protected': instance.protected, +}; diff --git a/lib/models/plex_library.g.dart b/lib/models/plex_library.g.dart index c527e046..37a7f43e 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.dart b/lib/models/plex_metadata.dart index db1b33d5..b4b6c142 100644 --- a/lib/models/plex_metadata.dart +++ b/lib/models/plex_metadata.dart @@ -413,7 +413,7 @@ class PlexMetadata with MultiServerFields { final images = json['Image'] as List?; if (images == null) return null; - for (var image in images) { + for (final image in images) { if (image is Map && image['type'] == imageType) { return image['url'] as String?; } diff --git a/lib/models/plex_metadata.g.dart b/lib/models/plex_metadata.g.dart index 43d0be10..cd168233 100644 --- a/lib/models/plex_metadata.g.dart +++ b/lib/models/plex_metadata.g.dart @@ -42,9 +42,7 @@ PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( leafCount: (json['leafCount'] as num?)?.toInt(), viewedLeafCount: (json['viewedLeafCount'] as num?)?.toInt(), childCount: flexibleInt(json['childCount']), - 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(), mediaVersions: (json['Media'] as List?) ?.map((e) => PlexMediaVersion.fromJson(e as Map)) .toList(), @@ -76,59 +74,58 @@ PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( backgroundSquare: json['backgroundSquare'] 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, - 'userRating': instance.userRating, - '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, - 'subtitleMode': instance.subtitleMode, - 'playlistItemID': instance.playlistItemID, - 'playQueueItemID': instance.playQueueItemID, - 'librarySectionID': instance.librarySectionID, - 'librarySectionTitle': instance.librarySectionTitle, - 'ratingImage': instance.ratingImage, - 'audienceRatingImage': instance.audienceRatingImage, - 'tagline': instance.tagline, - 'originalTitle': instance.originalTitle, - 'editionTitle': instance.editionTitle, - 'subtype': instance.subtype, - 'extraType': instance.extraType, - 'primaryExtraKey': instance.primaryExtraKey, - 'clearLogo': instance.clearLogo, - 'backgroundSquare': instance.backgroundSquare, - }; +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, + 'userRating': instance.userRating, + '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, + 'subtitleMode': instance.subtitleMode, + 'playlistItemID': instance.playlistItemID, + 'playQueueItemID': instance.playQueueItemID, + 'librarySectionID': instance.librarySectionID, + 'librarySectionTitle': instance.librarySectionTitle, + 'ratingImage': instance.ratingImage, + 'audienceRatingImage': instance.audienceRatingImage, + 'tagline': instance.tagline, + 'originalTitle': instance.originalTitle, + 'editionTitle': instance.editionTitle, + 'subtype': instance.subtype, + 'extraType': instance.extraType, + 'primaryExtraKey': instance.primaryExtraKey, + 'clearLogo': instance.clearLogo, + 'backgroundSquare': instance.backgroundSquare, +}; diff --git a/lib/models/plex_playlist.g.dart b/lib/models/plex_playlist.g.dart index 63d5512b..90dc322f 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/mpv/player/player_base.dart b/lib/mpv/player/player_base.dart index 74eef2f6..588bbf36 100644 --- a/lib/mpv/player/player_base.dart +++ b/lib/mpv/player/player_base.dart @@ -351,7 +351,7 @@ abstract class PlayerBase with PlayerStreamControllersMixin implements Player { 3 => 'quit', 4 => 'error', 5 => 'redirect', - String s => s, + final String s => s, _ => null, }; if (reason == 'eof') { diff --git a/lib/providers/companion_remote_provider.dart b/lib/providers/companion_remote_provider.dart index e4b1e650..6e020a4c 100644 --- a/lib/providers/companion_remote_provider.dart +++ b/lib/providers/companion_remote_provider.dart @@ -188,7 +188,7 @@ class CompanionRemoteProvider with ChangeNotifier { /// Stop the host server and LAN broadcasting. Future stopHostServer() async { _intentionalDisconnect = true; - _discoveryService?.stopBroadcasting(); + await _discoveryService?.stopBroadcasting(); if (_peerService != null) { await _peerService!.disconnect(); diff --git a/lib/providers/libraries_provider.dart b/lib/providers/libraries_provider.dart index 3c39c0e9..340787d9 100644 --- a/lib/providers/libraries_provider.dart +++ b/lib/providers/libraries_provider.dart @@ -126,7 +126,7 @@ class LibrariesProvider extends ChangeNotifier { } // Create a map for quick lookup - final libraryMap = {for (var lib in libraries) lib.globalKey: lib}; + final libraryMap = {for (final lib in libraries) lib.globalKey: lib}; // Build ordered list based on saved order final orderedLibraries = []; diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index e9fcba27..fb30d83f 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -51,7 +51,7 @@ class _AuthScreenState extends State { setState(() { _useQrFlow = true; }); - _startAuthentication(); + unawaited(_startAuthentication()); } } @@ -115,7 +115,7 @@ class _AuthScreenState extends State { await profileFuture; if (!mounted) return; - Navigator.pushReplacement(context, fadeRoute(MainScreen(client: result.firstClient!))); + unawaited(Navigator.pushReplacement(context, fadeRoute(MainScreen(client: result.firstClient!)))); } catch (e) { appLogger.e('Failed to connect to servers', error: e); if (!mounted) return; diff --git a/lib/screens/discover_screen.dart b/lib/screens/discover_screen.dart index dcf78889..8e337127 100644 --- a/lib/screens/discover_screen.dart +++ b/lib/screens/discover_screen.dart @@ -416,8 +416,8 @@ class _DiscoverScreenState extends State // Center the active dot when possible final center = _currentHeroIndex; - int start = (center - 2).clamp(0, totalDots - 5); - int end = start + 4; // 5 dots total (0-4 inclusive) + final int start = (center - 2).clamp(0, totalDots - 5); + final int end = start + 4; // 5 dots total (0-4 inclusive) return (start: start, end: end); } @@ -461,6 +461,7 @@ class _DiscoverScreenState extends State // Get hidden libraries for filtering final hiddenLibrariesProvider = Provider.of(context, listen: false); await hiddenLibrariesProvider.ensureInitialized(); + if (!mounted) return; _lastSeenHiddenKeys = Set.of(hiddenLibrariesProvider.hiddenLibraryKeys); // Get settings for hub mode preference (ensure initialized before accessing) @@ -509,7 +510,7 @@ class _DiscoverScreenState extends State // Sync to Android TV Watch Next row if (Platform.isAndroid) { - _syncWatchNext(onDeck); + unawaited(_syncWatchNext(onDeck)); } // Sync PageController to first page after OnDeck loads @@ -622,7 +623,7 @@ class _DiscoverScreenState extends State // Sync to Android TV Watch Next row if (Platform.isAndroid) { - _syncWatchNext(onDeck); + unawaited(_syncWatchNext(onDeck)); } appLogger.d('Continue Watching refreshed successfully'); @@ -806,9 +807,11 @@ class _DiscoverScreenState extends State playbackStateProvider.clearShuffle(); if (mounted) { - Navigator.of( - context, - ).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => const AuthScreen()), (route) => false); + unawaited( + Navigator.of( + context, + ).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => const AuthScreen()), (route) => false), + ); } } } diff --git a/lib/screens/libraries/libraries_screen.dart b/lib/screens/libraries/libraries_screen.dart index 1c4b3e25..c97cf45f 100644 --- a/lib/screens/libraries/libraries_screen.dart +++ b/lib/screens/libraries/libraries_screen.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:plezy/widgets/app_icon.dart'; @@ -174,7 +176,7 @@ class _LibrariesScreenState extends State } if (libraryGlobalKeyToLoad != null && mounted) { - _loadLibraryContent(libraryGlobalKeyToLoad); + unawaited(_loadLibraryContent(libraryGlobalKeyToLoad)); } } @@ -536,7 +538,7 @@ class _LibrariesScreenState extends State .toList(); if (visibleLibraries.isNotEmpty) { - _loadLibraryContent(visibleLibraries.first.globalKey); + unawaited(_loadLibraryContent(visibleLibraries.first.globalKey)); } } } @@ -600,16 +602,16 @@ class _LibrariesScreenState extends State switch (action) { case 'scan': - _scanLibrary(library); + unawaited(_scanLibrary(library)); break; case 'analyze': - _analyzeLibrary(library); + unawaited(_analyzeLibrary(library)); break; case 'refresh': - _refreshLibraryMetadata(library); + unawaited(_refreshLibraryMetadata(library)); break; case 'empty_trash': - _emptyLibraryTrash(library); + unawaited(_emptyLibraryTrash(library)); break; } } diff --git a/lib/screens/libraries/tabs/library_browse_tab.dart b/lib/screens/libraries/tabs/library_browse_tab.dart index 72ba2c90..1e0916a8 100644 --- a/lib/screens/libraries/tabs/library_browse_tab.dart +++ b/lib/screens/libraries/tabs/library_browse_tab.dart @@ -611,8 +611,8 @@ class _LibraryBrowseTabState extends BaseLibraryTabState }); // Load favorites from the first available server (favorites are cloud-synced) - _loadFavorites(multiServer); + unawaited(_loadFavorites(multiServer)); if (allChannels.isNotEmpty && PlatformDetector.shouldUseSideNavigation(context)) { WidgetsBinding.instance.addPostFrameCallback((_) { diff --git a/lib/screens/main_screen.dart b/lib/screens/main_screen.dart index 1beee3cb..780e55a4 100644 --- a/lib/screens/main_screen.dart +++ b/lib/screens/main_screen.dart @@ -175,7 +175,7 @@ class _MainScreenState extends State with RouteAware, WindowListener // Auto-start companion remote server now that home data is available if (_companionRemoteSetup && mounted) { - _autoStartCompanionRemoteServer(context.read()); + unawaited(_autoStartCompanionRemoteServer(context.read())); } // Ensure first login (or any unset profile state) requires explicit selection. @@ -189,7 +189,7 @@ class _MainScreenState extends State with RouteAware, WindowListener } // Check for updates on startup - _checkForUpdatesOnStartup(); + unawaited(_checkForUpdatesOnStartup()); }); } @@ -327,7 +327,7 @@ class _MainScreenState extends State with RouteAware, WindowListener final contentId = await watchNext.getInitialDeepLink(); if (contentId != null && mounted) { appLogger.d('Watch Next initial deep link: $contentId'); - _handleWatchNextContentId(contentId); + unawaited(_handleWatchNextContentId(contentId)); } }); } @@ -357,7 +357,7 @@ class _MainScreenState extends State with RouteAware, WindowListener if (metadata == null || !mounted) return; - navigateToVideoPlayer(context, metadata: metadata); + unawaited(navigateToVideoPlayer(context, metadata: metadata)); } catch (e) { appLogger.e('Watch Next: failed to navigate to media', error: e); } @@ -697,7 +697,7 @@ class _MainScreenState extends State with RouteAware, WindowListener if (!result.confirmed) return; } } - SystemNavigator.pop(); + unawaited(SystemNavigator.pop()); }); } @@ -823,7 +823,7 @@ class _MainScreenState extends State with RouteAware, WindowListener } // Reset other provider states - hiddenLibrariesProvider.refresh(); + unawaited(hiddenLibrariesProvider.refresh()); playbackStateProvider.clearShuffle(); appLogger.d('Cleared all provider states for profile switch'); diff --git a/lib/screens/media_detail_screen.dart b/lib/screens/media_detail_screen.dart index 6cc3868b..514952a9 100644 --- a/lib/screens/media_detail_screen.dart +++ b/lib/screens/media_detail_screen.dart @@ -323,7 +323,7 @@ class _MediaDetailScreenState extends State }); // Re-fetch episodes for the currently selected season if (!_showEpisodesDirectly && _seasons.isNotEmpty) { - _fetchSeasonEpisodes(_selectedSeasonIndex); + unawaited(_fetchSeasonEpisodes(_selectedSeasonIndex)); } } else if (widget.metadata.isSeason) { await _fetchAllEpisodes(); @@ -872,8 +872,8 @@ class _MediaDetailScreenState extends State context, isWatched ? t.messages.markedAsUnwatchedOffline : t.messages.markedAsWatchedOffline, ); - _updateWatchStateOffline(); - _loadOfflineOnDeckEpisode(); + unawaited(_updateWatchStateOffline()); + unawaited(_loadOfflineOnDeckEpisode()); } } else { // Online mode: send to server @@ -1237,7 +1237,7 @@ class _MediaDetailScreenState extends State if (widget.metadata.isShow) { _loadSeasonsFromDownloads(); // Get offline OnDeck episode - _loadOfflineOnDeckEpisode(); + unawaited(_loadOfflineOnDeckEpisode()); } else if (widget.metadata.isSeason) { _seasons = [widget.metadata]; _showEpisodesDirectly = true; @@ -1286,16 +1286,16 @@ class _MediaDetailScreenState extends State // Load seasons if it's a show if (metadata.isShow) { - _loadSeasons(); + unawaited(_loadSeasons()); } else if (metadata.isSeason) { _seasons = [widget.metadata]; _showEpisodesDirectly = true; - _fetchAllEpisodes(); + unawaited(_fetchAllEpisodes()); } // Load extras (trailers, behind-the-scenes, etc.) - _loadExtras(); - _loadRelatedHubs(); + unawaited(_loadExtras()); + unawaited(_loadRelatedHubs()); return; } @@ -1307,11 +1307,11 @@ class _MediaDetailScreenState extends State }); if (widget.metadata.isShow) { - _loadSeasons(); + unawaited(_loadSeasons()); } else if (widget.metadata.isSeason) { _seasons = [widget.metadata]; _showEpisodesDirectly = true; - _fetchAllEpisodes(); + unawaited(_fetchAllEpisodes()); } } catch (e) { // Fallback to passed metadata on error @@ -1322,11 +1322,11 @@ class _MediaDetailScreenState extends State }); if (widget.metadata.isShow) { - _loadSeasons(); + unawaited(_loadSeasons()); } else if (widget.metadata.isSeason) { _seasons = [widget.metadata]; _showEpisodesDirectly = true; - _fetchAllEpisodes(); + unawaited(_fetchAllEpisodes()); } } } @@ -1383,7 +1383,7 @@ class _MediaDetailScreenState extends State await _fetchAllEpisodes(); } else if (seasonsWithServerId.isNotEmpty) { // Fetch episodes for the auto-selected season - _fetchSeasonEpisodes(onDeckSeasonIndex); + unawaited(_fetchSeasonEpisodes(onDeckSeasonIndex)); } } catch (e) { setStateIfMounted(() { @@ -2376,7 +2376,7 @@ class _MediaDetailScreenState extends State if (context.mounted) { await navigateToVideoPlayer(context, metadata: firstEpisode); // Refresh metadata when returning from video player - _loadFullMetadata(); + unawaited(_loadFullMetadata()); } } catch (e) { // Close loading indicator if it's still open diff --git a/lib/screens/settings/appearance_settings_screen.dart b/lib/screens/settings/appearance_settings_screen.dart index faca33d3..3fc8b0d6 100644 --- a/lib/screens/settings/appearance_settings_screen.dart +++ b/lib/screens/settings/appearance_settings_screen.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io' show Platform; import 'package:flutter/material.dart'; @@ -128,7 +129,7 @@ class _AppearanceSettingsScreenState extends State { ); if (value != null) { await _settingsService.write(settings.SettingsService.appLocale, value); - LocaleSettings.setLocale(value); + unawaited(LocaleSettings.setLocale(value)); _restartApp(); } }, diff --git a/lib/screens/settings/logs_screen.dart b/lib/screens/settings/logs_screen.dart index a57cec7d..ae6c170c 100644 --- a/lib/screens/settings/logs_screen.dart +++ b/lib/screens/settings/logs_screen.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -141,34 +142,36 @@ class _LogsScreenState extends State { final data = response.data is String ? jsonDecode(response.data) : response.data; final id = (data as Map)['id'] as String; - showDialog( - context: context, - builder: (ctx) => AlertDialog( - title: Text(t.messages.logsUploaded), - content: Row( - children: [ - Text('${t.messages.logId}: '), - SelectableText( - id, - style: const TextStyle(fontWeight: FontWeight.bold, fontFamily: 'monospace', fontSize: 18), - ), - const SizedBox(width: 8), - IconButton( - icon: const Icon(Icons.copy, size: 20), - onPressed: () { - Clipboard.setData(ClipboardData(text: id)); - showSuccessSnackBar(context, t.messages.logsCopied); - }, + unawaited( + showDialog( + context: context, + builder: (ctx) => AlertDialog( + title: Text(t.messages.logsUploaded), + content: Row( + children: [ + Text('${t.messages.logId}: '), + SelectableText( + id, + style: const TextStyle(fontWeight: FontWeight.bold, fontFamily: 'monospace', fontSize: 18), + ), + const SizedBox(width: 8), + IconButton( + icon: const Icon(Icons.copy, size: 20), + onPressed: () { + Clipboard.setData(ClipboardData(text: id)); + showSuccessSnackBar(context, t.messages.logsCopied); + }, + ), + ], + ), + actions: [ + FocusableButton( + autofocus: true, + onPressed: () => Navigator.of(ctx).pop(), + child: TextButton(onPressed: () => Navigator.of(ctx).pop(), child: Text(t.common.close)), ), ], ), - actions: [ - FocusableButton( - autofocus: true, - onPressed: () => Navigator.of(ctx).pop(), - child: TextButton(onPressed: () => Navigator.of(ctx).pop(), child: Text(t.common.close)), - ), - ], ), ); } catch (_) { diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 8350a06a..81e15a14 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -548,46 +548,48 @@ class _SettingsScreenState extends State with FocusableTab { final storageService = DownloadStorageService.instance; final isCustom = storageService.isUsingCustomPath(); - showDialog( - context: context, - builder: (dialogContext) => AlertDialog( - title: Text(t.settings.downloads), - content: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(t.settings.downloadLocationDescription), - const SizedBox(height: 16), - FutureBuilder( - future: storageService.getCurrentDownloadPathDisplay(), - builder: (context, snapshot) { - return Text( - t.settings.currentPath(path: snapshot.data ?? '...'), - style: Theme.of(context).textTheme.bodySmall, - ); - }, - ), - ], - ), - actions: [ - if (isCustom) + unawaited( + showDialog( + context: context, + builder: (dialogContext) => AlertDialog( + title: Text(t.settings.downloads), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(t.settings.downloadLocationDescription), + const SizedBox(height: 16), + FutureBuilder( + future: storageService.getCurrentDownloadPathDisplay(), + builder: (context, snapshot) { + return Text( + t.settings.currentPath(path: snapshot.data ?? '...'), + style: Theme.of(context).textTheme.bodySmall, + ); + }, + ), + ], + ), + actions: [ + if (isCustom) + DialogActionButton( + onPressed: () async { + Navigator.pop(dialogContext); + await _resetDownloadLocation(); + }, + label: t.settings.resetToDefault, + ), + DialogActionButton(onPressed: () => Navigator.pop(dialogContext), label: t.common.cancel), DialogActionButton( onPressed: () async { Navigator.pop(dialogContext); - await _resetDownloadLocation(); + await _selectDownloadLocation(); }, - label: t.settings.resetToDefault, + label: t.settings.selectFolder, + isPrimary: true, ), - DialogActionButton(onPressed: () => Navigator.pop(dialogContext), label: t.common.cancel), - DialogActionButton( - onPressed: () async { - Navigator.pop(dialogContext); - await _selectDownloadLocation(); - }, - label: t.settings.selectFolder, - isPrimary: true, - ), - ], + ], + ), ), ); } @@ -725,7 +727,7 @@ class _SettingsScreenState extends State with FocusableTab { await _keyboardService?.resetToDefaults(); if (mounted) { showSuccessSnackBar(context, t.settings.resetSettingsSuccess); - _loadSettings(); + unawaited(_loadSettings()); } } @@ -766,7 +768,7 @@ class _SettingsScreenState extends State with FocusableTab { if (!mounted) return; if (result == null) return; // user cancelled file picker - LocaleSettings.setLocale(_settingsService.read(settings.SettingsService.appLocale)); + unawaited(LocaleSettings.setLocale(_settingsService.read(settings.SettingsService.appLocale))); await Future.wait([ themeProvider.reload(), settingsProvider.reload(), @@ -776,7 +778,7 @@ class _SettingsScreenState extends State with FocusableTab { unawaited(librariesProvider.refresh()); if (!mounted) return; - _loadSettings(); + unawaited(_loadSettings()); showSuccessSnackBar(context, t.settings.importSettingsSuccess); } on NoUserSignedInException { if (mounted) showErrorSnackBar(context, t.settings.importSettingsNoUser); diff --git a/lib/screens/settings/subtitle_styling_screen.dart b/lib/screens/settings/subtitle_styling_screen.dart index ea14ccea..2e9ccc7b 100644 --- a/lib/screens/settings/subtitle_styling_screen.dart +++ b/lib/screens/settings/subtitle_styling_screen.dart @@ -71,7 +71,7 @@ class _SubtitleStylingScreenState extends State { } Future _showColorPicker(String title, String currentColor, Function(String) onColorSelected) async { - Color initialColor = _hexToColor(currentColor); + final Color initialColor = _hexToColor(currentColor); final Color selectedColor = await showColorPickerDialog( context, diff --git a/lib/screens/video_player_screen.dart b/lib/screens/video_player_screen.dart index a8ad9db6..16e3bc84 100644 --- a/lib/screens/video_player_screen.dart +++ b/lib/screens/video_player_screen.dart @@ -789,7 +789,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin // Apply saved volume (clamped to max volume) final savedVolume = settingsService.read(SettingsService.volume).clamp(0.0, maxVolume.toDouble()); - player!.setVolume(savedVolume); + unawaited(player!.setVolume(savedVolume)); // Notify that player is ready if (mounted) { @@ -804,7 +804,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin } // Enable wakelock to prevent screen from turning off during playback - _setWakelock(true); + unawaited(_setWakelock(true)); appLogger.d('Wakelock enabled for video playback'); } @@ -822,8 +822,8 @@ class VideoPlayerScreenState extends State with WidgetsBindin OrientationHelper.setLandscapeOrientation(); } else { // Unlocked: Allow all orientations immediately - SystemChrome.setPreferredOrientations(DeviceOrientation.values); - SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); + unawaited(SystemChrome.setPreferredOrientations(DeviceOrientation.values)); + unawaited(SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky)); } } catch (e) { appLogger.w('Failed to set orientation', error: e); @@ -903,7 +903,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin _liveStreamFallbackLevel = 0; if (!_hasFirstFrame.value) { _hasFirstFrame.value = true; - Sentry.addBreadcrumb(Breadcrumb(message: 'First frame ready', category: 'player')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'First frame ready', category: 'player'))); // Apply frame rate matching on Android if enabled if (Platform.isAndroid && settingsService.read(SettingsService.matchContentFrameRate)) { @@ -958,7 +958,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin await _initializeServices(); // Load next/previous episodes (fire-and-forget) - _loadAdjacentEpisodes(); + unawaited(_loadAdjacentEpisodes()); } catch (e) { appLogger.e('Failed to initialize player', error: e); if (mounted) { @@ -1038,10 +1038,12 @@ class VideoPlayerScreenState extends State with WidgetsBindin await player!.play(); } - Sentry.addBreadcrumb( - Breadcrumb( - message: 'Frame rate matching: ${fps}fps, switched=$didSwitch, delay=${delaySec}s', - category: 'player', + unawaited( + Sentry.addBreadcrumb( + Breadcrumb( + message: 'Frame rate matching: ${fps}fps, switched=$didSwitch, delay=${delaySec}s', + category: 'player', + ), ), ); appLogger.d('Frame rate matching: Set display to ${fps}fps (duration: ${durationMs}ms, switched=$didSwitch)'); @@ -1057,7 +1059,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin try { await player!.clearVideoFrameRate(); await player!.setProperty('video-sync', 'audio'); - Sentry.addBreadcrumb(Breadcrumb(message: 'Frame rate matching cleared', category: 'player')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Frame rate matching cleared', category: 'player'))); appLogger.d('Frame rate matching: Cleared, restored default display mode'); } catch (e) { appLogger.d('Failed to clear frame rate matching', error: e); @@ -1241,9 +1243,9 @@ class VideoPlayerScreenState extends State with WidgetsBindin // Start Discord Rich Presence for current media if (client != null) { - DiscordRPCService.instance.startPlayback(_currentMetadata, client); - TraktScrobbleService.instance.startPlayback(_currentMetadata, client, isLive: widget.isLive); - TrackerCoordinator.instance.startPlayback(_currentMetadata, client, isLive: widget.isLive); + unawaited(DiscordRPCService.instance.startPlayback(_currentMetadata, client)); + unawaited(TraktScrobbleService.instance.startPlayback(_currentMetadata, client, isLive: widget.isLive)); + unawaited(TrackerCoordinator.instance.startPlayback(_currentMetadata, client, isLive: widget.isLive)); } } @@ -1479,10 +1481,10 @@ class VideoPlayerScreenState extends State with WidgetsBindin } } catch (e) { appLogger.e('Failed to start live TV playback', error: e); - _sendLiveTimeline('stopped'); + unawaited(_sendLiveTimeline('stopped')); if (mounted) { showErrorSnackBar(context, e.toString()); - _handleBackButton(); + unawaited(_handleBackButton()); } } return; @@ -1652,7 +1654,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin _videoFilterManager?.enterPipMode(); }; if (player!.state.playing) { - _videoPIPManager!.updateAutoPipState(isPlaying: true); + unawaited(_videoPIPManager!.updateAutoPipState(isPlaying: true)); } } @@ -1747,10 +1749,12 @@ class VideoPlayerScreenState extends State with WidgetsBindin } } - Sentry.addBreadcrumb( - Breadcrumb( - message: 'Pre-playback frame rate: ${preKnownFps}fps, switched=$didSwitch, delay=${delaySec}s', - category: 'player', + unawaited( + Sentry.addBreadcrumb( + Breadcrumb( + message: 'Pre-playback frame rate: ${preKnownFps}fps, switched=$didSwitch, delay=${delaySec}s', + category: 'player', + ), ), ); } @@ -2008,7 +2012,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin // Persist ambient lighting state final settings = await SettingsService.getInstance(); - settings.write(SettingsService.ambientLighting, ambientLighting.isEnabled); + unawaited(settings.write(SettingsService.ambientLighting, ambientLighting.isEnabled)); if (mounted) setState(() {}); } @@ -2109,7 +2113,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin // Use same navigation as local episode change (pushReplacement from player context) _isReplacingWithVideo = true; - navigateToVideoPlayer(context, metadata: metadata, usePushReplacement: true); + unawaited(navigateToVideoPlayer(context, metadata: metadata, usePushReplacement: true)); } void _setupCompanionRemoteCallbacks() { @@ -2150,23 +2154,23 @@ class VideoPlayerScreenState extends State with WidgetsBindin final settings = await SettingsService.getInstance(); final maxVol = settings.read(SettingsService.maxVolume).toDouble(); final newVolume = (player!.state.volume + 10).clamp(0.0, maxVol); - player!.setVolume(newVolume); - settings.write(SettingsService.volume, newVolume); + unawaited(player!.setVolume(newVolume)); + unawaited(settings.write(SettingsService.volume, newVolume)); }; receiver.onVolumeDown = () async { if (player == null) return; final settings = await SettingsService.getInstance(); final maxVol = settings.read(SettingsService.maxVolume).toDouble(); final newVolume = (player!.state.volume - 10).clamp(0.0, maxVol); - player!.setVolume(newVolume); - settings.write(SettingsService.volume, newVolume); + unawaited(player!.setVolume(newVolume)); + unawaited(settings.write(SettingsService.volume, newVolume)); }; receiver.onVolumeMute = () async { if (player == null) return; final settings = await SettingsService.getInstance(); final newVolume = player!.state.volume > 0 ? 0.0 : 100.0; - player!.setVolume(newVolume); - settings.write(SettingsService.volume, newVolume); + unawaited(player!.setVolume(newVolume)); + unawaited(settings.write(SettingsService.volume, newVolume)); }; receiver.onSubtitles = _cycleSubtitleTrack; receiver.onAudioTracks = _cycleAudioTrack; @@ -2470,13 +2474,13 @@ class VideoPlayerScreenState extends State with WidgetsBindin // mpv does not flip the `pause` property on EOF, so _onPlayingStateChanged // never fires false. Normalize all playback-dependent state. - _setWakelock(false); - _progressTracker?.sendProgress('paused'); + unawaited(_setWakelock(false)); + unawaited(_progressTracker?.sendProgress('paused')); _updateMediaControlsPlaybackState(); - DiscordRPCService.instance.pausePlayback(); - TraktScrobbleService.instance.pausePlayback(); + unawaited(DiscordRPCService.instance.pausePlayback()); + unawaited(TraktScrobbleService.instance.pausePlayback()); if (_autoPipEnabled) { - _videoPIPManager?.updateAutoPipState(isPlaying: false); + unawaited(_videoPIPManager?.updateAutoPipState(isPlaying: false)); } if (_nextEpisode != null && !_showPlayNextDialog && !_showStillWatchingPrompt && !_completionTriggered) { @@ -2484,7 +2488,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin // PiP: skip dialog (user can't interact), auto-play immediately if (PipService().isPipActive.value) { - _playNext(); + unawaited(_playNext()); return; } @@ -2514,7 +2518,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin } } else if (_nextEpisode == null && !_completionTriggered) { _completionTriggered = true; - _handleBackButton(); + unawaited(_handleBackButton()); } } @@ -2560,7 +2564,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin Future _showServerLimitDialog() async { if (!mounted) return; await showServerLimitDialog(context); - if (mounted) _handleBackButton(); + if (mounted) unawaited(_handleBackButton()); } /// Handle notification when native player switched from ExoPlayer to MPV @@ -2606,7 +2610,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin Future _restoreMediaControlsAfterResume() async { if (!_isPlayerInitialized || !mounted) return; - _setWakelock(player?.state.isActive ?? false); + unawaited(_setWakelock(player?.state.isActive ?? false)); final manager = _mediaControlsManager; final currentPlayer = player; @@ -2770,7 +2774,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin widget.liveDvrKey == null) { appLogger.w('Cannot retry live stream — missing session info'); showGlobalErrorSnackBar(_lastLogError ?? 'Live stream failed'); - _handleBackButton(); + unawaited(_handleBackButton()); return; } @@ -2783,7 +2787,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin final tuneResult = await client.tuneChannel(widget.liveDvrKey!, channel.key); if (tuneResult == null || !mounted) { showGlobalErrorSnackBar(_lastLogError ?? 'Live stream failed'); - _handleBackButton(); + unawaited(_handleBackButton()); return; } @@ -2800,7 +2804,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin ); if (streamPath == null || !mounted) { showGlobalErrorSnackBar(_lastLogError ?? 'Live stream failed'); - _handleBackButton(); + unawaited(_handleBackButton()); return; } @@ -3128,18 +3132,20 @@ class VideoPlayerScreenState extends State with WidgetsBindin _isReplacingWithVideo = true; // Clear Discord Rich Presence + Trakt scrobble before switching episodes - DiscordRPCService.instance.stopPlayback(); - TraktScrobbleService.instance.stopPlayback(); - TrackerCoordinator.instance.stopPlayback(); + unawaited(DiscordRPCService.instance.stopPlayback()); + unawaited(TraktScrobbleService.instance.stopPlayback()); + unawaited(TrackerCoordinator.instance.stopPlayback()); // If player isn't available, navigate without preserving settings if (player == null) { if (mounted) { - navigateToVideoPlayer( - context, - metadata: episodeMetadata, - usePushReplacement: true, - isOffline: widget.isOffline, + unawaited( + navigateToVideoPlayer( + context, + metadata: episodeMetadata, + usePushReplacement: true, + isOffline: widget.isOffline, + ), ); } return; @@ -3150,11 +3156,13 @@ class VideoPlayerScreenState extends State with WidgetsBindin if (currentPlayer == null) { // Player already disposed, navigate without preserving settings if (mounted) { - navigateToVideoPlayer( - context, - metadata: episodeMetadata, - usePushReplacement: true, - isOffline: widget.isOffline, + unawaited( + navigateToVideoPlayer( + context, + metadata: episodeMetadata, + usePushReplacement: true, + isOffline: widget.isOffline, + ), ); } return; @@ -3165,7 +3173,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin final currentSecondarySubtitleTrack = currentPlayer.state.track.secondarySubtitle; // Pause and stop current playback - currentPlayer.pause(); + unawaited(currentPlayer.pause()); await _progressTracker?.sendProgress('stopped'); _progressTracker?.stopTracking(); @@ -3174,14 +3182,16 @@ class VideoPlayerScreenState extends State with WidgetsBindin // Navigate to the episode using pushReplacement to destroy current player if (mounted) { - navigateToVideoPlayer( - context, - metadata: episodeMetadata, - preferredAudioTrack: currentAudioTrack, - preferredSubtitleTrack: currentSubtitleTrack, - preferredSecondarySubtitleTrack: currentSecondarySubtitleTrack, - usePushReplacement: true, - isOffline: widget.isOffline, + unawaited( + navigateToVideoPlayer( + context, + metadata: episodeMetadata, + preferredAudioTrack: currentAudioTrack, + preferredSubtitleTrack: currentSubtitleTrack, + preferredSecondarySubtitleTrack: currentSecondarySubtitleTrack, + usePushReplacement: true, + isOffline: widget.isOffline, + ), ); } } @@ -3209,9 +3219,9 @@ class VideoPlayerScreenState extends State with WidgetsBindin _progressTracker?.stopTracking(); _progressTracker?.dispose(); _progressTracker = null; - DiscordRPCService.instance.stopPlayback(); - TraktScrobbleService.instance.stopPlayback(); - TrackerCoordinator.instance.stopPlayback(); + unawaited(DiscordRPCService.instance.stopPlayback()); + unawaited(TraktScrobbleService.instance.stopPlayback()); + unawaited(TrackerCoordinator.instance.stopPlayback()); _currentMetadata = episodeMetadata; _activeRatingKey = episodeMetadata.ratingKey; @@ -3323,9 +3333,9 @@ class VideoPlayerScreenState extends State with WidgetsBindin } if (client != null) { - DiscordRPCService.instance.startPlayback(episodeMetadata, client); - TraktScrobbleService.instance.startPlayback(episodeMetadata, client, isLive: widget.isLive); - TrackerCoordinator.instance.startPlayback(episodeMetadata, client, isLive: widget.isLive); + unawaited(DiscordRPCService.instance.startPlayback(episodeMetadata, client)); + unawaited(TraktScrobbleService.instance.startPlayback(episodeMetadata, client, isLive: widget.isLive)); + unawaited(TrackerCoordinator.instance.startPlayback(episodeMetadata, client, isLive: widget.isLive)); } try { @@ -3337,7 +3347,7 @@ class VideoPlayerScreenState extends State with WidgetsBindin await _loadAdjacentEpisodes(); if (_autoPipEnabled) { - _videoPIPManager?.updateAutoPipState(isPlaying: currentPlayer.state.playing); + unawaited(_videoPIPManager?.updateAutoPipState(isPlaying: currentPlayer.state.playing)); } } catch (e) { _isSwappingEpisode = false; diff --git a/lib/services/companion_remote/companion_remote_peer_service.dart b/lib/services/companion_remote/companion_remote_peer_service.dart index 0cbc9fed..68bf22d4 100644 --- a/lib/services/companion_remote/companion_remote_peer_service.dart +++ b/lib/services/companion_remote/companion_remote_peer_service.dart @@ -153,7 +153,7 @@ class CompanionRemotePeerService with KeepaliveMixin { } } else { request.response.statusCode = HttpStatus.notFound; - request.response.close(); + unawaited(request.response.close()); } }); @@ -229,7 +229,7 @@ class CompanionRemotePeerService with KeepaliveMixin { deviceName == null || platform == null) { socket.add(jsonEncode({'type': 'authFailed'})); - socket.close(4003, 'Authentication failed'); + unawaited(socket.close(4003, 'Authentication failed')); return; } @@ -240,7 +240,7 @@ class CompanionRemotePeerService with KeepaliveMixin { _recordFailedAuth(sourceIp); appLogger.w('CompanionRemote: Auth failed — unknown user'); socket.add(jsonEncode({'type': 'authFailed'})); - socket.close(4003, 'Authentication failed'); + unawaited(socket.close(4003, 'Authentication failed')); return; } @@ -261,7 +261,7 @@ class CompanionRemotePeerService with KeepaliveMixin { _recordFailedAuth(sourceIp); appLogger.w('CompanionRemote: Auth failed — invalid auth tag'); socket.add(jsonEncode({'type': 'authFailed'})); - socket.close(4003, 'Authentication failed'); + unawaited(socket.close(4003, 'Authentication failed')); return; } @@ -275,7 +275,7 @@ class CompanionRemotePeerService with KeepaliveMixin { // Close existing client if present if (_clientSocket != null) { appLogger.d('CompanionRemote: Replacing existing client connection'); - _clientSocket!.close(4004, 'Replaced by new connection'); + unawaited(_clientSocket!.close(4004, 'Replaced by new connection')); } _clientSocket = socket; @@ -298,7 +298,7 @@ class CompanionRemotePeerService with KeepaliveMixin { sendDeviceInfo(hostDeviceName, hostPlatform); } else { appLogger.w('CompanionRemote: Expected auth, got ${json['type']}'); - socket.close(4002, 'Authentication required'); + unawaited(socket.close(4002, 'Authentication required')); } } else { // Encrypted command — data is binary diff --git a/lib/services/discord_rpc_service.dart b/lib/services/discord_rpc_service.dart index d47f2bfa..36b00021 100644 --- a/lib/services/discord_rpc_service.dart +++ b/lib/services/discord_rpc_service.dart @@ -112,7 +112,7 @@ class DiscordRPCService { if (_isEnabled && _isConnected) { // Upload thumbnail in background, don't block playback - _uploadThumbnailAndUpdatePresence(); + unawaited(_uploadThumbnailAndUpdatePresence()); } } @@ -183,7 +183,7 @@ class DiscordRPCService { /// Clear the presence Future clearPresence() async { try { - _rpc?.clearPresence(); + unawaited(_rpc?.clearPresence()); } catch (e) { appLogger.d('Failed to clear Discord presence', error: e); } @@ -237,7 +237,7 @@ class DiscordRPCService { _disconnectedSubscription = null; _errorSubscription = null; try { - _rpc?.dispose(); + unawaited(_rpc?.dispose()); } catch (e) { appLogger.d('DiscordRPC: dispose ignored', error: e); } @@ -258,7 +258,7 @@ class DiscordRPCService { _errorSubscription = null; try { - _rpc?.dispose(); + unawaited(_rpc?.dispose()); } catch (e) { appLogger.d('Error disposing Discord RPC', error: e); } diff --git a/lib/services/download_manager_service.dart b/lib/services/download_manager_service.dart index 49fa7764..cba87e4f 100644 --- a/lib/services/download_manager_service.dart +++ b/lib/services/download_manager_service.dart @@ -201,11 +201,11 @@ class DownloadManagerService { /// then scans drift for orphaned items. Future recoverInterruptedDownloads() async { try { - Sentry.addBreadcrumb(Breadcrumb(message: 'Initializing FileDownloader', category: 'downloads')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Initializing FileDownloader', category: 'downloads'))); await _initializeFileDownloader(); // Let background_downloader re-enqueue tasks killed by the OS - Sentry.addBreadcrumb(Breadcrumb(message: 'Rescheduling killed tasks', category: 'downloads')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Rescheduling killed tasks', category: 'downloads'))); final (rescheduled, _) = await FileDownloader().rescheduleKilledTasks(); if (rescheduled.isNotEmpty) { appLogger.i('Rescheduled ${rescheduled.length} killed download task(s)'); @@ -251,7 +251,7 @@ class DownloadManagerService { } // Scan drift for orphaned items stuck in 'downloading' - Sentry.addBreadcrumb(Breadcrumb(message: 'Scanning for orphaned downloads', category: 'downloads')); + unawaited(Sentry.addBreadcrumb(Breadcrumb(message: 'Scanning for orphaned downloads', category: 'downloads'))); final allDownloads = await _database.select(_database.downloadedMedia).get(); for (final item in allDownloads) { if (item.status == DownloadStatus.downloading.index) { @@ -496,7 +496,7 @@ class DownloadManagerService { _emitProgress(globalKey, DownloadStatus.queued, 0); // Start processing if not already - _processQueue(client); + unawaited(_processQueue(client)); } /// Process the download queue — prepares and enqueues items with background_downloader. @@ -812,7 +812,7 @@ class DownloadManagerService { await _transitionStatus(globalKey, DownloadStatus.queued); await _database.addToQueue(mediaGlobalKey: globalKey); final client = _getClient(parseGlobalKey(globalKey)?.serverId); - if (client != null) _processQueue(client); + if (client != null) unawaited(_processQueue(client)); } /// Handle a failed download — auto-retry if retries remain, otherwise permanently fail. @@ -860,7 +860,7 @@ class DownloadManagerService { // Only advance the queue if the download actually started transferring. // Instant failures (DNS, connection) would just cause the next item to fail too. - if (hadProgress) _processQueue(client); + if (hadProgress) unawaited(_processQueue(client)); } else { if (isNetworkError) { appLogger.w('Network error for $globalKey, failing permanently (no auto-retry): $errorMessage'); @@ -891,7 +891,7 @@ class DownloadManagerService { // Try to enqueue more items from the queue final client = _getClient(parseGlobalKey(globalKey)?.serverId); - if (client != null) _processQueue(client); + if (client != null) unawaited(_processQueue(client)); } /// Execute an app-level auto-retry: transition back to queued and re-enqueue. @@ -913,7 +913,7 @@ class DownloadManagerService { await _database.updateBgTaskId(globalKey, null); await _transitionStatus(globalKey, DownloadStatus.queued); await _database.addToQueue(mediaGlobalKey: globalKey); - _processQueue(client); + unawaited(_processQueue(client)); } /// Handle a completed video download — store path, download supplementary content, mark done. @@ -1034,7 +1034,7 @@ class DownloadManagerService { _completingKeys.remove(globalKey); // Always advance the queue, even after errors final nextClient = _getClient(parseGlobalKey(globalKey)?.serverId); - if (nextClient != null) _processQueue(nextClient); + if (nextClient != null) unawaited(_processQueue(nextClient)); } } @@ -1372,7 +1372,7 @@ class DownloadManagerService { await _transitionStatus(globalKey, DownloadStatus.queued); await _database.addToQueue(mediaGlobalKey: globalKey); final resolvedClient = _getClient(parseGlobalKey(globalKey)?.serverId) ?? client; - _processQueue(resolvedClient); + unawaited(_processQueue(resolvedClient)); } /// Retry a failed download @@ -1384,7 +1384,7 @@ class DownloadManagerService { await _transitionStatus(globalKey, DownloadStatus.queued); await _database.addToQueue(mediaGlobalKey: globalKey); final resolvedClient = _getClient(parseGlobalKey(globalKey)?.serverId) ?? client; - _processQueue(resolvedClient); + unawaited(_processQueue(resolvedClient)); } /// Cancel a download diff --git a/lib/services/episode_navigation_service.dart b/lib/services/episode_navigation_service.dart index a8b992da..bbf250f2 100644 --- a/lib/services/episode_navigation_service.dart +++ b/lib/services/episode_navigation_service.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -89,13 +91,15 @@ class EpisodeNavigationService { // Navigate to the new episode if (context.mounted) { - navigateToVideoPlayer( - context, - metadata: episode, - preferredAudioTrack: currentAudioTrack, - preferredSubtitleTrack: currentSubtitleTrack, - preferredSecondarySubtitleTrack: currentSecondarySubtitleTrack, - usePushReplacement: usePushReplacement, + unawaited( + navigateToVideoPlayer( + context, + metadata: episode, + preferredAudioTrack: currentAudioTrack, + preferredSubtitleTrack: currentSubtitleTrack, + preferredSecondarySubtitleTrack: currentSecondarySubtitleTrack, + usePushReplacement: usePushReplacement, + ), ); } } diff --git a/lib/services/gamepad_service.dart b/lib/services/gamepad_service.dart index dbe4108e..5ee4311c 100644 --- a/lib/services/gamepad_service.dart +++ b/lib/services/gamepad_service.dart @@ -86,7 +86,7 @@ class GamepadService with WindowListener { _windowFocused = await windowManager.isFocused(); } - _subscription?.cancel(); + unawaited(_subscription?.cancel()); _subscription = Gamepad.instance.events.listen( _handleGamepadEvent, onError: (e) => appLogger.e('GamepadService: Stream error', error: e), @@ -138,11 +138,11 @@ class GamepadService with WindowListener { void _handleGamepadEvent(GamepadEvent event) { switch (event) { - case GamepadConnectionEvent e: + case final GamepadConnectionEvent e: appLogger.i('GamepadService: Gamepad ${e.connected ? "connected" : "disconnected"}: ${e.info.name}'); - case GamepadButtonEvent e: + case final GamepadButtonEvent e: _handleButton(e); - case GamepadAxisEvent e: + case final GamepadAxisEvent e: _handleAxis(e); } } diff --git a/lib/services/multi_server_manager.dart b/lib/services/multi_server_manager.dart index f3737126..3d562ce8 100644 --- a/lib/services/multi_server_manager.dart +++ b/lib/services/multi_server_manager.dart @@ -206,7 +206,9 @@ class MultiServerManager { } appLogger.i('Connecting to ${servers.length} servers...'); - Sentry.addBreadcrumb(Breadcrumb(message: 'Connecting to ${servers.length} server(s)', category: 'servers')); + unawaited( + Sentry.addBreadcrumb(Breadcrumb(message: 'Connecting to ${servers.length} server(s)', category: 'servers')), + ); // Re-use the persisted client ID so Plex doesn't see a "new device" on // every reconnect. @@ -531,7 +533,11 @@ class MultiServerManager { if (offline.isEmpty) return; appLogger.d('Attempting reconnection for ${offline.length} offline servers'); - Sentry.addBreadcrumb(Breadcrumb(message: 'Reconnecting ${offline.length} offline server(s)', category: 'servers')); + unawaited( + Sentry.addBreadcrumb( + Breadcrumb(message: 'Reconnecting ${offline.length} offline server(s)', category: 'servers'), + ), + ); if (forceRediscovery) { final storage = await StorageService.getInstance(); diff --git a/lib/services/play_queue_launcher.dart b/lib/services/play_queue_launcher.dart index 2d17c5f2..0f4883c4 100644 --- a/lib/services/play_queue_launcher.dart +++ b/lib/services/play_queue_launcher.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -253,13 +255,15 @@ class PlayQueueLauncher { // Show loading indicator if (showLoading && context.mounted) { loadingVisible = true; - showDialog( - context: context, - barrierDismissible: false, - builder: (dialogContext) { - loadingDialogContext = dialogContext; - return const Center(child: CircularProgressIndicator()); - }, + unawaited( + showDialog( + context: context, + barrierDismissible: false, + builder: (dialogContext) { + loadingDialogContext = dialogContext; + return const Center(child: CircularProgressIndicator()); + }, + ), ); } diff --git a/lib/services/playback_progress_tracker.dart b/lib/services/playback_progress_tracker.dart index fb4c2594..dfc787ee 100644 --- a/lib/services/playback_progress_tracker.dart +++ b/lib/services/playback_progress_tracker.dart @@ -128,20 +128,22 @@ class PlaybackProgressTracker { _resetBackoff(); } else { // Fire-and-forget for playing/paused — avoid blocking the Dart event loop - _sendOnlineProgress(state, position, duration) - .then((_) { - _resetBackoff(); - }) - .catchError((Object e) { - _consecutiveFailures++; - // Exponential backoff: skip 1, 2, 4, 8... ticks (capped at 6 ≈ 60s) - _ticksToSkip = (1 << (_consecutiveFailures - 1)).clamp(1, 6); - appLogger.d( - 'Progress update failed ($_consecutiveFailures consecutive), ' - 'skipping next $_ticksToSkip tick(s)', - error: e, - ); - }); + unawaited( + _sendOnlineProgress(state, position, duration) + .then((_) { + _resetBackoff(); + }) + .catchError((Object e) { + _consecutiveFailures++; + // Exponential backoff: skip 1, 2, 4, 8... ticks (capped at 6 ≈ 60s) + _ticksToSkip = (1 << (_consecutiveFailures - 1)).clamp(1, 6); + appLogger.d( + 'Progress update failed ($_consecutiveFailures consecutive), ' + 'skipping next $_ticksToSkip tick(s)', + error: e, + ); + }), + ); } // Emit watch state event on stop for UI updates across screens. diff --git a/lib/services/plex_auth_service.dart b/lib/services/plex_auth_service.dart index fc093651..b6589ec6 100644 --- a/lib/services/plex_auth_service.dart +++ b/lib/services/plex_auth_service.dart @@ -462,36 +462,38 @@ class PlexServer { appLogger.d('Running connection race to find first working endpoint', error: {'candidateCount': totalCandidates}); for (final candidate in candidates) { - PlexClient.testConnectionWithLatency( - candidate.url, - accessToken, - timeout: raceTimeout, - clientIdentifier: clientIdentifier, - ).then((result) { - completedTests++; + unawaited( + PlexClient.testConnectionWithLatency( + candidate.url, + accessToken, + timeout: raceTimeout, + clientIdentifier: clientIdentifier, + ).then((result) { + completedTests++; - if (!result.success) { - appLogger.w( - 'Connection candidate failed', - error: { - 'url': candidate.url, - 'type': candidate.connection.displayType, - 'https': candidate.isHttps, - 'error': result.error, - 'latencyMs': result.latencyMs, - }, - ); - } + if (!result.success) { + appLogger.w( + 'Connection candidate failed', + error: { + 'url': candidate.url, + 'type': candidate.connection.displayType, + 'https': candidate.isHttps, + 'error': result.error, + 'latencyMs': result.latencyMs, + }, + ); + } - if (result.success && !completer.isCompleted) { - if (result.transcoderVideo != null) onTranscoderCapability?.call(result.transcoderVideo!); - completer.complete(candidate); - } + if (result.success && !completer.isCompleted) { + if (result.transcoderVideo != null) onTranscoderCapability?.call(result.transcoderVideo!); + completer.complete(candidate); + } - if (completedTests == candidates.length && !completer.isCompleted) { - completer.complete(null); - } - }); + if (completedTests == candidates.length && !completer.isCompleted) { + completer.complete(null); + } + }), + ); } firstCandidate = await completer.future; diff --git a/lib/services/plex_client.dart b/lib/services/plex_client.dart index e5b65fb2..30c9fccb 100644 --- a/lib/services/plex_client.dart +++ b/lib/services/plex_client.dart @@ -922,7 +922,7 @@ class PlexClient { if (streams == null) return (audio: audioTracks, subtitles: subtitleTracks, frameRate: frameRate); - for (var stream in streams) { + for (final stream in streams) { final streamType = stream['streamType'] as int?; if (streamType == PlexStreamType.video) { @@ -1382,7 +1382,7 @@ class PlexClient { Map? videoStream; Map? audioStream; - for (var stream in streams) { + for (final stream in streams) { final streamType = stream['streamType'] as int?; if (streamType == PlexStreamType.video && videoStream == null) { videoStream = stream; @@ -2801,13 +2801,13 @@ class PlexClient { : (timeline is Map ? timeline : null); if (op is Map) { - if (op['Metadata'] case [Map firstMetadata, ...]) { - if (firstMetadata['Media'] case [Map firstMedia, ...]) { + if (op['Metadata'] case [final Map firstMetadata, ...]) { + if (firstMetadata['Media'] case [final Map firstMedia, ...]) { final rawBeginsAt = firstMedia['beginsAt']; beginsAt = switch (rawBeginsAt) { - num n => n.toInt(), - String s => int.tryParse(s), + final num n => n.toInt(), + final String s => int.tryParse(s), _ => null, }; @@ -2878,8 +2878,8 @@ class PlexClient { if (firstMedia is Map) { final rawBeginsAt = firstMedia['beginsAt']; beginsAt = switch (rawBeginsAt) { - num n => n.toInt(), - String s => int.tryParse(s), + final num n => n.toInt(), + final String s => int.tryParse(s), _ => null, }; } diff --git a/lib/services/track_manager.dart b/lib/services/track_manager.dart index cffad881..366901ba 100644 --- a/lib/services/track_manager.dart +++ b/lib/services/track_manager.dart @@ -122,7 +122,7 @@ class TrackManager { // play() failed — clear the flag immediately since playbackRestart won't fire appLogger.w('Resume after subtitle load failed, applying track selection directly', error: e); waitingForExternalSubsTrackSelection = false; - applyTrackSelection(); + unawaited(applyTrackSelection()); return; } diff --git a/lib/services/track_selection_service.dart b/lib/services/track_selection_service.dart index a2db3126..ddabaccc 100644 --- a/lib/services/track_selection_service.dart +++ b/lib/services/track_selection_service.dart @@ -418,21 +418,21 @@ class TrackSelectionService { final preferredLanguage = getLanguage(preferred); // Try to match: id, title, and language - for (var track in validTracks) { + for (final track in validTracks) { if (getId(track) == preferredId && getTitle(track) == preferredTitle && getLanguage(track) == preferredLanguage) { return track; } } // Try to match: title and language - for (var track in validTracks) { + for (final track in validTracks) { if (getTitle(track) == preferredTitle && getLanguage(track) == preferredLanguage) { return track; } } // Try to match: language only - for (var track in validTracks) { + for (final track in validTracks) { if (getLanguage(track) == preferredLanguage) { return track; } @@ -490,7 +490,7 @@ class TrackSelectionService { String Function(T) _, String _, ) { - for (var track in tracks) { + for (final track in tracks) { final trackLang = getLanguage(track)?.toLowerCase(); if (trackLang != null && languageVariations.any((lang) => trackLang.startsWith(lang))) { return track; @@ -682,7 +682,7 @@ class TrackSelectionService { appLogger.d( 'Audio: ${selectedAudioTrack.title ?? selectedAudioTrack.language ?? "Track ${selectedAudioTrack.id}"} [${audioResult.priority.name}]', ); - player.selectAudioTrack(selectedAudioTrack); + unawaited(player.selectAudioTrack(selectedAudioTrack)); // Save to Plex if this was user's navigation preference (Priority 1) if (audioResult.priority == TrackSelectionPriority.navigation && onAudioTrackChanged != null) { @@ -697,7 +697,7 @@ class TrackSelectionService { ? 'OFF' : (selectedSubtitleTrack.title ?? selectedSubtitleTrack.language ?? 'Track ${selectedSubtitleTrack.id}'); appLogger.d('Subtitle: $subtitleName [${subtitleResult.priority.name}]'); - player.selectSubtitleTrack(selectedSubtitleTrack); + unawaited(player.selectSubtitleTrack(selectedSubtitleTrack)); // Save to Plex if this was user's navigation preference (Priority 1) if (subtitleResult.priority == TrackSelectionPriority.navigation && onSubtitleTrackChanged != null) { @@ -714,13 +714,13 @@ class TrackSelectionService { appLogger.d( 'Secondary subtitle: ${secondaryMatch.title ?? secondaryMatch.language ?? "Track ${secondaryMatch.id}"}', ); - player.selectSecondarySubtitleTrack(secondaryMatch); + unawaited(player.selectSecondarySubtitleTrack(secondaryMatch)); } } // Apply default playback speed from settings if (defaultPlaybackSpeed != null && defaultPlaybackSpeed != 1.0) { - player.setRate(defaultPlaybackSpeed); + unawaited(player.setRate(defaultPlaybackSpeed)); } } } diff --git a/lib/theme/mono_theme.dart b/lib/theme/mono_theme.dart index 49e2767b..f1d83ed1 100644 --- a/lib/theme/mono_theme.dart +++ b/lib/theme/mono_theme.dart @@ -108,6 +108,7 @@ ThemeData monoTheme({required bool dark, bool oled = false}) { thumbShape: const HandleThumbShape(), trackShape: const GappedTrackShape(), tickMarkShape: const RoundSliderTickMarkShape(tickMarkRadius: 2), + // ignore: deprecated_member_use — opting into the 2024 slider appearance until the default flips year2023: false, ), dividerTheme: DividerThemeData(space: 0, thickness: 1, color: c.outline), diff --git a/lib/utils/json_utils.dart b/lib/utils/json_utils.dart index 12732c0d..ae9f9c27 100644 --- a/lib/utils/json_utils.dart +++ b/lib/utils/json_utils.dart @@ -3,8 +3,8 @@ /// to handle Plex API responses where numeric fields may arrive as strings /// (XML-to-JSON conversion). int? flexibleInt(Object? v) => switch (v) { - num n => n.toInt(), - String s => int.tryParse(s), + final num n => n.toInt(), + final String s => int.tryParse(s), _ => null, }; @@ -12,16 +12,16 @@ int? flexibleInt(Object? v) => switch (v) { /// Returns `false` for `null` or unrecognised values. /// Handles Plex API responses where boolean fields may arrive as integers. bool flexibleBool(Object? v) => switch (v) { - bool b => b, - int n => n == 1, - String s => s == '1', + final bool b => b, + final int n => n == 1, + final String s => s == '1', _ => false, }; /// Parse a value that may be [double], [num], or [String] to [double]. double? flexibleDouble(Object? v) => switch (v) { - num n => n.toDouble(), - String s => double.tryParse(s), + final num n => n.toDouble(), + final String s => double.tryParse(s), _ => null, }; @@ -36,6 +36,6 @@ Object? readStringField(Map json, String key) => json[key]?.toString(); /// Returns `null` when the value is `null`. List? flexibleList(Object? v) => switch (v) { null => null, - List l => l, + final List l => l, _ => [v], }; diff --git a/lib/utils/live_tv_player_navigation.dart b/lib/utils/live_tv_player_navigation.dart index 8b588757..edade64e 100644 --- a/lib/utils/live_tv_player_navigation.dart +++ b/lib/utils/live_tv_player_navigation.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import '../models/livetv_channel.dart'; @@ -43,5 +45,5 @@ Future navigateToLiveTv( reverseTransitionDuration: Duration.zero, ); - navigator.push(route); + unawaited(navigator.push(route)); } diff --git a/lib/watch_together/providers/watch_together_provider.dart b/lib/watch_together/providers/watch_together_provider.dart index 4b2b4224..c11cbc6d 100644 --- a/lib/watch_together/providers/watch_together_provider.dart +++ b/lib/watch_together/providers/watch_together_provider.dart @@ -348,10 +348,10 @@ class WatchTogetherProvider with ChangeNotifier { _syncManager?.announceLeave(); // Clean up subscriptions - _peerConnectedSubscription?.cancel(); - _peerDisconnectedSubscription?.cancel(); - _messageSubscription?.cancel(); - _errorSubscription?.cancel(); + unawaited(_peerConnectedSubscription?.cancel()); + unawaited(_peerDisconnectedSubscription?.cancel()); + unawaited(_messageSubscription?.cancel()); + unawaited(_errorSubscription?.cancel()); _peerConnectedSubscription = null; _peerDisconnectedSubscription = null; diff --git a/lib/watch_together/services/watch_together_peer_service.dart b/lib/watch_together/services/watch_together_peer_service.dart index c4ed1f09..2c51e74a 100644 --- a/lib/watch_together/services/watch_together_peer_service.dart +++ b/lib/watch_together/services/watch_together_peer_service.dart @@ -432,7 +432,7 @@ class WatchTogetherPeerService with KeepaliveMixin { _reconnectTimer = null; stopKeepalive(); - _channelSubscription?.cancel(); + unawaited(_channelSubscription?.cancel()); _channelSubscription = null; try { diff --git a/lib/watch_together/widgets/watch_together_overlay.dart b/lib/watch_together/widgets/watch_together_overlay.dart index 477a7542..53a1fbc5 100644 --- a/lib/watch_together/widgets/watch_together_overlay.dart +++ b/lib/watch_together/widgets/watch_together_overlay.dart @@ -276,7 +276,7 @@ class _SessionMenuSheet extends StatelessWidget { ); if (confirmed) { - provider.leaveSession(); + unawaited(provider.leaveSession()); onLeaveSession?.call(); } } diff --git a/lib/widgets/focusable_list_tile.dart b/lib/widgets/focusable_list_tile.dart index a7f517f3..e6652c6e 100644 --- a/lib/widgets/focusable_list_tile.dart +++ b/lib/widgets/focusable_list_tile.dart @@ -116,7 +116,7 @@ class _FocusableListTileState extends State with FocusableTil final textColor = needsContrastSwap ? Theme.of(context).colorScheme.onError : widget.textColor; final iconColor = needsContrastSwap ? Theme.of(context).colorScheme.onError : widget.iconColor; - Widget tile = MouseRegion( + final Widget tile = MouseRegion( onEnter: widget.hoverColor != null ? (_) => setState(() => _isHoveredOrFocused = true) : null, onExit: widget.hoverColor != null ? (_) => setState(() => _isHoveredOrFocused = false) : null, child: ListTile( diff --git a/lib/widgets/hotkey_recorder.dart b/lib/widgets/hotkey_recorder.dart index 3855991a..e4eadc1e 100644 --- a/lib/widgets/hotkey_recorder.dart +++ b/lib/widgets/hotkey_recorder.dart @@ -37,7 +37,7 @@ class _HotKeyRecorderState extends State { final PhysicalKeyboardKey key = keyEvent.physicalKey; // Detect which modifiers are currently held down, excluding the primary key - List modifiers = HotKeyModifier.values + final List modifiers = HotKeyModifier.values .where((m) => m.physicalKeys.any(physicalKeysPressed.contains)) .where((m) => !m.physicalKeys.contains(key)) .toList(); diff --git a/lib/widgets/server_activities_button.dart b/lib/widgets/server_activities_button.dart index 1b5407c2..d280549c 100644 --- a/lib/widgets/server_activities_button.dart +++ b/lib/widgets/server_activities_button.dart @@ -143,7 +143,7 @@ class _ServerActivitiesButtonState extends State { _pollTimer?.cancel(); _pollTimer = null; _panelNotifier.value = _PanelData.loading; - _fetchActivities(); + unawaited(_fetchActivities()); } Widget _buildOverlay(BuildContext overlayContext, {required double right, required double top}) { diff --git a/lib/widgets/video_controls/helpers/track_filter_helper.dart b/lib/widgets/video_controls/helpers/track_filter_helper.dart index d04686f5..5013aad0 100644 --- a/lib/widgets/video_controls/helpers/track_filter_helper.dart +++ b/lib/widgets/video_controls/helpers/track_filter_helper.dart @@ -26,8 +26,8 @@ class TrackFilterHelper { static bool _isAllowedTrack(T track) { final id = switch (track) { - AudioTrack t => t.id, - SubtitleTrack t => t.id, + final AudioTrack t => t.id, + final SubtitleTrack t => t.id, _ => '', }; diff --git a/lib/widgets/video_controls/sheets/video_settings_sheet.dart b/lib/widgets/video_controls/sheets/video_settings_sheet.dart index 7ec6fa9e..5eaef2e8 100644 --- a/lib/widgets/video_controls/sheets/video_settings_sheet.dart +++ b/lib/widgets/video_controls/sheets/video_settings_sheet.dart @@ -559,7 +559,7 @@ class _VideoSettingsSheetState extends State { title: Text(label, style: TextStyle(color: isSelected ? primary : null)), trailing: isSelected ? AppIcon(Symbols.check_rounded, fill: 1, color: primary) : null, onTap: () async { - widget.player.setRate(speed); + await widget.player.setRate(speed); // Save as default playback speed final settings = await SettingsService.getInstance(); await settings.write(SettingsService.defaultPlaybackSpeed, speed); diff --git a/lib/widgets/video_controls/video_controls.dart b/lib/widgets/video_controls/video_controls.dart index 05da552c..d68867c0 100644 --- a/lib/widgets/video_controls/video_controls.dart +++ b/lib/widgets/video_controls/video_controls.dart @@ -669,9 +669,11 @@ class _PlexVideoControlsState extends State with WindowListen // Apply rotation lock setting if (_isRotationLocked) { - SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]); + unawaited( + SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]), + ); } else { - SystemChrome.setPreferredOrientations(DeviceOrientation.values); + unawaited(SystemChrome.setPreferredOrientations(DeviceOrientation.values)); } } } @@ -994,10 +996,10 @@ class _PlexVideoControlsState extends State with WindowListen if (_isRotationLocked) { // Locked: Allow landscape orientations only - SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]); + await SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]); } else { // Unlocked: Allow all orientations including portrait - SystemChrome.setPreferredOrientations(DeviceOrientation.values); + await SystemChrome.setPreferredOrientations(DeviceOrientation.values); } } @@ -1139,7 +1141,7 @@ class _PlexVideoControlsState extends State with WindowListen if (metadataJson != null) { // Parse chapters if (metadataJson['Chapter'] != null) { - for (var chapter in metadataJson['Chapter'] as List) { + for (final chapter in metadataJson['Chapter'] as List) { chapters.add( PlexChapter( id: chapter['id'] as int, @@ -1155,7 +1157,7 @@ class _PlexVideoControlsState extends State with WindowListen // Parse markers if (metadataJson['Marker'] != null) { - for (var marker in metadataJson['Marker'] as List) { + for (final marker in metadataJson['Marker'] as List) { markers.add( PlexMarker( id: marker['id'] as int, @@ -2611,19 +2613,21 @@ class _PlexVideoControlsState extends State with WindowListen // Navigate to new player screen with the updated selection // Use PageRouteBuilder with zero-duration transitions to prevent orientation reset if (mounted) { - Navigator.pushReplacement( - context, - PageRouteBuilder( - pageBuilder: (context, animation, secondaryAnimation) => VideoPlayerScreen( - metadata: widget.metadata.copyWith(viewOffset: currentPosition.inMilliseconds), - selectedMediaIndex: effectiveMediaIndex, - selectedQualityPreset: effectivePreset, - selectedAudioStreamId: effectiveAudioStreamId, - reusedSessionIdentifier: sessionId, - reusedTranscodeSessionId: transcodeSessionId, + unawaited( + Navigator.pushReplacement( + context, + PageRouteBuilder( + pageBuilder: (context, animation, secondaryAnimation) => VideoPlayerScreen( + metadata: widget.metadata.copyWith(viewOffset: currentPosition.inMilliseconds), + selectedMediaIndex: effectiveMediaIndex, + selectedQualityPreset: effectivePreset, + selectedAudioStreamId: effectiveAudioStreamId, + reusedSessionIdentifier: sessionId, + reusedTranscodeSessionId: transcodeSessionId, + ), + transitionDuration: Duration.zero, + reverseTransitionDuration: Duration.zero, ), - transitionDuration: Duration.zero, - reverseTransitionDuration: Duration.zero, ), ); } diff --git a/lib/widgets/video_controls/widgets/video_controls_header.dart b/lib/widgets/video_controls/widgets/video_controls_header.dart index e63f56ef..9d8a30c2 100644 --- a/lib/widgets/video_controls/widgets/video_controls_header.dart +++ b/lib/widgets/video_controls/widgets/video_controls_header.dart @@ -67,7 +67,7 @@ class VideoControlsHeader extends StatelessWidget { final seriesName = metadata.grandparentTitle ?? metadata.title!; final hasEpisodeInfo = metadata.parentIndex != null && metadata.index != null; - List parts = [seriesName]; + final List parts = [seriesName]; if (hasEpisodeInfo) { parts.add('S${metadata.parentIndex}E${metadata.index}'); @@ -83,7 +83,7 @@ class VideoControlsHeader extends StatelessWidget { } Widget _buildMultiLineTitle() { - List secondLineParts = []; + final List secondLineParts = []; if (metadata.parentIndex != null && metadata.index != null) { secondLineParts.add('S${metadata.parentIndex}'); diff --git a/lib/widgets/video_controls/widgets/volume_control.dart b/lib/widgets/video_controls/widgets/volume_control.dart index efd4bb5a..fc9df972 100644 --- a/lib/widgets/video_controls/widgets/volume_control.dart +++ b/lib/widgets/video_controls/widgets/volume_control.dart @@ -87,7 +87,7 @@ class _VolumeControlState extends State { Future _adjustVolume(double delta) async { final currentVolume = widget.player.state.volume; final newVolume = (currentVolume + delta).clamp(0.0, _maxVolume.toDouble()); - widget.player.setVolume(newVolume); + await widget.player.setVolume(newVolume); final settings = await SettingsService.getInstance(); await settings.write(SettingsService.volume, newVolume); } @@ -168,7 +168,7 @@ class _VolumeControlState extends State { ), onPressed: () async { final newVolume = isMuted ? 100.0 : 0.0; - widget.player.setVolume(newVolume); + await widget.player.setVolume(newVolume); final settings = await SettingsService.getInstance(); await settings.write(SettingsService.volume, newVolume); },