func (VS *Server) editVideoCourse(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldVideo, _ := VS.getVideoCourseByID(c, id, "h_videos", "editVideoCourse", "oldVideo, _ := VS.getVideoCourseByID", true)
	newVideo, b := VS.getNewVideoCourse(c, id)
	if !b {
		return
	}
	// Check if we are editing another language than the main one
	if VS.isTranslation(c, newVideo, newVideo.ID) {
		return
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	// Audit
	audit := VS.getAuditFromCentral(c, newVideo, id, Modified)
	modified := VS.dynamicAuditChange(c, newVideo, oldVideo, audit.ID)
	if VS.checkChange(c, audit.ID, "Name", oldVideo.Name, newVideo.Name) {
		modified = true
		VS.move(basePath+"/local-resources/video-courses/"+oldVideo.Name+"/", basePath+"/local-resources/video-courses/"+newVideo.Name+"/")
	}
	if modified {
		if VS.addVideoCourseToDatabase(c, newVideo, "h_videos", "editVideoCourse", "if VS.addVideoCourseToDatabase") {
			VS.registerAuditAndEvent(c, audit, newVideo, newVideo.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Video with that name.Please choose another name ")
		}
	}
	VS.goodFeedback(c, "videos/see-list/"+idservicetype.Hex())
}
// Saves the new information of the Video course to the Database
Saves the new information of the Video course to the Database
// Saves the new information of the Video course to the Database
func (VS *Server) editVideoCourse(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldVideo, _ := VS.getVideoCourseByID(c, id, "h_videos", "editVideoCourse", "oldVideo, _ := VS.getVideoCourseByID", true)
	newVideo, b := VS.getNewVideoCourse(c, id)
	if !b {
		return
	}
	if VS.isTranslation(c, newVideo, newVideo.ID) {
		return
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	audit := VS.getAuditFromCentral(c, newVideo, id, Modified)
	modified := VS.dynamicAuditChange(c, newVideo, oldVideo, audit.ID)
	if VS.checkChange(c, audit.ID, "Name", oldVideo.Name, newVideo.Name) {
		modified = true
		VS.move(basePath+"/local-resources/video-courses/"+oldVideo.Name+"/", basePath+"/local-resources/video-courses/"+newVideo.Name+"/")
	}
	if modified {
		if VS.addVideoCourseToDatabase(c, newVideo, "h_videos", "editVideoCourse", "if VS.addVideoCourseToDatabase") {
			VS.registerAuditAndEvent(c, audit, newVideo, newVideo.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Video with that name.Please choose another name ")
		}
	}
	VS.goodFeedback(c, "videos/see-list/"+idservicetype.Hex())
}
func ( VS * Server ) editVideoCourse ( c * gin . Context ) { id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } oldVideo , _ := VS . getVideoCourseByID ( c , id , " " , " " , " " , true ) newVideo , b := VS . getNewVideoCourse ( c , id ) if ! b { return } if VS . isTranslation ( c , newVideo , newVideo . ID ) { return } idservicetype , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } audit := VS . getAuditFromCentral ( c , newVideo , id , Modified ) modified := VS . dynamicAuditChange ( c , newVideo , oldVideo , audit . ID ) if VS . checkChange ( c , audit . ID , " " , oldVideo . Name , newVideo . Name ) { modified = true VS . move ( basePath + " " + oldVideo . Name + " " , basePath + " " + newVideo . Name + " " ) } if modified { if VS . addVideoCourseToDatabase ( c , newVideo , " " , " " , " " ) { VS . registerAuditAndEvent ( c , audit , newVideo , newVideo . ID ) } else { VS . wrongFeedback ( c , " " ) } } VS . goodFeedback ( c , " " + idservicetype . Hex ( ) ) }
Saves the new information of the Video course to the Database
Saves the new information of the Video course to the Database
// Check if we are editing another language than the main one // Audit