diff --git a/app/lib/controller/server_controller.dart b/app/lib/controller/server_controller.dart index 7ff25853..6e0164fc 100644 --- a/app/lib/controller/server_controller.dart +++ b/app/lib/controller/server_controller.dart @@ -13,6 +13,7 @@ part 'server_controller.g.dart'; enum ServerFeature { ncAlbum, + ncMetadata, } @npLog @@ -37,6 +38,9 @@ class ServerController { case ServerFeature.ncAlbum: return !_statusStreamContorller.hasValue || _statusStreamContorller.value.majorVersion >= 25; + case ServerFeature.ncMetadata: + return !_statusStreamContorller.hasValue || + _statusStreamContorller.value.majorVersion >= 28; } } diff --git a/app/lib/widget/home_photos/bloc.dart b/app/lib/widget/home_photos/bloc.dart index c4afe159..6e0da340 100644 --- a/app/lib/widget/home_photos/bloc.dart +++ b/app/lib/widget/home_photos/bloc.dart @@ -13,6 +13,7 @@ class _Bloc extends Bloc<_Event, _State> required this.syncController, required this.personsController, required this.metadataController, + required this.serverController, }) : super(_State.init( zoom: prefController.homePhotosZoomLevelValue, isEnableMemoryCollection: @@ -535,7 +536,11 @@ class _Bloc extends Bloc<_Event, _State> personsController: personsController, personProvider: accountPrefController.personProviderValue, ); - metadataController.kickstart(); + if (!serverController.isSupported(ServerFeature.ncMetadata)) { + metadataController.kickstart(); + } else { + _log.info("[_syncRemote] Skipping metadata service"); + } _log.info( "[_syncRemote] Elapsed time: ${stopwatch.elapsedMilliseconds}ms"); }); @@ -711,6 +716,7 @@ class _Bloc extends Bloc<_Event, _State> final SyncController syncController; final PersonsController personsController; final MetadataController metadataController; + final ServerController serverController; final _itemTransformerQueue = ComputeQueue<_ItemTransformerArgument, _ItemTransformerResult>(); diff --git a/app/lib/widget/home_photos2.dart b/app/lib/widget/home_photos2.dart index 07e3a139..8b569da2 100644 --- a/app/lib/widget/home_photos2.dart +++ b/app/lib/widget/home_photos2.dart @@ -21,6 +21,7 @@ import 'package:nc_photos/controller/files_controller.dart'; import 'package:nc_photos/controller/metadata_controller.dart'; import 'package:nc_photos/controller/persons_controller.dart'; import 'package:nc_photos/controller/pref_controller.dart'; +import 'package:nc_photos/controller/server_controller.dart'; import 'package:nc_photos/controller/sync_controller.dart'; import 'package:nc_photos/db/entity_converter.dart'; import 'package:nc_photos/di_container.dart'; @@ -97,6 +98,7 @@ class HomePhotos2 extends StatelessWidget { syncController: accountController.syncController, personsController: accountController.personsController, metadataController: accountController.metadataController, + serverController: accountController.serverController, ), child: const _WrappedHomePhotos(), );