mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-13 20:18:52 +02:00
refactor: update import paths to use internal package
This commit is contained in:
@@ -24,7 +24,7 @@ changelog:
|
||||
order: 2
|
||||
builds:
|
||||
- id: cbzoptimizer
|
||||
main: main.go
|
||||
main: cmd/cbzoptimizer/main.go
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package cmd
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils"
|
||||
utils2 "github.com/belphemur/CBZOptimizer/v2/internal/utils"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/thediveo/enumflag/v2"
|
||||
"os"
|
||||
@@ -45,7 +45,7 @@ func ConvertCbzCommand(cmd *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("path is required")
|
||||
}
|
||||
|
||||
if !utils.IsValidFolder(path) {
|
||||
if !utils2.IsValidFolder(path) {
|
||||
return fmt.Errorf("the path needs to be a folder")
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ func ConvertCbzCommand(cmd *cobra.Command, args []string) error {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for path := range fileChan {
|
||||
err := utils.Optimize(&utils.OptimizeOptions{
|
||||
err := utils2.Optimize(&utils2.OptimizeOptions{
|
||||
ChapterConverter: chapterConverter,
|
||||
Path: path,
|
||||
Quality: quality,
|
@@ -1,11 +1,11 @@
|
||||
package cmd
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/belphemur/CBZOptimizer/v2/cbz"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/cbz"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
"github.com/spf13/cobra"
|
||||
"log"
|
||||
"os"
|
@@ -1,4 +1,4 @@
|
||||
package cmd
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
@@ -1,10 +1,10 @@
|
||||
package cmd
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils"
|
||||
utils2 "github.com/belphemur/CBZOptimizer/v2/internal/utils"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
"github.com/pablodz/inotifywaitgo/inotifywaitgo"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
@@ -53,7 +53,7 @@ func WatchCommand(_ *cobra.Command, args []string) error {
|
||||
return fmt.Errorf("path is required")
|
||||
}
|
||||
|
||||
if !utils.IsValidFolder(path) {
|
||||
if !utils2.IsValidFolder(path) {
|
||||
return fmt.Errorf("the path needs to be a folder")
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ func WatchCommand(_ *cobra.Command, args []string) error {
|
||||
for _, e := range event.Events {
|
||||
switch e {
|
||||
case inotifywaitgo.CLOSE_WRITE, inotifywaitgo.MOVE:
|
||||
err := utils.Optimize(&utils.OptimizeOptions{
|
||||
err := utils2.Optimize(&utils2.OptimizeOptions{
|
||||
ChapterConverter: chapterConverter,
|
||||
Path: event.Filename,
|
||||
Quality: quality,
|
16
cmd/cbzoptimizer/main.go
Normal file
16
cmd/cbzoptimizer/main.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/belphemur/CBZOptimizer/v2/cmd/cbzoptimizer/commands"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
commit = "none"
|
||||
date = "unknown"
|
||||
)
|
||||
|
||||
func main() {
|
||||
commands.SetVersionInfo(version, commit, date)
|
||||
commands.Execute()
|
||||
}
|
2
go.mod
2
go.mod
@@ -1,6 +1,6 @@
|
||||
module github.com/belphemur/CBZOptimizer/v2
|
||||
|
||||
go 1.23.1
|
||||
go 1.24
|
||||
|
||||
toolchain go1.24.0
|
||||
|
||||
|
@@ -3,8 +3,8 @@ package cbz
|
||||
import (
|
||||
"archive/zip"
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
|
||||
"os"
|
||||
"time"
|
||||
)
|
@@ -4,8 +4,8 @@ import (
|
||||
"archive/zip"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
@@ -6,8 +6,8 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/araddon/dateparse"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"strings"
|
@@ -3,9 +3,9 @@ package utils
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/cbz"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter"
|
||||
errors2 "github.com/belphemur/CBZOptimizer/v2/converter/errors"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/cbz"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
|
||||
errors2 "github.com/belphemur/CBZOptimizer/v2/pkg/converter/errors"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
16
main.go
16
main.go
@@ -1,16 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/belphemur/CBZOptimizer/v2/cmd"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
commit = "none"
|
||||
date = "unknown"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd.SetVersionInfo(version, commit, date)
|
||||
cmd.Execute()
|
||||
}
|
@@ -2,9 +2,9 @@ package converter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/webp"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/webp"
|
||||
"github.com/samber/lo"
|
||||
"strings"
|
||||
)
|
@@ -2,9 +2,9 @@ package converter
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
"golang.org/x/exp/slices"
|
||||
"image"
|
||||
"image/jpeg"
|
@@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
|
||||
converterrors "github.com/belphemur/CBZOptimizer/v2/converter/errors"
|
||||
"github.com/belphemur/CBZOptimizer/v2/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
|
||||
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
|
||||
converterrors "github.com/belphemur/CBZOptimizer/v2/pkg/converter/errors"
|
||||
"github.com/oliamb/cutter"
|
||||
"golang.org/x/exp/slices"
|
||||
_ "golang.org/x/image/webp"
|
Reference in New Issue
Block a user