Remove Debug Deps

This commit is contained in:
Emmm Monster
2021-03-02 18:19:24 +08:00
parent ef060159f0
commit 9caf11217b
4 changed files with 4 additions and 23 deletions

View File

@ -4,7 +4,6 @@ import (
"bytes"
"encoding/binary"
"errors"
"github.com/davecgh/go-spew/spew"
"github.com/unlock-music/cli/algo/common"
"strconv"
"strings"
@ -100,7 +99,6 @@ func (d *Decoder) Decode() error {
d.audio = d.file[1024:]
dataLen := len(d.audio)
spew.Dump(d.audio[:1024])
for i := 0; i < dataLen; i++ {
d.audio[i] ^= d.mask[i&0x1F] //equals: [i % 32]
}

View File

@ -57,10 +57,6 @@ func (d *Decoder) Validate() error {
if !bytes.Equal(magicHeader, d.file[:len(magicHeader)]) {
return errors.New("ncm magic header not match")
}
/*if status.IsDebug {
logging.Log().Info("the unknown field of the header is: \n" + spew.Sdump(d.file[8:10]))
}*/
d.offsetKey = 8 + 2
return nil
}
@ -159,15 +155,6 @@ func (d *Decoder) readCoverData() error {
coverLenStart := d.offsetCover + 5 + 4
bCoverLen := d.file[coverLenStart : coverLenStart+4]
/*if status.IsDebug {
logging.Log().Info("the unknown field of the cover is: \n" +
spew.Sdump(d.file[d.offsetCover:d.offsetCover+5]))
coverLen2 := d.file[d.offsetCover+5 : d.offsetCover+5+4] // it seems that always the same
if !bytes.Equal(coverLen2, bCoverLen) {
logging.Log().Warn("special file found! 2 cover length filed no the same!")
}
}*/
iCoverLen := binary.LittleEndian.Uint32(bCoverLen)
d.offsetAudio = coverLenStart + 4 + iCoverLen
if iCoverLen == 0 {