mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-10-13 19:20:48 +02:00
chore: linter
This commit is contained in:
1 parent
f397568785
commit
bb2eb65c1e
3 files changed
+27
-40
No files matched your search
+22
-33
@@ -740,7 +740,7 @@ impl ApiClient {
|
|||||||
|
|
||||||
// Get platform info to filter appropriate releases
|
// Get platform info to filter appropriate releases
|
||||||
let (os, arch) = Self::get_platform_info();
|
let (os, arch) = Self::get_platform_info();
|
||||||
|
|
||||||
// Filter releases that have assets compatible with the current platform
|
// Filter releases that have assets compatible with the current platform
|
||||||
let mut filtered_releases: Vec<GithubRelease> = releases
|
let mut filtered_releases: Vec<GithubRelease> = releases
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@@ -781,46 +781,35 @@ impl ApiClient {
|
|||||||
match os {
|
match os {
|
||||||
"windows" => {
|
"windows" => {
|
||||||
// For Windows, look for standalone setup EXE (not the auto-updater one)
|
// For Windows, look for standalone setup EXE (not the auto-updater one)
|
||||||
assets
|
assets.iter().any(|asset| {
|
||||||
.iter()
|
let name = asset.name.to_lowercase();
|
||||||
.any(|asset| {
|
name.contains("standalone") && name.ends_with(".exe") && !name.contains("silent")
|
||||||
let name = asset.name.to_lowercase();
|
}) || assets.iter().any(|asset| asset.name.ends_with(".exe"))
|
||||||
name.contains("standalone") && name.ends_with(".exe") && !name.contains("silent")
|
|
||||||
})
|
|
||||||
|| assets.iter().any(|asset| asset.name.ends_with(".exe"))
|
|
||||||
}
|
}
|
||||||
"macos" => {
|
"macos" => {
|
||||||
// For macOS, prefer universal DMG
|
// For macOS, prefer universal DMG
|
||||||
assets
|
assets.iter().any(|asset| {
|
||||||
.iter()
|
let name = asset.name.to_lowercase();
|
||||||
.any(|asset| {
|
name.contains("universal") && name.ends_with(".dmg")
|
||||||
let name = asset.name.to_lowercase();
|
}) || assets.iter().any(|asset| asset.name.ends_with(".dmg"))
|
||||||
name.contains("universal") && name.ends_with(".dmg")
|
|
||||||
})
|
|
||||||
|| assets.iter().any(|asset| asset.name.ends_with(".dmg"))
|
|
||||||
}
|
}
|
||||||
"linux" => {
|
"linux" => {
|
||||||
// For Linux, check for architecture-specific packages (prefer ZIP for stable releases)
|
// For Linux, check for architecture-specific packages (prefer ZIP for stable releases)
|
||||||
let arch_pattern = if arch == "arm64" { "arm64" } else { "amd64" };
|
let arch_pattern = if arch == "arm64" { "arm64" } else { "amd64" };
|
||||||
|
|
||||||
assets
|
assets.iter().any(|asset| {
|
||||||
.iter()
|
let name = asset.name.to_lowercase();
|
||||||
.any(|asset| {
|
name.contains("linux") && name.contains(arch_pattern) && name.ends_with(".zip")
|
||||||
let name = asset.name.to_lowercase();
|
}) || assets.iter().any(|asset| {
|
||||||
name.contains("linux") && name.contains(arch_pattern) && name.ends_with(".zip")
|
let name = asset.name.to_lowercase();
|
||||||
})
|
name.contains(arch_pattern) && (name.ends_with(".deb") || name.ends_with(".rpm"))
|
||||||
|| assets.iter().any(|asset| {
|
}) || assets.iter().any(|asset| {
|
||||||
let name = asset.name.to_lowercase();
|
let name = asset.name.to_lowercase();
|
||||||
name.contains(arch_pattern) && (name.ends_with(".deb") || name.ends_with(".rpm"))
|
name.contains("linux") && name.ends_with(".zip")
|
||||||
})
|
}) || assets.iter().any(|asset| {
|
||||||
|| assets.iter().any(|asset| {
|
let name = asset.name.to_lowercase();
|
||||||
let name = asset.name.to_lowercase();
|
name.ends_with(".deb") || name.ends_with(".rpm")
|
||||||
name.contains("linux") && name.ends_with(".zip")
|
})
|
||||||
})
|
|
||||||
|| assets.iter().any(|asset| {
|
|
||||||
let name = asset.name.to_lowercase();
|
|
||||||
name.ends_with(".deb") || name.ends_with(".rpm")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ impl BrowserVersionService {
|
|||||||
("windows", _) => (format!("brave-{version}.exe"), false),
|
("windows", _) => (format!("brave-{version}.exe"), false),
|
||||||
("linux", "x64") => (format!("brave-browser-{version}-linux-amd64.zip"), true),
|
("linux", "x64") => (format!("brave-browser-{version}-linux-amd64.zip"), true),
|
||||||
("linux", "arm64") => (format!("brave-browser-{version}-linux-arm64.zip"), true),
|
("linux", "arm64") => (format!("brave-browser-{version}-linux-arm64.zip"), true),
|
||||||
("macos", _) => (format!("Brave-Browser-universal.dmg"), true),
|
("macos", _) => ("Brave-Browser-universal.dmg".to_string(), true),
|
||||||
_ => {
|
_ => {
|
||||||
return Err(format!("Unsupported platform/architecture for Brave: {os}/{arch}").into())
|
return Err(format!("Unsupported platform/architecture for Brave: {os}/{arch}").into())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,12 +206,10 @@ impl Downloader {
|
|||||||
})
|
})
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
// Fallback to DEB packages
|
// Fallback to DEB packages
|
||||||
assets
|
assets.iter().find(|asset| {
|
||||||
.iter()
|
let name = asset.name.to_lowercase();
|
||||||
.find(|asset| {
|
name.contains(arch_pattern) && name.ends_with(".deb")
|
||||||
let name = asset.name.to_lowercase();
|
})
|
||||||
name.contains(arch_pattern) && name.ends_with(".deb")
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
// Fallback to any ZIP
|
// Fallback to any ZIP
|
||||||
|
|||||||
Reference in new issue
Block a user