Create PreviewTable.vue

This commit is contained in:
xhacker-zzz 2021-12-22 22:29:05 +08:00 committed by GitHub
parent 7a818e2030
commit 05b4014894
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -16,12 +16,12 @@
</el-table-column>
<el-table-column label="歌手">
<template #default="scope">
<el-input placeholder="请输入歌手" v-model="iArtist ? iArtist : iArtist = scope.row.artist, iArtist" @change="(value)=>{ scope.row.artist = value }" clearable></el-input>
<el-input placeholder="请输入歌手" v-model="iArtist ? iArtist : iArtist = scope.row.artist, iArtist" @change="(value)=>{ changeArtist(value, scope.row) }" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="专辑">
<template #default="scope">
<el-input placeholder="请输入专辑名称" v-model="iAlbum ? iAlbum : iAlbum = scope.row.album, iAlbum" @change="(value)=>{ scope.row.album = value }" clearable></el-input>
<el-input placeholder="请输入专辑名称" v-model="iAlbum ? iAlbum : iAlbum = scope.row.album, iAlbum" @change="(value)=>{ changeAlbum(value, scope.row) }" clearable></el-input>
</template>
</el-table-column>
<el-table-column label="操作">
@ -38,6 +38,13 @@
<script>
import { RemoveBlobMusic } from '@/utils/utils';
import {
GetArrayBuffer,
GetImageFromURL,
WriteMetaToFlac,
WriteMetaToMp3,
} from '@/decrypt/utils';
import { parseBlob as metaParseBlob } from 'music-metadata-browser';
export default {
name: 'PreviewTable',
@ -68,7 +75,7 @@ export default {
row.blob = new Blob([fileBuffer], { type: row.mime });
} else if (ext === 'flac') {
fileBuffer = WriteMetaToFlac(Buffer.from(fileBuffer), newMeta, musicMeta);
row.blob = new Blob([musicDecoded], { type: row.mime });
row.blob = new Blob([fileBuffer], { type: row.mime });
} else {
console.info('writing metadata for ' + row.ext + ' is not being supported for now');
}