Skip to content

Commit

Permalink
fixed release sort
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Jun 28, 2023
1 parent 193cae0 commit 93f8439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/mysqlimpl/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (api *MySqlAPI)GetPluginReleases(id string)(releases []*PluginRelease, err
const queryCmd = "SELECT `tag`,`enabled`,`stable`,`size`," +
"CONVERT_TZ(`uploaded`,@@session.time_zone,'+00:00') AS `utc_uploaded`," +
"`filename`,`downloads`,`github_url`" +
" FROM plugin_releases WHERE `id`=? ORDER BY `uploaded` DESC"
" FROM plugin_releases WHERE `id`=?"

ctx, cancel := context.WithTimeout(context.Background(), time.Second * 5)
defer cancel()
Expand Down Expand Up @@ -472,7 +472,7 @@ func (api *MySqlAPI)GetPluginReleases(id string)(releases []*PluginRelease, err
if err = rows.Err(); err != nil {
return
}
sort.Slice(releases, func(i, j int)(bool){ return releases[i].Tag.Less(releases[j].Tag) })
sort.Slice(releases, func(i, j int)(bool){ return !releases[i].Tag.Less(releases[j].Tag) })
return
}

Expand Down

0 comments on commit 93f8439

Please sign in to comment.