fix: deep links when using the beta timeline

This commit is contained in:
bwees
2025-07-23 14:29:32 -05:00
parent f27bdf7523
commit 9ed3bbf12f
7 changed files with 211 additions and 35 deletions
@@ -31,6 +31,25 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
return query.map((row) => row.toDto()).get();
}
Future<RemoteAsset?> get(String id) {
final query = _db.remoteAssetEntity.select().addColumns([
_db.localAssetEntity.id,
]).join([
leftOuterJoin(
_db.localAssetEntity,
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
useColumns: false,
),
])
..where(_db.remoteAssetEntity.id.equals(id))
..limit(1);
return query.map((row) {
final asset = row.readTable(_db.remoteAssetEntity).toDto();
return asset.copyWith(localId: row.read(_db.localAssetEntity.id));
}).getSingleOrNull();
}
Stream<RemoteAsset?> watchAsset(String id) {
final query = _db.remoteAssetEntity.select().addColumns([
_db.localAssetEntity.id,