restore old sorting
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jeffrey Paul 2020-03-28 12:48:04 -07:00
parent 51a0954b27
commit 8d1db5c15e
2 changed files with 7 additions and 4 deletions

View File

@ -2,9 +2,12 @@
Live: https://orangesite.sneak.cloud
Shows stories that were on the orangesite front page within the last 48
hours, but aren't any more. Sorted by the amount of time they remained on
the front page, smallest first.
Shows stories that were on the orangesite front page within the last 24
hours, but aren't any more. Sorted by when they exited the frontpage, most
recent first.
Stories on the frontpage for less than a half hour (likely manually
moderator nuked if rank > 25 or so) are marked red for convenience.
# TODO

View File

@ -24,7 +24,7 @@ func NewRequestHandlerSet(version string, db *gorm.DB) *RequestHandlerSet {
func (r *RequestHandlerSet) indexHandler(c echo.Context) error {
last24h := time.Now().Add(time.Second * 86400 * -1)
var fpi []HNFrontPage
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Select("*, ( strftime('%s',disappeared) - strftime('%s',appeared)) as hangtime").Order("hangtime asc").Find(&fpi)
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Order("disappeared desc").Find(&fpi)
type fprow struct {
Duration string