From 2cc67bfcb7d226da1be2674cea304f08fbc6e2fb Mon Sep 17 00:00:00 2001 From: shuo1201 Date: Thu, 18 Dec 2025 07:59:07 +0000 Subject: [PATCH] =?UTF-8?q?update=20plugin/hls/index.go.=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3m3u8=E6=92=AD=E6=94=BE=E4=B9=B1=E5=BA=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shuo1201 --- plugin/hls/index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/hls/index.go b/plugin/hls/index.go index de88bb7..642c195 100644 --- a/plugin/hls/index.go +++ b/plugin/hls/index.go @@ -95,7 +95,7 @@ func (config *HLSPlugin) vod(w http.ResponseWriter, r *http.Request) { switch recordType { case "fmp4": query := `stream_path = ? AND type = ? AND start_time IS NOT NULL AND end_time IS NOT NULL AND ? <= end_time AND ? >= start_time` - config.DB.Where(query, streamPath, "mp4", startTime, endTime).Find(&records) + config.DB.Where(query, streamPath, "mp4", startTime, endTime).Order("start_time ASC").Find(&records) if len(records) == 0 { return } @@ -139,7 +139,7 @@ func (config *HLSPlugin) vod(w http.ResponseWriter, r *http.Request) { return } query := `stream_path = ? AND type = ? AND start_time IS NOT NULL AND end_time IS NOT NULL AND ? <= end_time AND ? >= start_time` - config.DB.Where(query, streamPath, recordType, startTime, endTime).Find(&records) + config.DB.Where(query, streamPath, recordType, startTime, endTime).Order("start_time ASC").Find(&records) if len(records) > 0 { playlist := hls.Playlist{ Version: 7, @@ -230,7 +230,7 @@ func (config *HLSPlugin) ServeHTTP(w http.ResponseWriter, r *http.Request) { if config.DB != nil { var records []m7s.RecordStream query := `stream_path = ? AND type = 'ts' AND start_time IS NOT NULL AND end_time IS NOT NULL AND ? <= end_time AND ? >= start_time` - config.DB.Where(query, streamPath, startTime, endTime).Find(&records) + config.DB.Where(query, streamPath, startTime, endTime).Order("start_time ASC").Find(&records) if len(records) > 0 { playlist := hls.Playlist{ -- Gitee