mirror of
				https://git.unlock-music.dev/um/web.git
				synced 2025-11-04 14:23:29 +08:00 
			
		
		
		
	Try to fix .qmc ID3 Info
This commit is contained in:
		
							parent
							
								
									8e135f7004
								
							
						
					
					
						commit
						31215772e3
					
				@ -5,7 +5,8 @@ import {
 | 
			
		||||
    GetFileInfo,
 | 
			
		||||
    GetMetaCoverURL,
 | 
			
		||||
    GetWebImage,
 | 
			
		||||
    IXAREA_API_ENDPOINT
 | 
			
		||||
    IXAREA_API_ENDPOINT,
 | 
			
		||||
    WriteMp3Meta
 | 
			
		||||
} from "./util";
 | 
			
		||||
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
 | 
			
		||||
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
 | 
			
		||||
@ -85,14 +86,9 @@ export async function Decrypt(file, raw_filename, raw_ext) {
 | 
			
		||||
                imgUrl = imageInfo.url
 | 
			
		||||
                try {
 | 
			
		||||
                    if (ext === "mp3") {
 | 
			
		||||
                        let writer = new ID3Writer(musicDecoded)
 | 
			
		||||
                        writer.setFrame('APIC', {
 | 
			
		||||
                            type: 3,
 | 
			
		||||
                            data: imageInfo.buffer,
 | 
			
		||||
                            description: "Cover",
 | 
			
		||||
                        })
 | 
			
		||||
                        writer.addTag();
 | 
			
		||||
                        musicDecoded = writer.arrayBuffer
 | 
			
		||||
                        musicDecoded = await WriteMp3Meta(musicDecoded,
 | 
			
		||||
                            info.artist.split(" _ "), info.title, "",
 | 
			
		||||
                            imageInfo.buffer, "Cover", musicMeta)
 | 
			
		||||
                        musicBlob = new Blob([musicDecoded], {type: mime});
 | 
			
		||||
                    } else if (ext === 'flac') {
 | 
			
		||||
                        const writer = new MetaFlac(Buffer.from(musicDecoded))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user