{"record":{"id":"2c4fdb01db5e1219","repo":"tonhowtf/omniget","slug":"dentro-do-flatpak-o-spicetify-nao-consegue-alterar-o-spotify","errorCode":null,"errorMessage":"dentro do Flatpak o Spicetify nao consegue alterar o Spotify do sistema","messagePattern":"dentro do Flatpak o Spicetify nao consegue alterar o Spotify do sistema","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/spicetify.rs","lineNumber":511,"sourceCode":"        .unpack(dest)\n        .map_err(|e| anyhow!(\"tar.gz invalido: {}\", e))?;\n    Ok(())\n}\n\n#[cfg(unix)]\nfn make_executable(path: &Path) {\n    use std::os::unix::fs::PermissionsExt;\n    let _ = std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o755));\n}\n\n#[cfg(not(unix))]\nfn make_executable(_path: &Path) {}\n\n/// Baixa o último release do CLI para `<app_data>/bin/spicetify-cli/`.\n/// A pasta antiga só sai depois que a nova está inteira no disco.\npub async fn install() -> anyhow::Result<PathBuf> {\n    if dependencies::is_flatpak() {\n        return Err(anyhow!(\n            \"dentro do Flatpak o Spicetify nao consegue alterar o Spotify do sistema\"\n        ));\n    }\n    let suffix = cli_asset_suffix()?;\n    let dir = managed_dir().ok_or_else(|| anyhow!(\"Could not determine data directory\"))?;\n    let client = github_client()?;\n    let asset = latest_asset(&client, CLI_REPO, |n| n.ends_with(suffix)).await?;\n    tracing::info!(\"[spicetify] baixando {} ({})\", asset.name, asset.tag);\n    let data = download_verified(&client, &asset).await?;\n\n    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    std::fs::create_dir_all(&staging)?;\n    let is_zip = asset.name.ends_with(\".zip\");\n    let staging_clone = staging.clone();\n    tokio::task::spawn_blocking(move || {\n        if is_zip {\n            unpack_zip(&data, &staging_clone)","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/spicetify.rs#L493-L529","documentation":"`install` refuses to download/install the Spicetify CLI when the app itself is running inside a Flatpak sandbox. A sandboxed app cannot properly modify the host's Spotify installation, so the operation is blocked up-front with this explanatory error rather than failing confusingly later.","triggerScenarios":"Calling `install()` (via `instala_e_le_status`) when `dependencies::is_flatpak()` is true — i.e. the app was installed as a Flatpak and the user tries to manage the system Spotify through it.","commonSituations":"User installed the app from Flathub and attempts to install Spicetify; Flatpak sandbox lacks host filesystem/access to Spotify; user expects Spicetify features to work in the sandboxed build.","solutions":["Install the app via a non-sandboxed method (native package: .deb/.rpm/AUR, or a non-Flatpak build) to manage Spicetify","Install and manage spicetify-cli directly on the host: `curl -fsSL https://raw.githubusercontent.com/spicetify/spicetify-cli/master/install.sh | sh`","If the Spicetify CLI already exists on the host, point the app at it instead of triggering a fresh install inside the sandbox","Grant the Flatpak host access (`flatpak override --user --filesystem=host`) — may help detection but does not fully enable spicetify's host modifications"],"exampleFix":"// before\nlet path = install().await?; // hard error in Flatpak\n// after\nif dependencies::is_flatpak() {\n    ui::show_hint(\"Use the native package or install spicetify on the host manually.\");\n    return Ok(PathBuf::new()); // degrade gracefully instead of erroring\n}\nlet path = install().await?;","handlingStrategy":"fallback","validationCode":"// before calling install():\nif dependencies::is_flatpak() {\n    eprintln!(\"Running under Flatpak — spicetify install unavailable; use native package.\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"match install().await {\n    Err(e) if e.to_string().contains(\"Flatpak\") => {\n        show_hint(\"Install via native package or run spicetify on the host manually.\");\n    }\n    other => other,\n}","preventionTips":["Check `dependencies::is_flatpak()` early and hide/disable Spicetify UI in Flatpak builds","Document the Flatpak limitation for users of the sandboxed distribution","Offer host-side spicetify install instructions as the alternative path"],"tags":["flatpak","sandbox","platform","spicetify"],"backgroundTag":"unsupported-platform","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}