summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorac79b0c6 <[email protected]>2022-12-31 12:10:53 +0800
committerac79b0c6 <[email protected]>2022-12-31 12:10:53 +0800
commit85e08f0ee477d746ecf57b64ecee530ecc6a61de (patch)
tree2cc7afb6711a421e6dba74206b88cddf403b46c3
parentabad000ef4e9534cf8efa162ad25df72b6b6b70b (diff)
update mkvtool:mkvlib bump to v2.2.3
-rw-r--r--mkvtool/go.mod2
-rw-r--r--mkvtool/main.go27
2 files changed, 22 insertions, 7 deletions
diff --git a/mkvtool/go.mod b/mkvtool/go.mod
index 89a25f0..b03797f 100644
--- a/mkvtool/go.mod
+++ b/mkvtool/go.mod
@@ -3,7 +3,7 @@ module github.com/MkvAutoSubset/MkvAutoSubset/mkvtool
go 1.19
require (
- github.com/MkvAutoSubset/MkvAutoSubset/mkvlib v0.0.0-20221216025925-1ebdc4ead628
+ github.com/MkvAutoSubset/MkvAutoSubset/mkvlib v0.0.0-20221231040854-abad000ef4e9
github.com/fatih/color v1.13.0
github.com/mattn/go-colorable v0.1.9
)
diff --git a/mkvtool/main.go b/mkvtool/main.go
index 362f8ed..cb597dd 100644
--- a/mkvtool/main.go
+++ b/mkvtool/main.go
@@ -11,13 +11,14 @@ import (
"net/http"
"os"
"path"
+ "path/filepath"
"regexp"
"runtime"
"strings"
)
const appName = "MKV Tool"
-const appVer = "v4.2.4"
+const appVer = "v4.2.5"
const tTitle = appName + " " + appVer
var appFN = fmt.Sprintf("%s %s %s/%s", appName, appVer, runtime.GOOS, runtime.GOARCH)
@@ -272,15 +273,29 @@ func main() {
return
}
if m {
- if !processer.MakeMKVs(s, data, dist, sl, st, nil) {
+ if !processer.MakeMKVs(s, data, dist, sl, st, true, nil) {
ec++
}
return
}
- if !processer.DumpMKVs(s, data, true, nil) {
- ec++
- } else if !processer.MakeMKVs(s, data, dist, sl, st, nil) {
- ec++
+ s, _ = filepath.Abs(s)
+ dist, _ = filepath.Abs(dist)
+ files, _ := findPath(s, `\.mkv$`)
+ for _, item := range files {
+ if strings.HasPrefix(item, dist) {
+ continue
+ }
+ p := strings.TrimPrefix(item, s)
+ _d, _, _, _f := splitPath(p)
+ p = path.Join(data, _d, _f)
+ if !processer.DumpMKV(item, p, true, nil) {
+ ec++
+ }
+ }
+ if ec == 0 {
+ if !processer.MakeMKVs(s, data, dist, sl, st, true, nil) {
+ ec++
+ }
}
return
} else {