fix: make the progress more readable

This commit is contained in:
Antoine Aflalo
2024-08-27 20:42:26 -04:00
parent e0b6d7fcef
commit 72c6776793
3 changed files with 7 additions and 5 deletions

View File

@@ -24,8 +24,10 @@ func Optimize(chapterConverter converter.Converter, path string, quality uint8,
}
// Convert the chapter
convertedChapter, err := chapterConverter.ConvertChapter(chapter, quality, func(msg string) {
log.Printf("[%s]%s", path, msg)
convertedChapter, err := chapterConverter.ConvertChapter(chapter, quality, func(msg string, current uint32, total uint32) {
if current%10 == 0 || current == total {
log.Printf("[%s] Converting: %d/%d", chapter.FilePath, current, total)
}
})
if err != nil {
return fmt.Errorf("failed to convert chapter: %v", err)