Skip to content

Commit

Permalink
try to return distinct file
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekatica committed Apr 18, 2024
1 parent b08c795 commit 6b04bbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/webservices/subtitle_webservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func New(bindaddr string, connectionstring string) *SubtitleWebservice {
r.POST("/extract/bulk", svc.ExtractSubtitleBulkAPI())
r.GET("/results", func (c *gin.Context) {
var res []SubtitleExtractResult
err := svc.DbEngine.NewSelect().Model(&res).Order("id DESC").Limit(20).Scan(c.Request.Context())
err := svc.DbEngine.NewSelect().Model(&res).Order("id DESC").DistinctOn("file").Limit(20).Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down

0 comments on commit 6b04bbf

Please sign in to comment.