forked from taurusxin/ncmdump-go
chore: enhance output
This commit is contained in:
parent
ab1c9fcf0b
commit
ee68843d9e
8
main.go
8
main.go
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user