summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--mkvlib/ass.go4
-rw-r--r--mkvlib/go.mod6
-rw-r--r--mkvlib/mkv.go2
-rw-r--r--mkvlib/shared.go2
-rw-r--r--mkvlib/utils.go3
6 files changed, 10 insertions, 9 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2ae3bd1..f47eb39 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: 1.17
+ go-version: 1.18
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
diff --git a/mkvlib/ass.go b/mkvlib/ass.go
index 58a1910..b0b2426 100644
--- a/mkvlib/ass.go
+++ b/mkvlib/ass.go
@@ -11,6 +11,7 @@ import (
"io/ioutil"
"os"
"path"
+ "path/filepath"
"regexp"
"strconv"
"strings"
@@ -524,6 +525,9 @@ func (self *assProcessor) replaceFontNameInAss() bool {
func (self *assProcessor) createFontsCache(output string) []string {
cache := make([]fontCache, 0)
+ if !filepath.IsAbs(self._fonts) {
+ self._fonts, _ = filepath.Abs(self._fonts)
+ }
fonts := findFonts(self._fonts)
ok := 0
l := len(fonts)
diff --git a/mkvlib/go.mod b/mkvlib/go.mod
index 0d20ee5..dd11794 100644
--- a/mkvlib/go.mod
+++ b/mkvlib/go.mod
@@ -1,10 +1,10 @@
module github.com/KurenaiRyu/MkvAutoSubset/mkvlib
-go 1.17
+go 1.18
require (
- github.com/antchfx/xmlquery v1.3.8
- github.com/asticode/go-astisub v0.20.0
+ github.com/antchfx/xmlquery v1.3.10
+ github.com/asticode/go-astisub v0.21.0
)
require (
diff --git a/mkvlib/mkv.go b/mkvlib/mkv.go
index 039697b..2ce06ec 100644
--- a/mkvlib/mkv.go
+++ b/mkvlib/mkv.go
@@ -176,7 +176,7 @@ func (self *mkvProcessor) CreateMKV(file string, tracks, attachments []string, o
}
if p, err := newProcess(nil, nil, nil, "", mkvmerge, args...); err == nil {
s, err := p.Wait()
- return err == nil && s.ExitCode() == 0
+ return err == nil && s.ExitCode() != 2
}
return false
}
diff --git a/mkvlib/shared.go b/mkvlib/shared.go
index 8d89cde..8b562c4 100644
--- a/mkvlib/shared.go
+++ b/mkvlib/shared.go
@@ -11,7 +11,7 @@ import (
)
const libName = "mkvlib"
-const libVer = "v1.2.9"
+const libVer = "v1.3.0"
const LibFName = libName + " " + libVer
diff --git a/mkvlib/utils.go b/mkvlib/utils.go
index 4615975..802b94e 100644
--- a/mkvlib/utils.go
+++ b/mkvlib/utils.go
@@ -41,9 +41,6 @@ func findPath(path, expr string) (list []string, err error) {
}
err = queryPath(path, func(path string) bool {
if expr == "" || reg.MatchString(path) {
- if !filepath.IsAbs(path) {
- path, _ = filepath.Abs(path)
- }
list = append(list, path)
}
return true