Skip to content

Commit

Permalink
Add copy: protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 7, 2023
1 parent 3d08b48 commit 1dec8a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ New:
- Add `metadata.replaygain` method to extract unified replay gain value from metadata (#3438).
- Add `compute` parameter to `file.replaygain` to control gain calculation (#3438).
- Add `compute` parameter to `enable_replaygain_metadata` to control replay gain calculation (#3438).
- Add `copy:` protocol (##3506)

Changed:

Expand Down
19 changes: 19 additions & 0 deletions src/libs/protocols.liq
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,25 @@ protocol.add(
syntax="stereo:<uri>"
)

# Copy

# @flag hidden
def protocol.copy(~rlog=_, ~maxtime=_, arg) =
extname = file.extension(arg)
tmpfile = file.temp("tmp", extname)
file.copy(force=true, arg, tmpfile)
[tmpfile]
end

protocol.add(
static=true,
"copy",
protocol.copy,
doc=
"Copy file to a temporary destination",
syntax="copy:/path/to/file.extname"
)

# Text2wave
let settings.protocol.text2wave = settings.make.protocol("text2wave")
let settings.protocol.text2wave.path =
Expand Down

0 comments on commit 1dec8a7

Please sign in to comment.