@@ -50,7 +50,7 @@ private set
50
50
? Visibility . Visible
51
51
: Visibility . Collapsed ;
52
52
53
- public PreviewPanel ( Settings settings , string filePath )
53
+ public PreviewPanel ( Settings settings , string filePath , ResultType type )
54
54
{
55
55
InitializeComponent ( ) ;
56
56
@@ -60,17 +60,21 @@ public PreviewPanel(Settings settings, string filePath)
60
60
61
61
if ( Settings . ShowFileSizeInPreviewPanel )
62
62
{
63
- FileSize = GetFileSize ( filePath ) ;
63
+ FileSize = type == ResultType . File ? GetFileSize ( filePath ) : GetFolderSize ( filePath ) ;
64
64
}
65
65
66
66
if ( Settings . ShowCreatedDateInPreviewPanel )
67
67
{
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 ) ;
69
71
}
70
72
71
73
if ( Settings . ShowModifiedDateInPreviewPanel )
72
74
{
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 ) ;
74
78
}
75
79
76
80
_ = LoadImageAsync ( ) ;
@@ -126,7 +130,7 @@ public static string GetFolderSize(string folderPath)
126
130
}
127
131
catch ( Exception )
128
132
{
129
- return string . Empty ;
133
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
130
134
}
131
135
return ResultManager . ToReadableSize ( size , 2 ) ;
132
136
}
0 commit comments