mirror of https://github.com/Xhofe/alist
feat: meta readme
parent
c413c22201
commit
1428d90361
|
@ -12,6 +12,7 @@ type Meta struct {
|
|||
Hide string `json:"hide"`
|
||||
Upload bool `json:"upload"`
|
||||
OnlyShows string `json:"only_shows"`
|
||||
Readme string `json:"readme"`
|
||||
}
|
||||
|
||||
func GetMetaByPath(path string) (*Meta, error) {
|
||||
|
|
|
@ -60,6 +60,7 @@ type Meta struct {
|
|||
Driver string `json:"driver"`
|
||||
Upload bool `json:"upload"`
|
||||
Total int `json:"total"`
|
||||
Readme string `json:"readme"`
|
||||
//Pages int `json:"pages"`
|
||||
}
|
||||
|
||||
|
@ -75,8 +76,10 @@ func Path(c *gin.Context) {
|
|||
_, ok := c.Get("admin")
|
||||
meta, _ := model.GetMetaByPath(req.Path)
|
||||
upload := false
|
||||
if meta != nil && meta.Upload {
|
||||
upload = true
|
||||
readme := ""
|
||||
if meta != nil {
|
||||
upload = meta.Upload
|
||||
readme = meta.Readme
|
||||
}
|
||||
err := CheckPagination(&req)
|
||||
if err != nil {
|
||||
|
@ -137,6 +140,7 @@ func Path(c *gin.Context) {
|
|||
Driver: driverName,
|
||||
Upload: upload,
|
||||
Total: total,
|
||||
Readme: readme,
|
||||
},
|
||||
Files: files,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue