Skip to content

Commit c1f942d

Browse files
committed
Update plugins setting and set metadata to plugin
1 parent 19a3ee8 commit c1f942d

File tree

5 files changed

+40
-19
lines changed

5 files changed

+40
-19
lines changed

Diff for: src/components/config_type.go

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ type ThemeType struct {
3434
// Configuration settings
3535
type ConfigType struct {
3636
Theme string `toml:"theme"`
37+
FooterPanelList []string `toml:"footer_panel_list"`
38+
Metadata bool `toml:"metadata"`
3739
}
3840

3941
type HotkeysType struct {

Diff for: src/components/function.go

+19-10
Original file line numberDiff line numberDiff line change
@@ -449,18 +449,27 @@ func returnMetaData(m model) model {
449449
return m
450450
}
451451

452-
fileInfos := et.ExtractMetadata(filePath)
453-
for _, fileInfo := range fileInfos {
454-
if fileInfo.Err != nil {
455-
outPutLog("Return meta data function error", fileInfo, fileInfo.Err)
456-
continue
457-
}
452+
if Config.Metadata {
453+
fileInfos := et.ExtractMetadata(filePath)
454+
455+
for _, fileInfo := range fileInfos {
456+
if fileInfo.Err != nil {
457+
outPutLog("Return meta data function error", fileInfo, fileInfo.Err)
458+
continue
459+
}
458460

459-
for k, v := range fileInfo.Fields {
460-
temp := [2]string{k, fmt.Sprintf("%v", v)}
461-
m.fileMetaData.metaData = append(m.fileMetaData.metaData, temp)
461+
for k, v := range fileInfo.Fields {
462+
temp := [2]string{k, fmt.Sprintf("%v", v)}
463+
m.fileMetaData.metaData = append(m.fileMetaData.metaData, temp)
464+
}
462465
}
466+
} else {
467+
fileName := [2]string{"FileName", fileInfo.Name()}
468+
fileSize := [2]string{"FileSize", formatFileSize(fileInfo.Size())}
469+
fileModifyData := [2]string{"FileModifyDate", fileInfo.ModTime().String()}
470+
m.fileMetaData.metaData = append(m.fileMetaData.metaData, fileName, fileSize, fileModifyData)
463471
}
472+
464473
channel <- channelMessage{
465474
messageId: id,
466475
loadMetadata: true,
@@ -817,4 +826,4 @@ func generateSearchBar() textinput.Model {
817826
ti.Blur()
818827
ti.CharLimit = 156
819828
return ti
820-
}
829+
}

Diff for: src/main.go

+12-6
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ const (
4949
trashDirectoryInfo string = "/Trash/info"
5050
)
5151

52-
type GitHubRelease struct {
53-
TagName string `json:"tag_name"`
54-
}
55-
5652
func main() {
5753
output := termenv.NewOutput(os.Stdout)
5854
terminalBackgroundColor := output.BackgroundColor()
@@ -223,11 +219,15 @@ func CheckForUpdates() {
223219
return
224220
}
225221

222+
type GitHubRelease struct {
223+
TagName string `json:"tag_name"`
224+
}
225+
226226
var release GitHubRelease
227227
if err := json.Unmarshal(body, &release); err != nil {
228228
return
229229
}
230-
230+
231231
if versionToNumber(release.TagName) > versionToNumber(currentVersion) {
232232
fmt.Printf("A new version %s is available.\n", release.TagName)
233233
fmt.Printf("Please update.\n\n\n %s\n\n", latestVersionGithub)
@@ -391,4 +391,10 @@ const configTomlString string = `# change your theme
391391
theme = "gruvbox"
392392
393393
# useless for now
394-
bottom_panel_list = ["processes", "metadata", "clipboard"]`
394+
footer_panel_list = ["processes", "metadata", "clipboard"]
395+
396+
397+
# ==========PLUGINS========== #
398+
399+
# Show more detailed metadata, please install exiftool before enabling this plugin!
400+
metadata = false`

Diff for: src/superfile/config.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
theme = "gruvbox"
33

44
# useless for now
5-
bottom_panel_list = ["processes", "metadata", "clipboard"]
5+
footer_panel_list = ["processes", "metadata", "clipboard"]
6+
7+
8+
# ==========PLUGINS========== #
9+
10+
# Show more detailed metadata, please install exiftool before enabling this plugin!
11+
metadata = false

Diff for: src/superfile/plugins.toml

-2
This file was deleted.

0 commit comments

Comments
 (0)