chore: enhance output

This commit is contained in:
TaurusXin 2024-09-15 21:58:12 +08:00
parent ab1c9fcf0b
commit ee68843d9e
Signed by: taurusxin
GPG Key ID: C334DCA04AC2D2CC
1 changed files with 4 additions and 4 deletions

View File

@ -13,18 +13,18 @@ import (
func processFile(filePath string) error { func processFile(filePath string) error {
currentFile, err := ncmcrypt.NewNeteaseCloudMusic(filePath) currentFile, err := ncmcrypt.NewNeteaseCloudMusic(filePath)
if err != nil { if err != nil {
utils.ErrorPrintfln("Reading '%s' failed: '%s'", filePath, err.Error()) utils.ErrorPrintfln("Reading '%s' failed: %s", filePath, err.Error())
return err return err
} }
dump, err := currentFile.Dump(filepath.Dir(filePath)) dump, err := currentFile.Dump(filepath.Dir(filePath))
if err != nil { if err != nil {
utils.ErrorPrintfln("Processing '%s' failed: '%s'", filePath, err.Error()) utils.ErrorPrintfln("Processing '%s' failed: %s", filePath, err.Error())
return err return err
} }
if dump { if dump {
metadata, err := currentFile.FixMetadata(true) metadata, err := currentFile.FixMetadata(true)
if !metadata { if !metadata {
utils.WarningPrintfln("Fix metadata for '%s' failed: '%s'", filePath, err.Error()) utils.WarningPrintfln("Fix metadata for '%s' failed: %s", filePath, err.Error())
return err return err
} }
utils.DonePrintfln("'%s' -> '%s'", filePath, currentFile.GetDumpFilePath()) utils.DonePrintfln("'%s' -> '%s'", filePath, currentFile.GetDumpFilePath())
@ -63,7 +63,7 @@ func main() {
} }
if !info.IsDir() { if !info.IsDir() {
utils.ErrorPrintfln("Not a directory: '%s'", folderPath) utils.ErrorPrintfln("Not a directory: %s", folderPath)
os.Exit(1) os.Exit(1)
} }