|
@@ -11,6 +11,7 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/rdlucklib/rdluck_tools/file"
|
|
"github.com/rdlucklib/rdluck_tools/file"
|
|
"github.com/rdlucklib/rdluck_tools/http"
|
|
"github.com/rdlucklib/rdluck_tools/http"
|
|
|
|
+ "html"
|
|
"os"
|
|
"os"
|
|
"path"
|
|
"path"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -1380,9 +1381,12 @@ func UpdateReportVideo(reportInfo *models.Report) {
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ reportContent := ""
|
|
for _, chapter := range chapterList {
|
|
for _, chapter := range chapterList {
|
|
if chapter.PublishState == 2 {
|
|
if chapter.PublishState == 2 {
|
|
reportChapterIdList = append(reportChapterIdList, chapter.ReportChapterId)
|
|
reportChapterIdList = append(reportChapterIdList, chapter.ReportChapterId)
|
|
|
|
+ reportContent += chapter.Content
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if len(reportChapterIdList) > 0 {
|
|
if len(reportChapterIdList) > 0 {
|
|
@@ -1391,6 +1395,23 @@ func UpdateReportVideo(reportInfo *models.Report) {
|
|
utils.FileLog.Info(fmt.Sprintf("%d报告音频生产失败:%s", reportInfo.Id, err.Error()))
|
|
utils.FileLog.Info(fmt.Sprintf("%d报告音频生产失败:%s", reportInfo.Id, err.Error()))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 生成汇总音频
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ if reportInfo.VideoUrl != "" && reportInfo.VideoName != "" && reportInfo.VideoSize != "" && reportInfo.VideoPlaySeconds != "" {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ videoUrl, videoName, videoSize, videoPlaySeconds, e := CreateReportVideo(reportInfo.Title, html.UnescapeString(reportContent), time.Now().Format(utils.FormatDateTime))
|
|
|
|
+ if e != nil {
|
|
|
|
+ err = e
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 修改报告的音频信息
|
|
|
|
+ err = models.ModifyReportVideoByNoVideo(reportInfo.Id, videoUrl, videoName, videoSize, videoPlaySeconds)
|
|
|
|
+
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
err := CreateVideo(reportInfo)
|
|
err := CreateVideo(reportInfo)
|
|
if err != nil {
|
|
if err != nil {
|