Clean TODOs

This commit is contained in:
Emmm Monster 2021-05-23 19:58:23 +08:00
parent ad301e0ff2
commit c836ac7cb5
No known key found for this signature in database
GPG Key ID: C98279C83FB50DB9
3 changed files with 5 additions and 6 deletions

View File

@ -40,7 +40,7 @@ func (d Decoder) GetAudioData() []byte {
} }
func (d Decoder) GetAudioExt() string { func (d Decoder) GetAudioExt() string {
return "" return "" // use sniffer
} }
func (d Decoder) GetMeta() common.Meta { func (d Decoder) GetMeta() common.Meta {
@ -58,9 +58,8 @@ func (d *Decoder) Validate() error {
d.key = d.file[0x1c:0x2c] d.key = d.file[0x1c:0x2c]
d.key = append(d.key, 0x00) d.key = append(d.key, 0x00)
_ = d.file[0x2c:0x3c] //key2 _ = d.file[0x2c:0x3c] //todo: key2
return nil return nil
} }
func (d *Decoder) Decode() error { func (d *Decoder) Decode() error {
@ -69,7 +68,8 @@ func (d *Decoder) Decode() error {
lenData := len(dataEncrypted) lenData := len(dataEncrypted)
initMask() initMask()
if fullMaskLen < lenData { if fullMaskLen < lenData {
logging.Log().Warn("文件过大,处理后的音频不完整,请向我们报告此文件的信息") logging.Log().Warn("The file is too large and the processed audio is incomplete, " +
"please report to us about this file at https://github.com/unlock-music/cli/issues")
lenData = fullMaskLen lenData = fullMaskLen
} }
d.audio = make([]byte, lenData) d.audio = make([]byte, lenData)

View File

@ -41,7 +41,7 @@ var maskV2 []byte
var fullMaskLen int var fullMaskLen int
var initMaskOK = false var initMaskOK = false
//todo: 根据需求解压Mask大小 //todo: decompress mask on demand
func initMask() { func initMask() {
if initMaskOK { if initMaskOK {
return return

View File

@ -61,7 +61,6 @@ func (d *Decoder) Validate() error {
return nil return nil
} }
//todo: 读取前进行检查长度,防止越界
func (d *Decoder) readKeyData() error { func (d *Decoder) readKeyData() error {
if d.offsetKey == 0 || d.offsetKey+4 > d.fileLen { if d.offsetKey == 0 || d.offsetKey+4 > d.fileLen {
return errors.New("invalid cover file offset") return errors.New("invalid cover file offset")