@@ -94,19 +94,24 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(
9494
9595 public override async Task GetSpecialPropertiesAsync ( )
9696 {
97+ // Check if item is on device (not online)
98+ var isOnDevice = Item . SyncStatusUI . SyncStatus is not CloudDriveSyncStatus . FileOnline and not CloudDriveSyncStatus . FolderOnline ;
99+
100+ // Set basic file attributes
97101 ViewModel . IsReadOnly = Win32Helper . HasFileAttribute ( Item . ItemPath , System . IO . FileAttributes . ReadOnly ) ;
98102 ViewModel . IsHidden = Win32Helper . HasFileAttribute ( Item . ItemPath , System . IO . FileAttributes . Hidden ) ;
99103 ViewModel . CanCompressContent = Win32Helper . CanCompressContent ( Item . ItemPath ) ;
100- ViewModel . IsContentCompressed = Win32Helper . HasFileAttribute ( Item . ItemPath , System . IO . FileAttributes . Compressed ) ;
101-
102104 ViewModel . ItemSizeVisibility = true ;
103105 ViewModel . ItemSize = Item . FileSizeBytes . ToLongSizeString ( ) ;
104106
105- // Only load the size for items on the device
106- if ( Item . SyncStatusUI . SyncStatus is not CloudDriveSyncStatus . FileOnline and not CloudDriveSyncStatus . FolderOnline )
107- ViewModel . ItemSizeOnDisk = Win32Helper . GetFileSizeOnDisk ( Item . ItemPath ) ? . ToLongSizeString ( ) ??
108- string . Empty ;
107+ // Only check the compressed attribute and size on disk for items on the device
108+ if ( isOnDevice )
109+ {
110+ ViewModel . IsContentCompressed = Win32Helper . HasFileAttribute ( Item . ItemPath , System . IO . FileAttributes . Compressed ) ;
111+ ViewModel . ItemSizeOnDisk = Win32Helper . GetFileSizeOnDisk ( Item . ItemPath ) ? . ToLongSizeString ( ) ?? string . Empty ;
112+ }
109113
114+ // Load icon
110115 var result = await FileThumbnailHelper . GetIconAsync (
111116 Item . ItemPath ,
112117 Constants . ShellIconSizes . ExtraLarge ,
@@ -120,17 +125,20 @@ public override async Task GetSpecialPropertiesAsync()
120125 ViewModel . LoadFileIcon = true ;
121126 }
122127
128+ // Handle shortcut properties
123129 if ( Item . IsShortcut )
124130 {
125131 ViewModel . ItemCreatedTimestampReal = Item . ItemDateCreatedReal ;
126132 ViewModel . ItemAccessedTimestampReal = Item . ItemDateAccessedReal ;
133+
127134 if ( Item . IsLinkItem || string . IsNullOrWhiteSpace ( ( ( IShortcutItem ) Item ) . TargetPath ) )
128135 {
129136 // Can't show any other property
130137 return ;
131138 }
132139 }
133140
141+ // Get file for further processing
134142 string filePath = ( Item as IShortcutItem ) ? . TargetPath ?? Item . ItemPath ;
135143 BaseStorageFile file = await AppInstance . ShellViewModel . GetFileFromPathAsync ( filePath ) ;
136144
@@ -142,15 +150,18 @@ public override async Task GetSpecialPropertiesAsync()
142150 if ( Item . IsShortcut )
143151 return ;
144152
145- if ( Item . SyncStatusUI . SyncStatus is not CloudDriveSyncStatus . FileOnline and not CloudDriveSyncStatus . FolderOnline )
146- if ( FileExtensionHelpers . IsBrowsableZipFile ( Item . FileExtension , out _ ) )
147- if ( await ZipStorageFolder . FromPathAsync ( Item . ItemPath ) is ZipStorageFolder zipFolder )
148- {
149- var uncompressedSize = await zipFolder . GetUncompressedSize ( ) ;
150- ViewModel . UncompressedItemSize = uncompressedSize . ToLongSizeString ( ) ;
151- ViewModel . UncompressedItemSizeBytes = uncompressedSize ;
152- }
153+ // Load uncompressed size for browsable zip files on device
154+ if ( isOnDevice && FileExtensionHelpers . IsBrowsableZipFile ( Item . FileExtension , out _ ) )
155+ {
156+ if ( await ZipStorageFolder . FromPathAsync ( Item . ItemPath ) is ZipStorageFolder zipFolder )
157+ {
158+ var uncompressedSize = await zipFolder . GetUncompressedSize ( ) ;
159+ ViewModel . UncompressedItemSize = uncompressedSize . ToLongSizeString ( ) ;
160+ ViewModel . UncompressedItemSizeBytes = uncompressedSize ;
161+ }
162+ }
153163
164+ // Get other properties if available
154165 if ( file . Properties is not null )
155166 GetOtherPropertiesAsync ( file . Properties ) ;
156167 }
0 commit comments