CBR -> CBZ
This commit is contained in:
parent
21c9631483
commit
eaa23d67dc
|
@ -1,3 +1,3 @@
|
||||||
# MangaDex to CBR downloader
|
# MangaDex to Comic Book downloader
|
||||||
|
|
||||||
Generate CBR comics from MangaDex releases
|
Generate CBZ comics from MangaDex releases
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/fmartingr/mangadex2cbr
|
module github.com/fmartingr/mangadex2cbz
|
||||||
|
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
|
|
2
main.go
2
main.go
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/fmartingr/mangadex2cbr/pkg/cli"
|
"github.com/fmartingr/mangadex2cbz/pkg/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fmartingr/go-mangadex"
|
"github.com/fmartingr/go-mangadex"
|
||||||
"github.com/fmartingr/mangadex2cbr/pkg/tasks"
|
"github.com/fmartingr/mangadex2cbz/pkg/tasks"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -310,7 +310,6 @@ func Start() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Zip folders into CBR files
|
|
||||||
logrus.Info("Compressing volumes")
|
logrus.Info("Compressing volumes")
|
||||||
|
|
||||||
files, errReadVolumes := ioutil.ReadDir(mangaOutputPath)
|
files, errReadVolumes := ioutil.ReadDir(mangaOutputPath)
|
||||||
|
@ -320,11 +319,11 @@ func Start() {
|
||||||
|
|
||||||
for file := range files {
|
for file := range files {
|
||||||
if files[file].IsDir() {
|
if files[file].IsDir() {
|
||||||
destinationPath := filepath.Join(mangaOutputPath, files[file].Name()) + ".cbr"
|
destinationPath := filepath.Join(mangaOutputPath, files[file].Name()) + ".cbz"
|
||||||
if !fileExists(destinationPath) {
|
if !fileExists(destinationPath) {
|
||||||
_, errZip := zipVolume(destinationPath)
|
_, errZip := zipVolume(destinationPath)
|
||||||
if errZip != nil {
|
if errZip != nil {
|
||||||
logrus.Errorf("Error packing CBR file: %s", errZip)
|
logrus.Errorf("Error packing CB file: %s", errZip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue