feat(mobile): deep links (#19232)
* add deep linking on ios app * add deeplinking to android * code review fixes * lint * cleanly handle malformed URIs when launching app * refactor deep link builder/service, still have bug with navigation stack not containing TabControllerRoute * fix: tab controller insertion conditions * add my.immich.app app linking * chore: remove one-liner if statement --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -59,4 +59,34 @@ class MemoryService {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<Memory?> getMemoryById(String id) async {
|
||||
try {
|
||||
final memoryResponse = await _apiService.memoriesApi.getMemory(id);
|
||||
|
||||
if (memoryResponse == null) {
|
||||
return null;
|
||||
}
|
||||
final dbAssets = await _assetRepository
|
||||
.getAllByRemoteId(memoryResponse.assets.map((e) => e.id));
|
||||
if (dbAssets.isEmpty) {
|
||||
log.warning("No assets found for memory with ID: $id");
|
||||
return null;
|
||||
}
|
||||
final yearsAgo = DateTime.now().year - memoryResponse.data.year;
|
||||
final String title = 'years_ago'.t(
|
||||
args: {
|
||||
'years': yearsAgo.toString(),
|
||||
},
|
||||
);
|
||||
|
||||
return Memory(
|
||||
title: title,
|
||||
assets: dbAssets,
|
||||
);
|
||||
} catch (error, stack) {
|
||||
log.severe("Cannot get memory with ID: $id", error, stack);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user