@@ -50,7 +50,7 @@ private set
5050 ? Visibility . Visible
5151 : Visibility . Collapsed ;
5252
53- public PreviewPanel ( Settings settings , string filePath )
53+ public PreviewPanel ( Settings settings , string filePath , ResultType type )
5454 {
5555 InitializeComponent ( ) ;
5656
@@ -60,17 +60,21 @@ public PreviewPanel(Settings settings, string filePath)
6060
6161 if ( Settings . ShowFileSizeInPreviewPanel )
6262 {
63- FileSize = GetFileSize ( filePath ) ;
63+ FileSize = type == ResultType . File ? GetFileSize ( filePath ) : GetFolderSize ( filePath ) ;
6464 }
6565
6666 if ( Settings . ShowCreatedDateInPreviewPanel )
6767 {
68- CreatedAt = GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
68+ CreatedAt = type == ResultType . File ?
69+ GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) :
70+ GetFolderCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
6971 }
7072
7173 if ( Settings . ShowModifiedDateInPreviewPanel )
7274 {
73- LastModifiedAt = GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
75+ LastModifiedAt = type == ResultType . File ?
76+ GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) :
77+ GetFolderLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
7478 }
7579
7680 _ = LoadImageAsync ( ) ;
@@ -126,7 +130,7 @@ public static string GetFolderSize(string folderPath)
126130 }
127131 catch ( Exception )
128132 {
129- return string . Empty ;
133+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
130134 }
131135 return ResultManager . ToReadableSize ( size , 2 ) ;
132136 }
0 commit comments