From c836ac7cb5de09a13f1c2865def9e69c492f93f2 Mon Sep 17 00:00:00 2001 From: Emmm Monster <58943012+emmmx@users.noreply.github.com> Date: Sun, 23 May 2021 19:58:23 +0800 Subject: [PATCH] Clean TODOs --- algo/kgm/kgm.go | 8 ++++---- algo/kgm/mask.go | 2 +- algo/ncm/ncm.go | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/algo/kgm/kgm.go b/algo/kgm/kgm.go index 71b9526..9a039cb 100644 --- a/algo/kgm/kgm.go +++ b/algo/kgm/kgm.go @@ -40,7 +40,7 @@ func (d Decoder) GetAudioData() []byte { } func (d Decoder) GetAudioExt() string { - return "" + return "" // use sniffer } func (d Decoder) GetMeta() common.Meta { @@ -58,9 +58,8 @@ func (d *Decoder) Validate() error { d.key = d.file[0x1c:0x2c] d.key = append(d.key, 0x00) - _ = d.file[0x2c:0x3c] //key2 + _ = d.file[0x2c:0x3c] //todo: key2 return nil - } func (d *Decoder) Decode() error { @@ -69,7 +68,8 @@ func (d *Decoder) Decode() error { lenData := len(dataEncrypted) initMask() 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 } d.audio = make([]byte, lenData) diff --git a/algo/kgm/mask.go b/algo/kgm/mask.go index ee355dc..9ac2abf 100644 --- a/algo/kgm/mask.go +++ b/algo/kgm/mask.go @@ -41,7 +41,7 @@ var maskV2 []byte var fullMaskLen int var initMaskOK = false -//todo: 根据需求解压Mask大小 +//todo: decompress mask on demand func initMask() { if initMaskOK { return diff --git a/algo/ncm/ncm.go b/algo/ncm/ncm.go index 9b4334a..620cb18 100644 --- a/algo/ncm/ncm.go +++ b/algo/ncm/ncm.go @@ -61,7 +61,6 @@ func (d *Decoder) Validate() error { return nil } -//todo: 读取前进行检查长度,防止越界 func (d *Decoder) readKeyData() error { if d.offsetKey == 0 || d.offsetKey+4 > d.fileLen { return errors.New("invalid cover file offset")