Files
immich/mobile/test/fixtures/asset.stub.dart
Luis Nachtigall f4e156494f feat(mobile): add playbackStyle to local asset entity and related database schema (#26596)
* feat: add playbackStyle to local asset entity and related database schema

* implement conversion function for playbackStyle in local sync service

* implement conversion function for playbackStyle in local sync service

* refactor: remove deducedPlaybackStyle from TrashedLocalAssetEntityData

* add playbackStyle column to trashed local asset entity

* make playbackStyle non-nullable across the mobile codebase

* Streamline playbackStyle backfill:
- only backfill local assets playbackStyle in flutter/dart code
- only update trashed local assets in db migration

* bump target database version to 23 and update migration logic for playbackStyle

* set playback_style to 0 in merged_asset.drift as its a getter in base asset

* run make pigeon

* Populate playbackStyle for trashed assets during native migration
2026-03-01 14:50:21 -05:00

81 lines
2.0 KiB
Dart

import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
import 'package:immich_mobile/domain/models/exif.model.dart';
import 'package:immich_mobile/entities/asset.entity.dart' as old;
final class AssetStub {
const AssetStub._();
static final image1 = old.Asset(
checksum: "image1-checksum",
localId: "image1",
remoteId: 'image1-remote',
ownerId: 1,
fileCreatedAt: DateTime(2019),
fileModifiedAt: DateTime(2020),
updatedAt: DateTime.now(),
durationInSeconds: 0,
type: old.AssetType.image,
fileName: "image1.jpg",
isFavorite: true,
isArchived: false,
isTrashed: false,
exifInfo: const ExifInfo(isFlipped: false),
);
static final image2 = old.Asset(
checksum: "image2-checksum",
localId: "image2",
remoteId: 'image2-remote',
ownerId: 1,
fileCreatedAt: DateTime(2000),
fileModifiedAt: DateTime(2010),
updatedAt: DateTime.now(),
durationInSeconds: 60,
type: old.AssetType.video,
fileName: "image2.jpg",
isFavorite: false,
isArchived: false,
isTrashed: false,
exifInfo: const ExifInfo(isFlipped: true),
);
static final image3 = old.Asset(
checksum: "image3-checksum",
localId: "image3",
ownerId: 1,
fileCreatedAt: DateTime(2025),
fileModifiedAt: DateTime(2025),
updatedAt: DateTime.now(),
durationInSeconds: 60,
type: old.AssetType.image,
fileName: "image3.jpg",
isFavorite: true,
isArchived: false,
isTrashed: false,
);
}
abstract final class LocalAssetStub {
const LocalAssetStub._();
static final image1 = LocalAsset(
id: "image1",
name: "image1.jpg",
type: AssetType.image,
createdAt: DateTime(2025),
updatedAt: DateTime(2025, 2),
playbackStyle: AssetPlaybackStyle.image,
isEdited: false,
);
static final image2 = LocalAsset(
id: "image2",
name: "image2.jpg",
type: AssetType.image,
createdAt: DateTime(2000),
updatedAt: DateTime(20021),
playbackStyle: AssetPlaybackStyle.image,
isEdited: false,
);
}