https://github.com/pacexy/mpv-persist
Persist certain properties to the directory-specific configuration file.
https://github.com/pacexy/mpv-persist
mpv mpv-script
Last synced: about 2 months ago
JSON representation
Persist certain properties to the directory-specific configuration file.
- Host: GitHub
- URL: https://github.com/pacexy/mpv-persist
- Owner: pacexy
- Created: 2024-12-02T02:14:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-17T23:42:38.000Z (over 1 year ago)
- Last Synced: 2026-02-10T10:14:22.448Z (4 months ago)
- Topics: mpv, mpv-script
- Language: Lua
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mpv-persist
Persist certain properties to the [directory-specific configuration file](https://mpv.io/manual/stable/#file-specific-configuration-files).
## Installation
1. Download `persist.lua`.
2. Place it in the `scripts` directory of your mpv installation.
For more details, see [Script location - mpv.io](https://mpv.io/manual/stable/#script-location).
## Configuration
1. Download `persist.conf`.
2. Place it in the `script-opts` directory of your mpv installation.
For more details, see [`mp.options` functions - mpv.io](https://mpv.io/manual/stable/#mp-options-functions).
### `props`
The `props` option contains the list of properties to be persisted.
By default, the following properties are persisted:
- `volume`
- `sid`
- `sub-delay`
- `secondary-sid`
- `secondary-sub-delay`
### How it works
1. Observes property changes.
2. Persists these properties.
3. Loads them on the `file-loaded` event, which is necessary to prevent [unexpected property resets](https://github.com/mpv-player/mpv/issues/13670).
## References
- [File-specific Configuration Files - mpv.io](https://mpv.io/manual/stable/#file-specific-configuration-files)
- [`reset-on-next-file` - mpv.io](https://mpv.io/manual/stable/#options-reset-on-next-file)