File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/Files.App/ViewModels/Properties/Items Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ public CombinedFileProperties(
17
17
18
18
public async Task GetSystemFilePropertiesAsync ( )
19
19
{
20
- var queries = await Task . WhenAll ( List . AsParallel ( ) . Select ( async item => {
20
+ var queries = await Task . WhenAll ( List . AsParallel ( ) . Select ( async item =>
21
+ {
21
22
BaseStorageFile file = await FilesystemTasks . Wrap ( ( ) => StorageFileExtensions . DangerousGetFileFromPathAsync ( item . ItemPath ) ) ;
22
23
if ( file is null )
23
24
{
@@ -27,10 +28,13 @@ public async Task GetSystemFilePropertiesAsync()
27
28
28
29
var list = await FileProperty . RetrieveAndInitializePropertiesAsync ( file ) ;
29
30
30
- list . Find ( x => x . ID == "address" ) . Value =
31
- await LocationHelpers . GetAddressFromCoordinatesAsync ( ( double ? ) list . Find (
32
- x => x . Property == "System.GPS.LatitudeDecimal" ) . Value ,
33
- ( double ? ) list . Find ( x => x . Property == "System.GPS.LongitudeDecimal" ) . Value ) ;
31
+ var latitude = list . Find ( x => x . Property == "System.GPS.LatitudeDecimal" ) ? . Value as double ? ;
32
+ var longitude = list . Find ( x => x . Property == "System.GPS.LongitudeDecimal" ) ? . Value as double ? ;
33
+ var addressItem = list . Find ( x => x . ID == "address" ) ;
34
+
35
+ if ( latitude . HasValue && longitude . HasValue && addressItem != null )
36
+ addressItem . Value = await LocationHelpers . GetAddressFromCoordinatesAsync ( latitude . Value , longitude . Value ) ;
37
+
34
38
35
39
return list
36
40
. Where ( fileProp => ! ( fileProp . Value is null && fileProp . IsReadOnly ) )
You can’t perform that action at this time.
0 commit comments