feat(split): Make the split configurable for the optimize command

This commit is contained in:
Antoine Aflalo
2024-08-28 09:06:49 -04:00
parent 72c6776793
commit 5ac59a93c5
5 changed files with 50 additions and 24 deletions

View File

@@ -14,18 +14,22 @@ func TestConvertChapter(t *testing.T) {
testCases := []struct {
name string
genTestChapter func(path string) (*manga.Chapter, error)
split bool
}{
{
name: "All split pages",
genTestChapter: genBigPages,
split: true,
},
{
name: "No split pages",
genTestChapter: genSmallPages,
split: false,
},
{
name: "Mix of split and no split pages",
genTestChapter: genMixSmallBig,
split: true,
},
}
// Load test genTestChapter from testdata
@@ -50,11 +54,11 @@ func TestConvertChapter(t *testing.T) {
quality := uint8(80)
progress := func(msg string) {
progress := func(msg string, current uint32, total uint32) {
t.Log(msg)
}
convertedChapter, err := converter.ConvertChapter(chapter, quality, progress)
convertedChapter, err := converter.ConvertChapter(chapter, quality, false, progress)
if err != nil {
t.Fatalf("failed to convert genTestChapter: %v", err)
}