mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-13 13:47:21 -05:00
prevented unnecessary automatic updates
This commit is contained in:
@@ -746,37 +746,7 @@ fn main() {
|
||||
app_data.join("vyla-home-files")
|
||||
};
|
||||
|
||||
let version_file = vyla_files.join("version.json");
|
||||
let current_app_version = app.package_info().version.to_string();
|
||||
let mut version_mismatch = false;
|
||||
|
||||
if version_file.exists() {
|
||||
if let Ok(content) = std::fs::read_to_string(&version_file) {
|
||||
if let Ok(json) = serde_json::from_str::<serde_json::Value>(&content) {
|
||||
if let Some(version) = json.get("version").and_then(|v| v.as_str()) {
|
||||
if version != current_app_version {
|
||||
version_mismatch = true;
|
||||
}
|
||||
} else {
|
||||
version_mismatch = true;
|
||||
}
|
||||
} else {
|
||||
version_mismatch = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if version_mismatch {
|
||||
debug_log(&format!(
|
||||
"App version updated to {}. Cleaning old files.",
|
||||
current_app_version
|
||||
));
|
||||
let dirs_to_remove = ["frontend", "player", "stream-api", "auth-proxy", "config"];
|
||||
for d in dirs_to_remove {
|
||||
let _ = std::fs::remove_dir_all(vyla_files.join(d));
|
||||
}
|
||||
let _ = std::fs::remove_file(&version_file);
|
||||
}
|
||||
let _ = std::fs::create_dir_all(&vyla_files);
|
||||
|
||||
let window = WebviewWindowBuilder::new(app, "main", WebviewUrl::App("index.html".into()))
|
||||
.title("Vyla Home")
|
||||
|
||||
@@ -569,15 +569,14 @@ void main() {
|
||||
if (progressTrack) progressTrack.style.display = "block";
|
||||
const percent = data.percent || 0;
|
||||
if (progressFill) progressFill.style.width = percent + "%";
|
||||
if (!currentStatusText.startsWith("Downloading update...")) {
|
||||
setStatus("Downloading update...");
|
||||
}
|
||||
setStatus(`Downloading update (${percent}%)...`);
|
||||
}
|
||||
});
|
||||
|
||||
eventApi.listen("update-available", (e) => {
|
||||
const data = e.payload || e;
|
||||
if (data) {
|
||||
if (progressTrack) progressTrack.style.display = "none";
|
||||
setStatus(`Update Available: ${data.latest} (Current: ${data.current})`);
|
||||
if (actionsEl) actionsEl.style.display = "flex";
|
||||
}
|
||||
@@ -586,6 +585,8 @@ void main() {
|
||||
eventApi.listen("ready", (e) => {
|
||||
const data = e.payload || e;
|
||||
if (data && data.url) {
|
||||
if (progressTrack) progressTrack.style.display = "none";
|
||||
if (actionsEl) actionsEl.style.display = "none";
|
||||
setStatus("Launching...");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user