From 24f1281478d8ec0642feabbe49c3facdafb95566 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Wed, 12 Jul 2023 00:24:55 +0800 Subject: [PATCH] Fix fileMetadataSize type of nextcloud album item --- np_api/lib/src/entity/nc_album_item_parser.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/np_api/lib/src/entity/nc_album_item_parser.dart b/np_api/lib/src/entity/nc_album_item_parser.dart index 5873538d..f037a9d2 100644 --- a/np_api/lib/src/entity/nc_album_item_parser.dart +++ b/np_api/lib/src/entity/nc_album_item_parser.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:np_api/src/entity/entity.dart'; import 'package:np_api/src/entity/parser.dart'; import 'package:np_common/log.dart'; -import 'package:np_common/type.dart'; import 'package:xml/xml.dart'; class NcAlbumItemParser extends XmlResponseParser { @@ -25,7 +24,7 @@ class NcAlbumItemParser extends XmlResponseParser { DateTime? lastModified; bool? hasPreview; bool? favorite; - JsonObj? fileMetadataSize; + Object? fileMetadataSize; // unclear what the value types are // "nc:face-detections" // "nc:realpath" @@ -70,7 +69,9 @@ class NcAlbumItemParser extends XmlResponseParser { lastModified: lastModified, hasPreview: hasPreview, favorite: favorite, - fileMetadataSize: fileMetadataSize, + fileMetadataSize: fileMetadataSize is Map + ? fileMetadataSize.cast() + : null, ); } } @@ -119,7 +120,7 @@ class _PropParser { int? get fileId => _fileId; bool? get favorite => _favorite; bool? get hasPreview => _hasPreview; - JsonObj? get fileMetadataSize => _fileMetadataSize; + Object? get fileMetadataSize => _fileMetadataSize; final Map namespaces; @@ -130,7 +131,7 @@ class _PropParser { int? _fileId; bool? _favorite; bool? _hasPreview; - JsonObj? _fileMetadataSize; + Object? _fileMetadataSize; } List _parseNcAlbumItemsIsolate(String response) {