diff --git a/lib/database/app_database.g.dart b/lib/database/app_database.g.dart index dbc6e117..28e81134 100644 --- a/lib/database/app_database.g.dart +++ b/lib/database/app_database.g.dart @@ -3,7 +3,8 @@ 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; @@ -17,9 +18,13 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); + static const VerificationMeta _serverIdMeta = const VerificationMeta( + 'serverId', ); - static const VerificationMeta _serverIdMeta = const VerificationMeta('serverId'); @override late final GeneratedColumn serverId = GeneratedColumn( 'server_id', @@ -28,7 +33,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -37,7 +44,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -56,7 +65,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -65,15 +76,17 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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( @@ -83,7 +96,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -93,7 +108,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -102,7 +119,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -112,7 +131,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -121,7 +142,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -130,7 +153,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -139,7 +164,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -148,7 +175,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -158,7 +187,9 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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', @@ -193,81 +224,138 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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), + ); } return context; } @@ -278,11 +366,26 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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'], @@ -291,16 +394,46 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe 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']), + 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'], + ), ); } @@ -310,7 +443,8 @@ class $DownloadedMediaTable extends DownloadedMedia with TableInfo<$DownloadedMe } } -class DownloadedMediaItem extends DataClass implements Insertable { +class DownloadedMediaItem extends DataClass + implements Insertable { final int id; final String serverId; final String ratingKey; @@ -393,24 +527,41 @@ class DownloadedMediaItem extends DataClass implements Insertable json, {ValueSerializer? serializer}) { + factory DownloadedMediaItem.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return DownloadedMediaItem( id: serializer.fromJson(json['id']), @@ -419,7 +570,9 @@ class DownloadedMediaItem extends DataClass implements Insertable(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']), @@ -480,13 +633,19 @@ class DownloadedMediaItem extends DataClass implements Insertable { 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, @@ -746,7 +920,9 @@ 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); @@ -806,7 +982,8 @@ 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; @@ -820,9 +997,13 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); + static const VerificationMeta _mediaGlobalKeyMeta = const VerificationMeta( + 'mediaGlobalKey', ); - static const VerificationMeta _mediaGlobalKeyMeta = const VerificationMeta('mediaGlobalKey'); @override late final GeneratedColumn mediaGlobalKey = GeneratedColumn( 'media_global_key', @@ -832,7 +1013,9 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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', @@ -842,7 +1025,9 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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', @@ -851,7 +1036,9 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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', @@ -859,10 +1046,14 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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', @@ -870,18 +1061,30 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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')) { @@ -890,29 +1093,44 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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; @@ -924,13 +1142,22 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab 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'], @@ -948,7 +1175,8 @@ class $DownloadQueueTable extends DownloadQueue with TableInfo<$DownloadQueueTab } } -class DownloadQueueItem extends DataClass implements Insertable { +class DownloadQueueItem extends DataClass + implements Insertable { final int id; final String mediaGlobalKey; final int priority; @@ -986,7 +1214,10 @@ class DownloadQueueItem extends DataClass implements Insertable json, {ValueSerializer? serializer}) { + factory DownloadQueueItem.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return DownloadQueueItem( id: serializer.fromJson(json['id']), @@ -1028,11 +1259,17 @@ class DownloadQueueItem extends DataClass implements Insertable 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) || @@ -1161,12 +1405,15 @@ 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', @@ -1192,10 +1439,14 @@ class $ApiCacheTable extends ApiCache with TableInfo<$ApiCacheTable, ApiCacheDat 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', @@ -1213,24 +1464,39 @@ class $ApiCacheTable extends ApiCache with TableInfo<$ApiCacheTable, ApiCacheDat 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; } @@ -1241,10 +1507,22 @@ class $ApiCacheTable extends ApiCache with TableInfo<$ApiCacheTable, ApiCacheDat 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'], + )!, ); } @@ -1266,7 +1544,12 @@ 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 = {}; @@ -1286,7 +1569,10 @@ 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']), @@ -1306,7 +1592,12 @@ 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, @@ -1446,9 +1737,13 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress hasAutoIncrement: true, type: DriftSqlType.int, requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); + static const VerificationMeta _serverIdMeta = const VerificationMeta( + 'serverId', ); - static const VerificationMeta _serverIdMeta = const VerificationMeta('serverId'); @override late final GeneratedColumn serverId = GeneratedColumn( 'server_id', @@ -1457,7 +1752,9 @@ 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', @@ -1466,7 +1763,9 @@ 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', @@ -1475,7 +1774,9 @@ 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', @@ -1484,7 +1785,9 @@ 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', @@ -1493,7 +1796,9 @@ 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', @@ -1502,7 +1807,9 @@ 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', @@ -1510,10 +1817,14 @@ 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', @@ -1522,7 +1833,9 @@ 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', @@ -1531,7 +1844,9 @@ 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', @@ -1541,7 +1856,9 @@ 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', @@ -1571,59 +1888,98 @@ 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; } @@ -1631,24 +1987,60 @@ 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'], + ), ); } @@ -1658,7 +2050,8 @@ class $OfflineWatchProgressTable extends OfflineWatchProgress } } -class OfflineWatchProgressItem extends DataClass implements Insertable { +class OfflineWatchProgressItem extends DataClass + implements Insertable { /// Auto-incrementing primary key final int id; @@ -1740,17 +2133,26 @@ class OfflineWatchProgressItem extends DataClass implements Insertable json, {ValueSerializer? serializer}) { + factory OfflineWatchProgressItem.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return OfflineWatchProgressItem( id: serializer.fromJson(json['id']), @@ -1813,19 +2215,29 @@ class OfflineWatchProgressItem extends DataClass implements Insertable { +class OfflineWatchProgressCompanion + extends UpdateCompanion { final Value id; final Value serverId; final Value ratingKey; @@ -2053,14 +2466,23 @@ class OfflineWatchProgressCompanion extends UpdateCompanion $AppDatabaseManager(this); - late final $DownloadedMediaTable downloadedMedia = $DownloadedMediaTable(this); + late final $DownloadedMediaTable downloadedMedia = $DownloadedMediaTable( + this, + ); late final $DownloadQueueTable downloadQueue = $DownloadQueueTable(this); late final $ApiCacheTable apiCache = $ApiCacheTable(this); - late final $OfflineWatchProgressTable offlineWatchProgress = $OfflineWatchProgressTable(this); + late final $OfflineWatchProgressTable offlineWatchProgress = + $OfflineWatchProgressTable(this); @override - Iterable> get allTables => allSchemaEntities.whereType>(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override - List get allSchemaEntities => [downloadedMedia, downloadQueue, apiCache, offlineWatchProgress]; + List get allSchemaEntities => [ + downloadedMedia, + downloadQueue, + apiCache, + offlineWatchProgress, + ]; } typedef $$DownloadedMediaTableCreateCompanionBuilder = @@ -2104,7 +2526,8 @@ typedef $$DownloadedMediaTableUpdateCompanionBuilder = Value bgTaskId, }); -class $$DownloadedMediaTableFilterComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableFilterComposer + extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableFilterComposer({ required super.$db, required super.$table, @@ -2112,57 +2535,94 @@ class $$DownloadedMediaTableFilterComposer extends Composer<_$AppDatabase, $Down 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), + ); } -class $$DownloadedMediaTableOrderingComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableOrderingComposer + extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableOrderingComposer({ required super.$db, required super.$table, @@ -2170,58 +2630,94 @@ class $$DownloadedMediaTableOrderingComposer extends Composer<_$AppDatabase, $Do 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), + ); } -class $$DownloadedMediaTableAnnotationComposer extends Composer<_$AppDatabase, $DownloadedMediaTable> { +class $$DownloadedMediaTableAnnotationComposer + extends Composer<_$AppDatabase, $DownloadedMediaTable> { $$DownloadedMediaTableAnnotationComposer({ required super.$db, required super.$table, @@ -2229,44 +2725,72 @@ class $$DownloadedMediaTableAnnotationComposer extends Composer<_$AppDatabase, $ 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); } class $$DownloadedMediaTableTableManager @@ -2280,18 +2804,30 @@ 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(), @@ -2368,7 +2904,9 @@ class $$DownloadedMediaTableTableManager retryCount: retryCount, bgTaskId: bgTaskId, ), - 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, ), ); @@ -2384,7 +2922,14 @@ typedef $$DownloadedMediaTableProcessedTableManager = $$DownloadedMediaTableAnnotationComposer, $$DownloadedMediaTableCreateCompanionBuilder, $$DownloadedMediaTableUpdateCompanionBuilder, - (DownloadedMediaItem, BaseReferences<_$AppDatabase, $DownloadedMediaTable, DownloadedMediaItem>), + ( + DownloadedMediaItem, + BaseReferences< + _$AppDatabase, + $DownloadedMediaTable, + DownloadedMediaItem + >, + ), DownloadedMediaItem, PrefetchHooks Function() >; @@ -2407,7 +2952,8 @@ typedef $$DownloadQueueTableUpdateCompanionBuilder = Value downloadArtwork, }); -class $$DownloadQueueTableFilterComposer extends Composer<_$AppDatabase, $DownloadQueueTable> { +class $$DownloadQueueTableFilterComposer + extends Composer<_$AppDatabase, $DownloadQueueTable> { $$DownloadQueueTableFilterComposer({ required super.$db, required super.$table, @@ -2415,25 +2961,39 @@ class $$DownloadQueueTableFilterComposer extends Composer<_$AppDatabase, $Downlo 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, @@ -2441,25 +3001,39 @@ class $$DownloadQueueTableOrderingComposer extends Composer<_$AppDatabase, $Down 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, @@ -2467,20 +3041,29 @@ class $$DownloadQueueTableAnnotationComposer extends Composer<_$AppDatabase, $Do 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 @@ -2494,7 +3077,14 @@ class $$DownloadQueueTableTableManager $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), + ( + DownloadQueueItem, + BaseReferences< + _$AppDatabase, + $DownloadQueueTable, + DownloadQueueItem + >, + ), DownloadQueueItem, PrefetchHooks Function() > { @@ -2503,9 +3093,12 @@ 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(), @@ -2538,7 +3131,9 @@ 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, ), ); @@ -2554,7 +3149,10 @@ typedef $$DownloadQueueTableProcessedTableManager = $$DownloadQueueTableAnnotationComposer, $$DownloadQueueTableCreateCompanionBuilder, $$DownloadQueueTableUpdateCompanionBuilder, - (DownloadQueueItem, BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>), + ( + DownloadQueueItem, + BaseReferences<_$AppDatabase, $DownloadQueueTable, DownloadQueueItem>, + ), DownloadQueueItem, PrefetchHooks Function() >; @@ -2575,7 +3173,8 @@ typedef $$ApiCacheTableUpdateCompanionBuilder = Value rowid, }); -class $$ApiCacheTableFilterComposer extends Composer<_$AppDatabase, $ApiCacheTable> { +class $$ApiCacheTableFilterComposer + extends Composer<_$AppDatabase, $ApiCacheTable> { $$ApiCacheTableFilterComposer({ required super.$db, required super.$table, @@ -2583,19 +3182,29 @@ class $$ApiCacheTableFilterComposer extends Composer<_$AppDatabase, $ApiCacheTab 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, @@ -2603,20 +3212,29 @@ class $$ApiCacheTableOrderingComposer extends Composer<_$AppDatabase, $ApiCacheT 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, @@ -2624,13 +3242,17 @@ class $$ApiCacheTableAnnotationComposer extends Composer<_$AppDatabase, $ApiCach 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 @@ -2644,7 +3266,10 @@ class $$ApiCacheTableTableManager $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), + ( + ApiCacheData, + BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, + ), ApiCacheData, PrefetchHooks Function() > { @@ -2653,9 +3278,12 @@ 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(), @@ -2663,7 +3291,13 @@ 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, @@ -2678,7 +3312,9 @@ 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, ), ); @@ -2694,7 +3330,10 @@ typedef $$ApiCacheTableProcessedTableManager = $$ApiCacheTableAnnotationComposer, $$ApiCacheTableCreateCompanionBuilder, $$ApiCacheTableUpdateCompanionBuilder, - (ApiCacheData, BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>), + ( + ApiCacheData, + BaseReferences<_$AppDatabase, $ApiCacheTable, ApiCacheData>, + ), ApiCacheData, PrefetchHooks Function() >; @@ -2729,7 +3368,8 @@ typedef $$OfflineWatchProgressTableUpdateCompanionBuilder = Value lastError, }); -class $$OfflineWatchProgressTableFilterComposer extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { +class $$OfflineWatchProgressTableFilterComposer + extends Composer<_$AppDatabase, $OfflineWatchProgressTable> { $$OfflineWatchProgressTableFilterComposer({ required super.$db, required super.$table, @@ -2737,43 +3377,69 @@ class $$OfflineWatchProgressTableFilterComposer extends Composer<_$AppDatabase, 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, @@ -2781,43 +3447,69 @@ class $$OfflineWatchProgressTableOrderingComposer extends Composer<_$AppDatabase 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, @@ -2825,30 +3517,49 @@ class $$OfflineWatchProgressTableAnnotationComposer extends Composer<_$AppDataba 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 @@ -2864,19 +3575,34 @@ 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(), @@ -2933,7 +3659,9 @@ 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, ), ); @@ -2949,7 +3677,14 @@ typedef $$OfflineWatchProgressTableProcessedTableManager = $$OfflineWatchProgressTableAnnotationComposer, $$OfflineWatchProgressTableCreateCompanionBuilder, $$OfflineWatchProgressTableUpdateCompanionBuilder, - (OfflineWatchProgressItem, BaseReferences<_$AppDatabase, $OfflineWatchProgressTable, OfflineWatchProgressItem>), + ( + OfflineWatchProgressItem, + BaseReferences< + _$AppDatabase, + $OfflineWatchProgressTable, + OfflineWatchProgressItem + >, + ), OfflineWatchProgressItem, PrefetchHooks Function() >; @@ -2959,8 +3694,10 @@ class $AppDatabaseManager { $AppDatabaseManager(this._db); $$DownloadedMediaTableTableManager get downloadedMedia => $$DownloadedMediaTableTableManager(_db, _db.downloadedMedia); - $$DownloadQueueTableTableManager get downloadQueue => $$DownloadQueueTableTableManager(_db, _db.downloadQueue); - $$ApiCacheTableTableManager get apiCache => $$ApiCacheTableTableManager(_db, _db.apiCache); + $$DownloadQueueTableTableManager get downloadQueue => + $$DownloadQueueTableTableManager(_db, _db.downloadQueue); + $$ApiCacheTableTableManager get apiCache => + $$ApiCacheTableTableManager(_db, _db.apiCache); $$OfflineWatchProgressTableTableManager get offlineWatchProgress => $$OfflineWatchProgressTableTableManager(_db, _db.offlineWatchProgress); } diff --git a/lib/i18n/strings.g.dart b/lib/i18n/strings.g.dart index fbfa1b18..0e4eb171 100644 --- a/lib/i18n/strings.g.dart +++ b/lib/i18n/strings.g.dart @@ -6,7 +6,7 @@ /// Locales: 15 /// Strings: 12105 (807 per locale) /// -/// Built on 2026-03-10 at 00:19 UTC +/// Built on 2026-03-11 at 02:00 UTC // coverage:ignore-file // ignore_for_file: type=lint, unused_import diff --git a/lib/models/companion_remote/remote_session.g.dart b/lib/models/companion_remote/remote_session.g.dart index 00ae33c2..113f6e99 100644 --- a/lib/models/companion_remote/remote_session.g.dart +++ b/lib/models/companion_remote/remote_session.g.dart @@ -10,47 +10,65 @@ 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)), -); - -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( - sessionId: json['sessionId'] as String, - pin: json['pin'] as String, - role: $enumDecode(_$RemoteSessionRoleEnumMap, json['role'], unknownValue: RemoteSessionRole.remote), - status: - $enumDecodeNullable( - _$RemoteSessionStatusEnumMap, - json['status'], - unknownValue: RemoteSessionStatus.disconnected, - ) ?? - RemoteSessionStatus.disconnected, - connectedDevice: json['connectedDevice'] == null + connectedAt: json['connectedAt'] == null ? null - : RemoteDevice.fromJson(json['connectedDevice'] as Map), - createdAt: json['createdAt'] == null ? null : DateTime.parse(json['createdAt'] as String), - errorMessage: json['errorMessage'] as String?, + : DateTime.parse(json['connectedAt'] as String), + capabilities: (json['capabilities'] as Map?)?.map( + (k, e) => MapEntry(k, e as bool), + ), ); -Map _$RemoteSessionToJson(RemoteSession instance) => { - 'sessionId': instance.sessionId, - 'pin': instance.pin, - 'role': _$RemoteSessionRoleEnumMap[instance.role]!, - 'status': _$RemoteSessionStatusEnumMap[instance.status]!, - 'connectedDevice': instance.connectedDevice, - 'createdAt': instance.createdAt.toIso8601String(), - 'errorMessage': instance.errorMessage, -}; +Map _$RemoteDeviceToJson(RemoteDevice instance) => + { + 'id': instance.id, + 'name': instance.name, + 'platform': instance.platform, + 'connectedAt': instance.connectedAt.toIso8601String(), + 'capabilities': instance.capabilities, + }; -const _$RemoteSessionRoleEnumMap = {RemoteSessionRole.host: 'host', RemoteSessionRole.remote: 'remote'}; +RemoteSession _$RemoteSessionFromJson(Map json) => + RemoteSession( + sessionId: json['sessionId'] as String, + pin: json['pin'] as String, + 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) => + { + 'sessionId': instance.sessionId, + 'pin': instance.pin, + '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', diff --git a/lib/models/play_queue_response.g.dart b/lib/models/play_queue_response.g.dart index 7a197697..8f8e3aa9 100644 --- a/lib/models/play_queue_response.g.dart +++ b/lib/models/play_queue_response.g.dart @@ -6,15 +6,23 @@ part of 'play_queue_response.dart'; // JsonSerializableGenerator // ************************************************************************** -PlayQueueResponse _$PlayQueueResponseFromJson(Map json) => PlayQueueResponse( - playQueueID: (json['playQueueID'] as num).toInt(), - playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?)?.toInt(), - playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?)?.toInt(), - playQueueSelectedMetadataItemID: json['playQueueSelectedMetadataItemID'] as String?, - playQueueShuffled: const BoolOrIntConverter().fromJson(json['playQueueShuffled'] as Object), - playQueueSourceURI: json['playQueueSourceURI'] as String?, - playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(), - playQueueVersion: (json['playQueueVersion'] as num).toInt(), - size: (json['size'] as num?)?.toInt(), - items: (json['Metadata'] as List?)?.map((e) => PlexMetadata.fromJson(e as Map)).toList(), -); +PlayQueueResponse _$PlayQueueResponseFromJson(Map json) => + PlayQueueResponse( + playQueueID: (json['playQueueID'] as num).toInt(), + playQueueSelectedItemID: (json['playQueueSelectedItemID'] as num?) + ?.toInt(), + playQueueSelectedItemOffset: (json['playQueueSelectedItemOffset'] as num?) + ?.toInt(), + playQueueSelectedMetadataItemID: + json['playQueueSelectedMetadataItemID'] as String?, + playQueueShuffled: const BoolOrIntConverter().fromJson( + json['playQueueShuffled'] as Object, + ), + playQueueSourceURI: json['playQueueSourceURI'] as String?, + playQueueTotalCount: (json['playQueueTotalCount'] as num?)?.toInt(), + playQueueVersion: (json['playQueueVersion'] as num).toInt(), + size: (json['size'] as num?)?.toInt(), + items: (json['Metadata'] as List?) + ?.map((e) => PlexMetadata.fromJson(e as Map)) + .toList(), + ); diff --git a/lib/models/plex_library.g.dart b/lib/models/plex_library.g.dart index cbca367d..78565719 100644 --- a/lib/models/plex_library.g.dart +++ b/lib/models/plex_library.g.dart @@ -19,15 +19,16 @@ 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 872193ec..5ea3f2cc 100644 --- a/lib/models/plex_metadata.dart +++ b/lib/models/plex_metadata.dart @@ -9,6 +9,12 @@ import '../utils/global_key_utils.dart'; part 'plex_metadata.g.dart'; +int? _flexibleInt(Object? v) => switch (v) { + num n => n.toInt(), + String s => int.tryParse(s), + _ => null, + }; + /// Media type enum for type-safe media type handling enum PlexMediaType { movie, @@ -85,11 +91,13 @@ class PlexMetadata with MultiServerFields { final int? viewCount; final int? leafCount; // Total number of episodes in a series/season final int? viewedLeafCount; // Number of watched episodes in a series/season + @JsonKey(fromJson: _flexibleInt) final int? childCount; // Number of items in a collection or playlist @JsonKey(name: 'Role') final List? role; // Cast members final String? audioLanguage; // Per-media preferred audio language final String? subtitleLanguage; // Per-media preferred subtitle language + @JsonKey(fromJson: _flexibleInt) final int? subtitleMode; // Per-media subtitle mode (0=manual, 1=foreign audio, 2=always, -1=account default) final int? playlistItemID; // Playlist item ID (for dumb playlists only) final int? playQueueItemID; // Play queue item ID (unique even for duplicates) @@ -458,10 +466,6 @@ class PlexMetadata with MultiServerFields { } factory PlexMetadata.fromJson(Map json) { - // Plex API returns subtitleMode as a string - if (json['subtitleMode'] is String) { - json = {...json, 'subtitleMode': num.tryParse(json['subtitleMode'] as String)}; - } try { return _$PlexMetadataFromJson(kBlurArtwork ? _obfuscateJson(json) : json); } on TypeError catch (e, st) { diff --git a/lib/models/plex_metadata.g.dart b/lib/models/plex_metadata.g.dart index d6d1406f..36464546 100644 --- a/lib/models/plex_metadata.g.dart +++ b/lib/models/plex_metadata.g.dart @@ -7,12 +7,12 @@ part of 'plex_metadata.dart'; // ************************************************************************** PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( - ratingKey: json['ratingKey'] as String? ?? '', - key: json['key'] as String? ?? '', + ratingKey: json['ratingKey'] as String, + key: json['key'] as String, guid: json['guid'] as String?, studio: json['studio'] as String?, - type: json['type'] as String? ?? 'folder', - title: json['title'] as String? ?? '', + type: json['type'] as String, + title: json['title'] as String, titleSort: json['titleSort'] as String?, contentRating: json['contentRating'] as String?, summary: json['summary'] as String?, @@ -41,11 +41,13 @@ PlexMetadata _$PlexMetadataFromJson(Map json) => PlexMetadata( viewCount: (json['viewCount'] as num?)?.toInt(), leafCount: (json['leafCount'] as num?)?.toInt(), viewedLeafCount: (json['viewedLeafCount'] as num?)?.toInt(), - childCount: (json['childCount'] as num?)?.toInt(), - role: (json['Role'] as List?)?.map((e) => PlexRole.fromJson(e as Map)).toList(), + childCount: _flexibleInt(json['childCount']), + role: (json['Role'] as List?) + ?.map((e) => PlexRole.fromJson(e as Map)) + .toList(), audioLanguage: json['audioLanguage'] as String?, subtitleLanguage: json['subtitleLanguage'] as String?, - subtitleMode: (json['subtitleMode'] as num?)?.toInt(), + subtitleMode: _flexibleInt(json['subtitleMode']), playlistItemID: (json['playlistItemID'] as num?)?.toInt(), playQueueItemID: (json['playQueueItemID'] as num?)?.toInt(), librarySectionID: (json['librarySectionID'] as num?)?.toInt(), @@ -62,58 +64,59 @@ 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 a21f8f84..96647865 100644 --- a/lib/models/plex_playlist.g.dart +++ b/lib/models/plex_playlist.g.dart @@ -26,22 +26,23 @@ 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/pubspec.lock b/pubspec.lock index 24f15643..c625ce06 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1131,18 +1131,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3" + sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.2.0" source_helper: dependency: transitive description: name: source_helper - sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" url: "https://pub.dev" source: hosted - version: "1.3.7" + version: "1.3.8" source_span: dependency: transitive description: