summaryrefslogtreecommitdiff
path: root/mkvtool/main.go
diff options
context:
space:
mode:
authorac79b0c6 <[email protected]>2022-05-07 10:45:16 +0800
committerac79b0c6 <[email protected]>2022-05-07 10:45:16 +0800
commitd34cea33c9a9aed2f330713efdcb375e198ee287 (patch)
treeca153156516bf7c3e7ed968ee84d5ef244a5ff0c /mkvtool/main.go
parenta0b27e3e3caa53233f98106e69cfd3d47173b0ad (diff)
update mkvtool:fix caches
Diffstat (limited to 'mkvtool/main.go')
-rw-r--r--mkvtool/main.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/mkvtool/main.go b/mkvtool/main.go
index 12fd890..4d71da0 100644
--- a/mkvtool/main.go
+++ b/mkvtool/main.go
@@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"github.com/MkvAutoSubset/MkvAutoSubset/mkvlib"
- "github.com/google/uuid"
"io"
"io/ioutil"
"log"
@@ -17,7 +16,7 @@ import (
)
const appName = "MKV Tool"
-const appVer = "v3.8.7"
+const appVer = "v3.8.8"
const tTitle = appName + " " + appVer
var appFN = fmt.Sprintf("%s %s %s/%s", appName, appVer, runtime.GOOS, runtime.GOARCH)
@@ -88,7 +87,7 @@ func main() {
flag.BoolVar(&cc, "cc", false, "Create fonts cache.")
flag.Var(asses, "a", "ASS files. (multiple & join ass mode)")
flag.BoolVar(&n, "n", false, "Not do ass font subset & not change font name.")
- flag.BoolVar(&clean, "clean", false, "Clean original file subtitles and fonts. (create mode only)")
+ flag.BoolVar(&clean, "clean", false, "Clean original file subtitles and fonts for create mode, or clean old caches for create cache mode.")
flag.BoolVar(&ck, "ck", false, "Enable check mode.")
flag.BoolVar(&cks, "cks", false, "Enable strict mode for check.")
flag.StringVar(&sl, "sl", "chi", "Subtitle language. (create & make mode only)")
@@ -161,7 +160,11 @@ func main() {
}
if cc && s != "" {
- list := processer.CreateFontsCache(s, path.Join(cache_p, uuid.New().String()+".cache"), nil)
+ if clean {
+ _ = os.RemoveAll(cache_p)
+ }
+ p := path.Join(cache_p, path2MD5(s)+".cache")
+ list := processer.CreateFontsCache(s, p, nil)
el := len(list)
if el > 0 {
ec++