|
@@ -8,8 +8,6 @@ import (
|
|
|
"eta/eta_mobile/services"
|
|
|
"eta/eta_mobile/services/data"
|
|
|
"eta/eta_mobile/utils"
|
|
|
- "fmt"
|
|
|
- "github.com/kgiannakakis/mp3duration/src/mp3duration"
|
|
|
"html"
|
|
|
"os"
|
|
|
"path"
|
|
@@ -1144,15 +1142,19 @@ func (this *ReportController) VoiceUpload() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- var playSeconds float64
|
|
|
- playSeconds, err = mp3duration.Calculate(fPath)
|
|
|
- if playSeconds <= 0 {
|
|
|
- playSeconds, err = utils.GetVideoPlaySeconds(fPath)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取音频时间失败"
|
|
|
- br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
+ //var playSeconds float64
|
|
|
+ //playSeconds, err = mp3duration.Calculate(fPath)
|
|
|
+ //if playSeconds <= 0 {
|
|
|
+ // playSeconds, err = utils.GetVideoPlaySeconds(fPath)
|
|
|
+ // if err != nil {
|
|
|
+ // br.Msg = "获取音频时间失败"
|
|
|
+ // br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ playSecondsStr, err := utils.GetDuration(fPath) //mp3duration.Calculate(fPath)
|
|
|
+ if err != nil {
|
|
|
+ utils.FileLog.Info("获取音频时间失败,Err:" + err.Error())
|
|
|
}
|
|
|
|
|
|
fileBody, err := os.ReadFile(fPath)
|
|
@@ -1172,7 +1174,7 @@ func (this *ReportController) VoiceUpload() {
|
|
|
|
|
|
reportChapterInfo.VideoUrl = resourceUrl
|
|
|
reportChapterInfo.VideoName = videoName
|
|
|
- reportChapterInfo.VideoPlaySeconds = fmt.Sprint(playSeconds)
|
|
|
+ reportChapterInfo.VideoPlaySeconds = playSecondsStr
|
|
|
reportChapterInfo.VideoSize = sizeStr
|
|
|
reportChapterInfo.VideoKind = 1
|
|
|
reportChapterInfo.LastModifyAdminId = this.SysUser.AdminId
|