pub fn distribution_into_platform(
distribution: Distribution,
) -> Result<Platform>Expand description
Converts a thunderstore Distribution into a loadsmith_platform::Platform.
Handles Steam (with numeric ID), Epic Games, Xbox Game Pass, Oculus, Origin, and generic platforms.
ยงExamples
use loadsmith_thunderstore::distribution_into_platform;
use thunderstore::models::schema::Distribution;
let json = r#"{"platform": "steam", "identifier": "12345"}"#;
let dist: Distribution = serde_json::from_str(json).unwrap();
let platform = distribution_into_platform(dist).unwrap();
assert!(matches!(platform, loadsmith_platform::Platform::Steam { id: 12345 }));