diff --git a/app/mix/controller/zonemoment_api.go b/app/mix/controller/zonemoment_api.go index c9f6fbb0..600a398c 100644 --- a/app/mix/controller/zonemoment_api.go +++ b/app/mix/controller/zonemoment_api.go @@ -114,7 +114,7 @@ func ApiGetZoneMomentListByCreaterMid(ctx *gin.Context) { mediaFillableList[objectMediaNum*i+4] = vo.StreamerExt.Avatar } mediafiller.FillList(ctx, mediaFillableList) - service.DefaultService.UtilEncryptVideosForZoneMomentVOs(list) + service.DefaultService.UtilEncryptVideosForZoneMomentVOs(ctx, list) data := &zonemomentproto.ApiListByCreaterMidData{ List: list, @@ -151,7 +151,7 @@ func ApiGetZoneMomentListByZid(ctx *gin.Context) { mediaFillableList[objectMediaNum*i+4] = vo.StreamerExt.Avatar } mediafiller.FillList(ctx, mediaFillableList) - service.DefaultService.UtilEncryptVideosForZoneMomentVOs(list) + service.DefaultService.UtilEncryptVideosForZoneMomentVOs(ctx, list) data := &zonemomentproto.ApiListByZidData{ List: list, diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index ff1d4969..c614d186 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -32,6 +32,7 @@ import ( "service/dbstruct" "service/library/apollo" "service/library/logger" + "service/library/mediafiller" "service/library/mycrypto" "service/library/redis" "service/library/validator" @@ -2062,12 +2063,22 @@ func (s *Service) utilSignHvyogoMessage(msg interfaces.HvyogoSignable) ([]byte, return resultBytes, nil } -func (s *Service) UtilEncryptVideosForZoneMomentVOs(list []*zonemomentproto.ApiZoneMomentVO) { +func (s *Service) UtilEncryptVideosForZoneMomentVOs(ctx *gin.Context, list []*zonemomentproto.ApiZoneMomentVO) { videoIdForUploadFail, err := apollo.GetIntValue(consts.VideoIdForUploadFail, apollo.ApolloOpts().SetNamespace("application")) if err != nil { logger.Error("Apollo read failed : %v", err) } + media := &dbstruct.MediaComponent{ + ImageIds: util.Int64Slice(make([]int64, 0)), + VideoIds: util.Int64Slice([]int64{int64(videoIdForUploadFail)}), + } + mediafiller.FillEntity(ctx, media) + vdi := &dbstruct.ToCVideo{} + if len(media.Videos) > 0 { + vdi = media.Videos[0] + } + for _, vo := range list { if vo.IsZoneMomentUnlocked == consts.IsZoneMomentUnlocked_No { videoIds := vo.MediaComp.GetVideoIds() @@ -2077,6 +2088,7 @@ func (s *Service) UtilEncryptVideosForZoneMomentVOs(list []*zonemomentproto.ApiZ vo.MediaComp.VideoIds = util.Int64Slice(videoIds) for _, video := range vo.MediaComp.Videos { video.Urls = make([]string, 0) + video.Urls = append(video.Urls, vdi.Urls...) } } }