Skip to content

Commit

Permalink
fixed duplicate file_id.diz in readme for solo file_id.diz assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Dec 15, 2024
1 parent e6555a1 commit 6619e5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions handler/app/internal/filerecord/filerecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions handler/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6619e5f

Please sign in to comment.