bug solved

This commit is contained in:
Eudes Inácio
2024-03-03 18:23:44 +01:00
parent e05a90acdb
commit 74aeeed3db
@@ -294,13 +294,13 @@ export class NewPublicationPage implements OnInit {
console.log('load video tablet base64', content) console.log('load video tablet base64', content)
this.filecontent = true; this.filecontent = true;
let fileObject = new PublicationAttachmentEntity({ let fileObject = new PublicationAttachmentEntity({
base64: content.data, base64: 'data:video/mp4;base64,'+content.data,
extension: this.removeTextBeforeSlash(element.mimeType, '/'), extension: this.removeTextBeforeSlash(element.mimeType, '/'),
OriginalFileName: 'video', OriginalFileName: 'video',
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
}) })
fileObject.needUpload() /* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject) this.publicationFormMV.form.Files.push(fileObject)
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
@@ -408,7 +408,7 @@ export class NewPublicationPage implements OnInit {
if(upload) { if(upload) {
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity) => { this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity) => {
if(e.FileType == 'video') { if(e.FileType == 'video' && e.toUpload) {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "") e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
e.FileExtension = "mp4" e.FileExtension = "mp4"
e.Base64 = "" e.Base64 = ""
@@ -779,14 +779,14 @@ console.log(stringGerada);
this.filecontent = true; this.filecontent = true;
console.log('', content) console.log('', content)
let fileObject = new PublicationAttachmentEntity({ let fileObject = new PublicationAttachmentEntity({
base64: content.data, base64: 'data:video/mp4;base64,'+content.data,
extension: 'mp4', extension: 'mp4',
OriginalFileName: 'record', OriginalFileName: 'record',
FileType: 'video' FileType: 'video'
} }
) )
fileObject.needUpload() /* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject) this.publicationFormMV.form.Files.push(fileObject)
}) })
.catch((erro) => console.error('read converted video erro ', erro)); .catch((erro) => console.error('read converted video erro ', erro));
@@ -816,7 +816,7 @@ console.log(stringGerada);
} }
) )
fileObject.needUpload() /* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject) this.publicationFormMV.form.Files.push(fileObject)
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));