mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(mobile): update casting to new asset viewer (#19994)
* update casting to new asset viewer * handle websocket --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
055b930066
commit
03ff425664
10 changed files with 140 additions and 23 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||
import 'package:immich_mobile/entities/asset.entity.dart' as old_asset_entity;
|
||||
import 'package:immich_mobile/models/cast/cast_manager_state.dart';
|
||||
import 'package:immich_mobile/services/gcast.service.dart';
|
||||
|
||||
|
|
@ -50,10 +51,29 @@ class CastNotifier extends StateNotifier<CastManagerState> {
|
|||
state = state.copyWith(castState: castState);
|
||||
}
|
||||
|
||||
void loadMedia(Asset asset, bool reload) {
|
||||
void loadMedia(RemoteAsset asset, bool reload) {
|
||||
_gCastService.loadMedia(asset, reload);
|
||||
}
|
||||
|
||||
// TODO: remove this when we migrate to new timeline
|
||||
void loadMediaOld(old_asset_entity.Asset asset, bool reload) {
|
||||
final remoteAsset = RemoteAsset(
|
||||
id: asset.remoteId.toString(),
|
||||
name: asset.name,
|
||||
ownerId: asset.ownerId.toString(),
|
||||
checksum: asset.checksum,
|
||||
type: asset.type == old_asset_entity.AssetType.image
|
||||
? AssetType.image
|
||||
: asset.type == old_asset_entity.AssetType.video
|
||||
? AssetType.video
|
||||
: AssetType.other,
|
||||
createdAt: asset.fileCreatedAt,
|
||||
updatedAt: asset.updatedAt,
|
||||
);
|
||||
|
||||
_gCastService.loadMedia(remoteAsset, reload);
|
||||
}
|
||||
|
||||
Future<void> connect(CastDestinationType type, dynamic device) async {
|
||||
switch (type) {
|
||||
case CastDestinationType.googleCast:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue