diff options
author | Keuin <[email protected]> | 2023-07-01 21:52:08 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-01 21:52:27 +0800 |
commit | 40e0b3172af1e8deab80a7bf2bf95337ef9201c6 (patch) | |
tree | 2b99c5028a1b799d0887f028351bde3560f72d5c /recording/runner.go | |
parent | 6c3c988bae6f8a78afd3503743106395792ee2b0 (diff) |
Refactor: replace homemade result handling with library.
Diffstat (limited to 'recording/runner.go')
-rw-r--r-- | recording/runner.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/recording/runner.go b/recording/runner.go index f12e9cd..4145d5f 100644 --- a/recording/runner.go +++ b/recording/runner.go @@ -13,6 +13,7 @@ import ( "github.com/keuin/slbr/bilibili" "github.com/keuin/slbr/common" "github.com/keuin/slbr/logging" + "github.com/samber/mo" "io" "os" "path" @@ -276,7 +277,7 @@ func record( var extName string // the real extension name (without renaming) - originalExtName := common.Errorable[string](common.GetFileExtensionFromUrl(streamSource.URL)).OrElse("flv") + originalExtName := mo.TupleToResult(common.GetFileExtensionFromUrl(streamSource.URL)).OrElse("flv") if task.Download.UseSpecialExtNameBeforeFinishing { extName = kSpecialExtName |