mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-22 07:18:38 +02:00
Six writers repeated the same publication sequence: create a temporary file in the target directory, write it, sync_all, optionally run a cancellation check, then NamedTempFile::persist over the target. `core::fs::write_atomic` runs exactly that order and optionally fsyncs the directory afterwards (best effort, as extension storage did). Each site keeps its temporary-file prefix (`.spotiflac-` for extension storage, `.spotiflac-m3u-` for M3U export, tempfile's `.tmp` default, exposed as `DEFAULT_TEMP_PREFIX`, for the registry cache, lyrics cache and both network cover writers), its check placement between fsync and rename, and its error text: `WriteAtomicError` displays a persist failure with tempfile's own message, and converts to the underlying io::Error where the site previously used `PersistError::error`. Not converted, because their publication differs: playlist staging and collection snapshots use persist_noclobber (collections also skips fsync), the backup restore stages into a temporary directory, and the extension package download maps each step to its own error context. spotiflac-core now depends on the workspace `tempfile` already used by the other crates; the lockfile only gains that edge.
28 lines
637 B
TOML
28 lines
637 B
TOML
[package]
|
|
name = "spotiflac-core"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
publish.workspace = true
|
|
|
|
[dependencies]
|
|
base64.workspace = true
|
|
image.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
regex.workspace = true
|
|
unicode-normalization.workspace = true
|
|
unicode-general-category.workspace = true
|
|
chrono.workspace = true
|
|
rustix.workspace = true
|
|
claxon.workspace = true
|
|
roxmltree.workspace = true
|
|
tempfile.workspace = true
|
|
|
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
|
tz-rs.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|