diff --git a/src/components/config_type.go b/src/components/config_type.go index 952e98db..d1a3f7f0 100644 --- a/src/components/config_type.go +++ b/src/components/config_type.go @@ -34,6 +34,8 @@ type ThemeType struct { // Configuration settings type ConfigType struct { Theme string `toml:"theme"` + FooterPanelList []string `toml:"footer_panel_list"` + Metadata bool `toml:"metadata"` } type HotkeysType struct { diff --git a/src/components/function.go b/src/components/function.go index bf775f00..1266467f 100644 --- a/src/components/function.go +++ b/src/components/function.go @@ -449,18 +449,27 @@ func returnMetaData(m model) model { return m } - fileInfos := et.ExtractMetadata(filePath) - for _, fileInfo := range fileInfos { - if fileInfo.Err != nil { - outPutLog("Return meta data function error", fileInfo, fileInfo.Err) - continue - } + if Config.Metadata { + fileInfos := et.ExtractMetadata(filePath) + + for _, fileInfo := range fileInfos { + if fileInfo.Err != nil { + outPutLog("Return meta data function error", fileInfo, fileInfo.Err) + continue + } - for k, v := range fileInfo.Fields { - temp := [2]string{k, fmt.Sprintf("%v", v)} - m.fileMetaData.metaData = append(m.fileMetaData.metaData, temp) + for k, v := range fileInfo.Fields { + temp := [2]string{k, fmt.Sprintf("%v", v)} + m.fileMetaData.metaData = append(m.fileMetaData.metaData, temp) + } } + } else { + fileName := [2]string{"FileName", fileInfo.Name()} + fileSize := [2]string{"FileSize", formatFileSize(fileInfo.Size())} + fileModifyData := [2]string{"FileModifyDate", fileInfo.ModTime().String()} + m.fileMetaData.metaData = append(m.fileMetaData.metaData, fileName, fileSize, fileModifyData) } + channel <- channelMessage{ messageId: id, loadMetadata: true, @@ -817,4 +826,4 @@ func generateSearchBar() textinput.Model { ti.Blur() ti.CharLimit = 156 return ti -} \ No newline at end of file +} diff --git a/src/main.go b/src/main.go index ff7bd039..4f40a953 100644 --- a/src/main.go +++ b/src/main.go @@ -49,10 +49,6 @@ const ( trashDirectoryInfo string = "/Trash/info" ) -type GitHubRelease struct { - TagName string `json:"tag_name"` -} - func main() { output := termenv.NewOutput(os.Stdout) terminalBackgroundColor := output.BackgroundColor() @@ -223,11 +219,15 @@ func CheckForUpdates() { return } + type GitHubRelease struct { + TagName string `json:"tag_name"` + } + var release GitHubRelease if err := json.Unmarshal(body, &release); err != nil { return } - + if versionToNumber(release.TagName) > versionToNumber(currentVersion) { fmt.Printf("A new version %s is available.\n", release.TagName) fmt.Printf("Please update.\n┏\n\n %s\n\n", latestVersionGithub) @@ -391,4 +391,10 @@ const configTomlString string = `# change your theme theme = "gruvbox" # useless for now -bottom_panel_list = ["processes", "metadata", "clipboard"]` +footer_panel_list = ["processes", "metadata", "clipboard"] + + +# ==========PLUGINS========== # + +# Show more detailed metadata, please install exiftool before enabling this plugin! +metadata = false` diff --git a/src/superfile/config.toml b/src/superfile/config.toml index 60b4e4ff..078407a0 100644 --- a/src/superfile/config.toml +++ b/src/superfile/config.toml @@ -2,4 +2,10 @@ theme = "gruvbox" # useless for now -bottom_panel_list = ["processes", "metadata", "clipboard"] \ No newline at end of file +footer_panel_list = ["processes", "metadata", "clipboard"] + + +# ==========PLUGINS========== # + +# Show more detailed metadata, please install exiftool before enabling this plugin! +metadata = false \ No newline at end of file diff --git a/src/superfile/plugins.toml b/src/superfile/plugins.toml deleted file mode 100644 index 1beeefc3..00000000 --- a/src/superfile/plugins.toml +++ /dev/null @@ -1,2 +0,0 @@ -already_install_exiftool = true -metadata = true