Skip to main content

Module paths

Module paths 

Source
Expand description

Where the player keeps its configuration, caches, durable state, logs, and socket. The daemon and every client resolve these identically, so they always agree on the endpoint and on which files they share.

Every location has an explicit override: $MFP_SOCKET, $MFP_CONFIG_DIR, $MFP_CACHE_DIR, and $MFP_STATE_DIR. Isolating an instance takes all of them - scoping the socket alone leaves two daemons writing one state.json and one cache.

Functions§

audio_cache_dir
The directory holding <identifier>.mp3 and <identifier>.mp3.part files.
cache_dir
The directory holding the catalog cache and downloaded audio: $MFP_CACHE_DIR if set, otherwise ~/.cache/mfp on every platform.
catalog_cache_file
The normalised JSON document holding the cached catalog.
config_dir
The directory holding config.toml: $MFP_CONFIG_DIR if set, otherwise ~/.config/mfp on every platform.
config_file
The optional configuration file. Its absence is not an error; see crate::config.
ensure_socket_dir
Creates the socket’s parent directory mode 0700, tightening it if it already exists with broader permissions. Fails rather than binding when it belongs to another user, is a symbolic link, or is something other than a directory.
log_file
The file an autostarted daemon’s output is redirected to, and the path a client names when it reports the daemon as unreachable.
socket_path
The Unix domain socket the daemon listens on: $MFP_SOCKET if set, otherwise $XDG_RUNTIME_DIR/mfp/daemon.sock where that variable is set, and $TMPDIR/mfp-$UID/daemon.sock otherwise, with $TMPDIR falling back to /tmp.
state_dir
The directory holding state.json and daemon.log: $MFP_STATE_DIR if set, otherwise ~/.local/state/mfp on every platform.
state_file
The durable listening state file.
update_check_file
What the last version check found, and when. Beside the catalog cache rather than in the state directory: it is a remembered answer that can be deleted at any time, not state the player would miss.