diff options
author | Keuin <[email protected]> | 2023-07-07 00:34:55 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-07 00:34:55 +0800 |
commit | 7fd817f6d1ead3de85294c1893a6e1572a1d12e3 (patch) | |
tree | 38b9f13104fe208449b679a2b77959dea5ab1b4e /recording | |
parent | 6eb5a7af48d04adc5625cbc8355e2556db4b992f (diff) |
Refactor: move file operations into single package.
Diffstat (limited to 'recording')
-rw-r--r-- | recording/runner.go | 6 |
1 files changed, 3 insertions, 3 deletions
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) |