Skip to content

Commit 3e80de0

Browse files
Show unsupported format in preview panel over a torrent file
1 parent e0ca5d8 commit 3e80de0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/internal/model_render.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,17 @@ func (m model) filePreviewPanelRender() string {
513513
outPutLog("error get file info", err)
514514
return box.Render("\n --- " + icon.Error + " Error get file info ---")
515515
}
516-
516+
517517
ext := filepath.Ext(itemPath)
518518
// check if the file is pdf file, cuz pdf will cause error
519519
if ext == ".pdf" {
520520
return box.Render("\n --- " + icon.Error + " Unsupported formats ---")
521-
}
521+
}
522+
523+
// check if the file is torrent file, cuz torrent will cause error
524+
if ext == ".torrent" {
525+
return box.Render("\n --- " + icon.Error + " Unsupported formats ---")
526+
}
522527

523528
if fileInfo.IsDir() {
524529
directoryContent := ""

0 commit comments

Comments
 (0)