Skip to content

Commit

Permalink
removed filerecord.ReadmeNone references.
Browse files Browse the repository at this point in the history
it was blocking the display of various nfos.
  • Loading branch information
bengarrett committed Sep 18, 2024
1 parent f5ab03a commit b46bcab
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
2 changes: 2 additions & 0 deletions docs/unused.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ func UpdateNoReadme(db *sql.DB, id int64, val bool) error {
}
return nil
}

// art.RetrotxtNoReadme.Int16
```

> "internal/render/render.go"
Expand Down
2 changes: 1 addition & 1 deletion handler/app/dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func (dir Dirs) embed(art *models.File, data map[string]interface{}) (map[string
return data, nil
}
p, err := readme.Read(art, dir.Download, dir.Extra)
fmt.Println("readme.Read", p)
if err != nil {
if errors.Is(err, render.ErrDownload) {
data["noDownload"] = true
Expand Down Expand Up @@ -310,7 +311,6 @@ func (dir Dirs) Editor(art *models.File, data map[string]interface{}) map[string
data["modAssetPreview"] = dir.assets(dir.Preview, unid)
data["modAssetThumbnail"] = dir.assets(dir.Thumbnail, unid)
data["modAssetExtra"] = dir.assets(dir.Extra, unid)
data["modNoReadme"] = filerecord.ReadmeNone(art)
data["modReadmeSuggest"] = filerecord.Readme(art)
data["modZipContent"] = filerecord.ZipContent(art)
data["modRelations"] = filerecord.RelationsStr(art)
Expand Down
11 changes: 0 additions & 11 deletions handler/app/internal/filerecord/filerecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,17 +1166,6 @@ func Magic(art *models.File) string {
return ""
}

// ReadmeNone returns true if the file record should not display the text file content in the artifact page.
func ReadmeNone(art *models.File) bool {
if art == nil {
return false
}
if art.RetrotxtNoReadme.Valid {
return art.RetrotxtNoReadme.Int16 != 0
}
return false
}

// Readme returns a guessed or suggested readme file name to use for the record.
func Readme(r *models.File) string {
if r == nil {
Expand Down
3 changes: 0 additions & 3 deletions handler/readme/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ func Read(art *models.File, downloadPath, extraPath string) ([]byte, error) {
if art == nil {
return nil, fmt.Errorf("art in read, %w", ErrNoModel)
}
if art.RetrotxtNoReadme.Int16 != 0 {
return nil, nil
}
b, err := render.Read(art, downloadPath, extraPath)
if err != nil {
if errors.Is(err, render.ErrFilename) {
Expand Down

0 comments on commit b46bcab

Please sign in to comment.