mp.utils.remove_file for JS API
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
There are:
https://github.com/mpv-player/mpv/blob/22e21edbd40ed0f937ab3bb52d0aa18db7ef18f8/player/javascript/defaults.js#L708-L709
https://github.com/mpv-player/mpv/blob/22e21edbd40ed0f937ab3bb52d0aa18db7ef18f8/player/javascript.c#L1211-L1212
but no mp.utils.remove_file which is also very useful.
Right now my workaround:
function remove_file(path: string) {
if (mp.get_property("platform") === "windows") {
mp.command_native({
name: "subprocess",
args: ["del", path],
playback_only: false,
});
} else {
mp.command_native({
name: "subprocess",
args: ["rm", path],
playback_only: false,
});
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing utility entries at player/javascript/defaults.js#L708-L709 and player/javascript.c#L1211-L1212. Trace how those JavaScript API utilities are exposed, then add the requested mp.utils.remove_file behavior with platform-independent file removal. Done means JavaScript callers can remove a file without using platform-specific subprocess commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100