@@ -99,10 +99,11 @@ public async override void GetSpecialProperties()
99
99
}
100
100
}
101
101
102
+ string folderPath = ( Item as ShortcutItem ) ? . TargetPath ?? Item . ItemPath ;
102
103
BaseStorageFolder storageFolder ;
103
104
try
104
105
{
105
- storageFolder = await AppInstance . FilesystemViewModel . GetFolderFromPathAsync ( ( Item as ShortcutItem ) ? . TargetPath ?? Item . ItemPath ) ;
106
+ storageFolder = await AppInstance . FilesystemViewModel . GetFolderFromPathAsync ( folderPath ) ;
106
107
}
107
108
catch ( Exception ex )
108
109
{
@@ -120,7 +121,7 @@ public async override void GetSpecialProperties()
120
121
{
121
122
GetOtherProperties ( storageFolder . Properties ) ;
122
123
}
123
- GetFolderSize ( storageFolder , TokenSource . Token ) ;
124
+ GetFolderSize ( storageFolder . Path , TokenSource . Token ) ;
124
125
}
125
126
else if ( Item . ItemPath . Equals ( CommonPaths . RecycleBinPath , StringComparison . OrdinalIgnoreCase ) )
126
127
{
@@ -162,11 +163,15 @@ public async override void GetSpecialProperties()
162
163
}
163
164
}
164
165
}
166
+ else
167
+ {
168
+ GetFolderSize ( folderPath , TokenSource . Token ) ;
169
+ }
165
170
}
166
171
167
- private async void GetFolderSize ( BaseStorageFolder storageFolder , CancellationToken token )
172
+ private async void GetFolderSize ( string folderPath , CancellationToken token )
168
173
{
169
- if ( string . IsNullOrEmpty ( storageFolder . Path ) )
174
+ if ( string . IsNullOrEmpty ( folderPath ) )
170
175
{
171
176
// In MTP devices calculating folder size would be too slow
172
177
// Also should use StorageFolder methods instead of FindFirstFileExFromApp
@@ -178,7 +183,7 @@ private async void GetFolderSize(BaseStorageFolder storageFolder, CancellationTo
178
183
179
184
var fileSizeTask = Task . Run ( async ( ) =>
180
185
{
181
- var size = await CalculateFolderSizeAsync ( storageFolder . Path , token ) ;
186
+ var size = await CalculateFolderSizeAsync ( folderPath , token ) ;
182
187
return size ;
183
188
} ) ;
184
189
try
0 commit comments