1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-11-23 16:45:39 +00:00

the All listing is broken

This commit is contained in:
Vincent Batts 2013-11-07 14:28:54 -05:00 committed by Vincent Batts
parent c611d0d853
commit 2878bb123b

View file

@ -110,9 +110,9 @@ pass -1 for all files
func (u Util) GetFiles(limit int) (files []types.File, err error) { func (u Util) GetFiles(limit int) (files []types.File, err error) {
//files = []types.File{} //files = []types.File{}
if limit == -1 { if limit == -1 {
err = u.Gfs.Find(nil).Sort("-metadata.timestamp").Limit(limit).All(&files)
} else {
err = u.Gfs.Find(nil).Sort("-metadata.timestamp").All(&files) err = u.Gfs.Find(nil).Sort("-metadata.timestamp").All(&files)
} else {
err = u.Gfs.Find(nil).Sort("-metadata.timestamp").Limit(limit).All(&files)
} }
return files, err return files, err
} }