mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-05 18:06:51 +08:00
fix: get recordlist with out pageNum
This commit is contained in:
19
api.go
19
api.go
@@ -812,6 +812,9 @@ func (s *Server) GetRecordList(ctx context.Context, req *pb.ReqRecordList) (resp
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = 10
|
||||
}
|
||||
if req.PageNum == 0 {
|
||||
req.PageNum = 1
|
||||
}
|
||||
offset := (req.PageNum - 1) * req.PageSize // 计算偏移量
|
||||
var totalCount int64 //总条数
|
||||
|
||||
@@ -829,15 +832,15 @@ func (s *Server) GetRecordList(ctx context.Context, req *pb.ReqRecordList) (resp
|
||||
query = query.Where("type = ?", req.Type)
|
||||
}
|
||||
startTime, endTime, err := util.TimeRangeQueryParse(url.Values{"range": []string{req.Range}, "start": []string{req.Start}, "end": []string{req.End}})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !startTime.IsZero() {
|
||||
query = query.Where("start_time >= ?", startTime)
|
||||
}
|
||||
if !endTime.IsZero() {
|
||||
query = query.Where("end_time <= ?", endTime)
|
||||
if err == nil {
|
||||
if !startTime.IsZero() {
|
||||
query = query.Where("start_time >= ?", startTime)
|
||||
}
|
||||
if !endTime.IsZero() {
|
||||
query = query.Where("end_time <= ?", endTime)
|
||||
}
|
||||
}
|
||||
|
||||
query.Count(&totalCount)
|
||||
err = query.Offset(int(offset)).Limit(int(req.PageSize)).Order("start_time desc").Find(&result).Error
|
||||
if err != nil {
|
||||
|
@@ -27,7 +27,7 @@ mp4:
|
||||
|
||||
onsub:
|
||||
pull:
|
||||
^vod\d+/(.+)$: $1
|
||||
^vod\d+/(.+)/mp4$: $1
|
||||
cascadeserver:
|
||||
quic:
|
||||
listenaddr: :44944
|
||||
@@ -41,9 +41,9 @@ flv:
|
||||
# ^live/.+:
|
||||
# fragment: 1m
|
||||
# filepath: record/$0
|
||||
# onsub:
|
||||
# pull:
|
||||
# ^vod\d+/(.+)$: $1
|
||||
onsub:
|
||||
pull:
|
||||
^vod\d+/(.+)/flv$: $1
|
||||
# pull:
|
||||
# live/test: https://livecb.alicdn.com/mediaplatform/afb241b3-408c-42dd-b665-04d22b64f9df.flv?auth_key=1734575216-0-0-c62721303ce751c8e5b2c95a2ec242a0&F=pc&source=34675810_null_live_detail&ali_flv_retain=2
|
||||
hls:
|
||||
|
Reference in New Issue
Block a user