diff --git a/CHANGELOG.md b/CHANGELOG.md index 25309dd..b3a293d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed an incorrect definition of the preset discovery soundpack struct for the + preset discovery draft extension. + ## [0.3.0] - 2023-02-08 ### Added diff --git a/Cargo.lock b/Cargo.lock index 4db3bee..65cbd20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,7 +113,7 @@ dependencies = [ [[package]] name = "clap-sys" version = "0.3.0" -source = "git+https://github.com/robbert-vdh/clap-sys.git?rev=88261e494c1ea1e7bc30ec53bf191a0a3111f95c#88261e494c1ea1e7bc30ec53bf191a0a3111f95c" +source = "git+https://github.com/robbert-vdh/clap-sys.git?rev=cf5d36e9d1daa4b052c1a9e3d6d623b75734e65d#cf5d36e9d1daa4b052c1a9e3d6d623b75734e65d" [[package]] name = "clap-validator" diff --git a/Cargo.toml b/Cargo.toml index c1c71a5..9a02254 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ chrono = { version = "0.4.23", features = ["serde"] } # All the claps! clap = { version = "4.1.1", features = ["derive", "wrap_help"] } # For CLAP 1.1.7 support -clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", rev = "88261e494c1ea1e7bc30ec53bf191a0a3111f95c" } +clap-sys = { git = "https://github.com/robbert-vdh/clap-sys.git", rev = "cf5d36e9d1daa4b052c1a9e3d6d623b75734e65d" } colored = "2.0.0" crossbeam = "0.8.1" libloading = "0.7.3" diff --git a/src/commands/list.rs b/src/commands/list.rs index 4846d3b..f436b8f 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -181,8 +181,8 @@ where if let Some(homepage_url) = soundpack.homepage_url { println_wrapped!(wrapper, " homepage url: {homepage_url}"); } - if let Some(image_url) = soundpack.image_url { - println_wrapped!(wrapper, " image url: {image_url}"); + if let Some(image_uri) = soundpack.image_uri { + println_wrapped!(wrapper, " image url: {image_uri}"); } if let Some(release_timestamp) = soundpack.release_timestamp { println_wrapped!(wrapper, " released: {release_timestamp}"); diff --git a/src/plugin/preset_discovery/indexer.rs b/src/plugin/preset_discovery/indexer.rs index 44ea425..5f1dd16 100644 --- a/src/plugin/preset_discovery/indexer.rs +++ b/src/plugin/preset_discovery/indexer.rs @@ -246,7 +246,7 @@ pub struct Soundpack { pub description: Option, pub homepage_url: Option, pub vendor: Option, - pub image_url: Option, + pub image_uri: Option, pub release_timestamp: Option>, } @@ -255,11 +255,14 @@ impl Soundpack { pub fn from_descriptor(descriptor: &clap_preset_discovery_soundpack) -> Result { Ok(Soundpack { flags: Flags { - is_factory_content: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_FACTORY_CONTENT) + is_factory_content: (descriptor.flags + & CLAP_PRESET_DISCOVERY_IS_FACTORY_CONTENT as u64) != 0, - is_user_content: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_USER_CONTENT) != 0, - is_demo_content: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_DEMO_CONTENT) != 0, - is_favorite: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_FAVORITE) != 0, + is_user_content: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_USER_CONTENT as u64) + != 0, + is_demo_content: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_DEMO_CONTENT as u64) + != 0, + is_favorite: (descriptor.flags & CLAP_PRESET_DISCOVERY_IS_FAVORITE as u64) != 0, }, id: unsafe { util::cstr_ptr_to_mandatory_string(descriptor.id) } @@ -272,8 +275,8 @@ impl Soundpack { .context("Error parsing the soundpack's 'homepage_url' field")?, vendor: unsafe { util::cstr_ptr_to_optional_string(descriptor.vendor) } .context("Error parsing the soundpack's 'vendor' field")?, - image_url: unsafe { util::cstr_ptr_to_optional_string(descriptor.image_url) } - .context("Error parsing the soundpack's 'image_url' field")?, + image_uri: unsafe { util::cstr_ptr_to_optional_string(descriptor.image_uri) } + .context("Error parsing the soundpack's 'image_uri' field")?, release_timestamp: util::parse_timestamp(descriptor.release_timestamp) .context("Error parsing the soundpack's 'release_timestamp' field")?, })