kobe6258 8 months ago
parent
commit
97a363f9a0
2 changed files with 2 additions and 11 deletions
  1. 1 0
      controllers/video.go
  2. 1 11
      models/media.go

+ 1 - 0
controllers/video.go

@@ -253,6 +253,7 @@ func (this *VideoController) EditVideo() {
 		Id:                    req.VideoId,
 		AuthorId:              req.AnalystId,
 		AuthorName:            req.AnalystName,
+		MediaType:             models.Video,
 		CoverSrc:              req.CoverSrc,
 		Src:                   req.SrcUrl,
 		MediaName:             req.VideoName,

+ 1 - 11
models/media.go

@@ -77,12 +77,7 @@ func (m *Media) ToMediaView() (message *MediaView) {
 		PermissionIds:         m.PermissionIds,
 		PublishedTime:         m.PublishedTime.Format(time.DateTime),
 	}
-	//image, err := GetImageById(m.CoverSrc)
-	//if err != nil || image == nil {
-	//	message.CoverSrc = ""
-	//} else {
-	//	message.CoverSrc = image.SrcUrl
-	//}
+
 	ids := strings.Split(m.PermissionIds, ",")
 	var idList []int
 	for _, id := range ids {
@@ -300,11 +295,6 @@ func UpdateMedia(m *Media) (updateId int64, err error) {
 			return
 		}
 	}()
-	err = DeleteMappingsById(m.Id)
-	if err != nil {
-		_ = tx.Rollback()
-		return
-	}
 	updateId, err = o.Update(m, "author_id", "author_name", "cover_src", "src", "media_play_milliseconds", "permission_ids")
 	if err != nil {
 		_ = tx.Rollback()