diff --git a/docs/unused.md b/docs/unused.md index 85bbb5a7..1072b918 100644 --- a/docs/unused.md +++ b/docs/unused.md @@ -173,6 +173,8 @@ func UpdateNoReadme(db *sql.DB, id int64, val bool) error { } return nil } + +// art.RetrotxtNoReadme.Int16 ``` > "internal/render/render.go" diff --git a/handler/app/dirs.go b/handler/app/dirs.go index f6594878..b2ff1282 100644 --- a/handler/app/dirs.go +++ b/handler/app/dirs.go @@ -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 @@ -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) diff --git a/handler/app/internal/filerecord/filerecord.go b/handler/app/internal/filerecord/filerecord.go index 010d6c04..12d0244c 100644 --- a/handler/app/internal/filerecord/filerecord.go +++ b/handler/app/internal/filerecord/filerecord.go @@ -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 { diff --git a/handler/readme/readme.go b/handler/readme/readme.go index 05c9cdee..5c9b9750 100644 --- a/handler/readme/readme.go +++ b/handler/readme/readme.go @@ -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) {