mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Only load platforms for OS (#288)
* Only load platforms for OS * Update to version 1.7.10
This commit is contained in:
Generated
+1
-1
@@ -265,7 +265,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "boilr"
|
||||
version = "1.7.9"
|
||||
version = "1.7.10"
|
||||
dependencies = [
|
||||
"base64 0.20.0",
|
||||
"chrono",
|
||||
|
||||
+2
-4
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
edition = "2021"
|
||||
name = "boilr"
|
||||
version = "1.7.9"
|
||||
version = "1.7.10"
|
||||
|
||||
[dependencies]
|
||||
base64 = "^0.20.0"
|
||||
@@ -21,9 +21,6 @@ eyre = "^0.6.8"
|
||||
color-eyre = "^0.6.2"
|
||||
dyn-clone = "^1.0.10"
|
||||
|
||||
[dependencies.sqlite]
|
||||
version = "^0.30.3"
|
||||
|
||||
[dependencies.dashmap]
|
||||
features = ["serde"]
|
||||
version = "^5.4.0"
|
||||
@@ -65,6 +62,7 @@ winres = "^0.1.12"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
winreg = "^0.10.1"
|
||||
sqlite = "^0.30.3"
|
||||
|
||||
[features]
|
||||
# This feature is enabled when building for a flatpak environment
|
||||
|
||||
@@ -25,7 +25,16 @@ https://hughsie.github.io/oars/index.html
|
||||
-->
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="1.7.9" date="2022-12-28">
|
||||
<release version="1.7.10" date="2022-12-28">
|
||||
<description>
|
||||
<ul>
|
||||
<li>Only load platforms that are available for OS</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
|
||||
<release version="1.7.9" date="2022-12-28">
|
||||
<description>
|
||||
<ul>
|
||||
<li>Fix import button hidden on steam deck in game mode</li>
|
||||
|
||||
+15
-5
@@ -1,18 +1,28 @@
|
||||
mod amazon;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod bottles;
|
||||
mod egs;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod flatpak;
|
||||
mod gog;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod heroic;
|
||||
mod itch;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod legendary;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod lutris;
|
||||
#[cfg(target_family = "unix")]
|
||||
mod minigalaxy;
|
||||
|
||||
#[cfg(not(target_family = "unix"))]
|
||||
mod amazon;
|
||||
|
||||
|
||||
mod gog;
|
||||
mod itch;
|
||||
mod origin;
|
||||
mod platform;
|
||||
mod platforms_load;
|
||||
mod uplay;
|
||||
mod minigalaxy;
|
||||
|
||||
mod egs;
|
||||
pub(crate) use platform::*;
|
||||
|
||||
pub(crate) use gog::get_gog_shortcuts_from_game_folders;
|
||||
|
||||
@@ -1,23 +1,9 @@
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use crate::settings::load_setting_sections;
|
||||
|
||||
use super::amazon::AmazonPlatform;
|
||||
use super::bottles::BottlesPlatform;
|
||||
use super::egs::EpicPlatform;
|
||||
use super::flatpak::FlatpakPlatform;
|
||||
use super::gog::GogPlatform;
|
||||
use super::heroic::HeroicPlatform;
|
||||
use super::itch::ItchPlatform;
|
||||
use super::legendary::LegendaryPlatform;
|
||||
use super::lutris::LutrisPlatform;
|
||||
use super::minigalaxy::MiniGalaxyPlatform;
|
||||
use super::origin::OriginPlatform;
|
||||
use super::uplay::UplayPlatform;
|
||||
use super::GamesPlatform;
|
||||
|
||||
use crate::settings::load_setting_sections;
|
||||
const PLATFORM_NAMES: [&str; 12] = [
|
||||
"amazon",
|
||||
"bottles",
|
||||
@@ -30,7 +16,7 @@ const PLATFORM_NAMES: [&str; 12] = [
|
||||
"lutris",
|
||||
"origin",
|
||||
"uplay",
|
||||
"minigalaxy"
|
||||
"minigalaxy",
|
||||
];
|
||||
|
||||
pub type Platforms = Vec<Box<dyn GamesPlatform>>;
|
||||
@@ -41,19 +27,50 @@ pub fn load_platform<A: AsRef<str>, B: AsRef<str>>(
|
||||
) -> eyre::Result<Box<dyn GamesPlatform>> {
|
||||
let name = name.as_ref();
|
||||
let s = settings_string.as_ref();
|
||||
|
||||
#[cfg(not(target_family = "unix"))]
|
||||
{
|
||||
//Windows only platforms
|
||||
use super::amazon::AmazonPlatform;
|
||||
match name {
|
||||
"amazon" => return load::<AmazonPlatform>(s),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
use super::bottles::BottlesPlatform;
|
||||
use super::flatpak::FlatpakPlatform;
|
||||
use super::heroic::HeroicPlatform;
|
||||
use super::legendary::LegendaryPlatform;
|
||||
use super::lutris::LutrisPlatform;
|
||||
use super::minigalaxy::MiniGalaxyPlatform;
|
||||
//Linux only platforms
|
||||
match name {
|
||||
"bottles" => return load::<BottlesPlatform>(s),
|
||||
"flatpak" => return load::<FlatpakPlatform>(s),
|
||||
"minigalaxy" => return load::<MiniGalaxyPlatform>(s),
|
||||
"legendary" => return load::<LegendaryPlatform>(s),
|
||||
"lutris" => return load::<LutrisPlatform>(s),
|
||||
"heroic" => return load::<HeroicPlatform>(s),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
//Common platforms
|
||||
use super::egs::EpicPlatform;
|
||||
use super::gog::GogPlatform;
|
||||
use super::itch::ItchPlatform;
|
||||
use super::origin::OriginPlatform;
|
||||
use super::uplay::UplayPlatform;
|
||||
|
||||
match name {
|
||||
"amazon" => load::<AmazonPlatform>(s),
|
||||
"bottles" => load::<BottlesPlatform>(s),
|
||||
"epic_games" => load::<EpicPlatform>(s),
|
||||
"uplay" => load::<UplayPlatform>(s),
|
||||
"itch" => load::<ItchPlatform>(s),
|
||||
"flatpak" => load::<FlatpakPlatform>(s),
|
||||
"gog" => load::<GogPlatform>(s),
|
||||
"heroic" => load::<HeroicPlatform>(s),
|
||||
"legendary" => load::<LegendaryPlatform>(s),
|
||||
"lutris" => load::<LutrisPlatform>(s),
|
||||
"origin" => load::<OriginPlatform>(s),
|
||||
"minigalaxy" => load::<MiniGalaxyPlatform>(s),
|
||||
_ => Err(eyre::format_err!("Unknown platform named {name}")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user