From 7fd817f6d1ead3de85294c1893a6e1572a1d12e3 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 7 Jul 2023 00:34:55 +0800 Subject: Refactor: move file operations into single package. --- recording/runner.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'recording/runner.go') diff --git a/recording/runner.go b/recording/runner.go index d43f451..13a4050 100644 --- a/recording/runner.go +++ b/recording/runner.go @@ -12,7 +12,7 @@ import ( "fmt" "github.com/keuin/slbr/bilibili" errs "github.com/keuin/slbr/bilibili/errors" - "github.com/keuin/slbr/common" + "github.com/keuin/slbr/common/files" "github.com/keuin/slbr/common/myurl" "github.com/keuin/slbr/logging" "github.com/samber/mo" @@ -298,7 +298,7 @@ func record( } baseName := GenerateFileName(profile.Data.Title, time.Now()) - fileName := common.CombineFileName(baseName, extName) + fileName := files.CombineFileName(baseName, extName) saveDir := task.Download.SaveDirectory filePath := path.Join(saveDir, fileName) @@ -315,7 +315,7 @@ func record( return } from := filePath - to := path.Join(saveDir, common.CombineFileName(baseName, originalExtName)) + to := path.Join(saveDir, files.CombineFileName(baseName, originalExtName)) err := os.Rename(from, to) if err != nil { logger.Error("Cannot rename %v to %v: %v", from, to, err) -- cgit v1.2.3