From 6b04bbf73093a24699122c59914b696dd3e7c2bf Mon Sep 17 00:00:00 2001 From: Michael Katica Date: Thu, 18 Apr 2024 14:58:44 -0400 Subject: [PATCH] try to return distinct file --- services/webservices/subtitle_webservice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/webservices/subtitle_webservice.go b/services/webservices/subtitle_webservice.go index 121197c..91c8407 100644 --- a/services/webservices/subtitle_webservice.go +++ b/services/webservices/subtitle_webservice.go @@ -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