diff --git a/handler/app/internal/filerecord/filerecord.go b/handler/app/internal/filerecord/filerecord.go index 7a98b1ef..a4600438 100644 --- a/handler/app/internal/filerecord/filerecord.go +++ b/handler/app/internal/filerecord/filerecord.go @@ -585,6 +585,7 @@ func ListContent(art *models.File, dirs command.Dirs, src string) template.HTML l := len(names) if l == 0 { b.WriteString(skippedEmpty(zeroByteFiles)) + //b.Reset() return template.HTML(b.String()) } if useDiz := diz > -1; useDiz { diff --git a/handler/render/render.go b/handler/render/render.go index 26a6e36d..0721e316 100644 --- a/handler/render/render.go +++ b/handler/render/render.go @@ -146,10 +146,16 @@ func InsertDiz(b []byte, diz []byte) []byte { } // Viewer returns true if the file entry should display the file download in the browser plain text viewer. +// The result is based on the platform and section such as "text" or "textamiga" will return true. +// If the filename is "file_id.diz" then it will return false. func Viewer(art *models.File) bool { if art == nil { return false } + if strings.EqualFold(art.Filename.String, "file_id.diz") { + // avoid displaying the file_id.diz twice in the browser viewer + return false + } platform := strings.ToLower(strings.TrimSpace(art.Platform.String)) switch platform { case "text", textamiga: