Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ wgpu-hal = { version = "30.0.1", default-features = false, features = ["vulkan"]
objc2-core-foundation = { version = "0.3.2", default-features = false }
objc2-core-graphics = { version = "0.3.2", default-features = false }
objc2-app-kit = { version = "0.3.2", default-features = false }
objc2-avf-audio = { version = "0.3.2", default-features = false }
objc2-core-media = { version = "0.3.2", default-features = false }
objc2-core-video = { version = "0.3.2", default-features = false }
objc2-foundation = { version = "0.3.2", default-features = false }
Expand Down
18 changes: 15 additions & 3 deletions crates/hypercolor-core/src/effect/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,21 @@ fn deterministic_html_effect_id(source_path: &Path) -> EffectId {
}

fn stable_bundled_html_effect_id(source_path: &Path) -> Option<EffectId> {
bundled_effect_slug(source_path).map(|slug| {
deterministic_html_effect_id_from_key(&format!("hypercolor:html-bundled:{slug}"))
})
bundled_effect_slug(source_path).map(|slug| bundled_html_effect_id(&slug))
}

/// The id a bundled HTML effect carries, derived from its file stem alone.
///
/// A file under an `effects/bundled` or `effects/hypercolor` root hashes only
/// its lowercased stem, never the directory it was installed into, so a stem
/// names the same effect on every install and platform. The same file under
/// any other root gets a path-derived id and never matches this one.
#[must_use]
pub fn bundled_html_effect_id(stem: &str) -> EffectId {
deterministic_html_effect_id_from_key(&format!(
"hypercolor:html-bundled:{}",
stem.trim().to_ascii_lowercase()
))
}

fn html_effect_id(
Expand Down
4 changes: 2 additions & 2 deletions crates/hypercolor-core/src/effect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pub use factory::{
};
pub use lightscript::{LightScriptFrameUpdateOptions, LightscriptRuntime, normalized_level_to_db};
pub use loader::{
HtmlDiscoveryError, HtmlDiscoveryReport, default_effect_search_paths, load_html_effect_file,
register_html_effects, register_html_effects_stepped,
HtmlDiscoveryError, HtmlDiscoveryReport, bundled_html_effect_id, default_effect_search_paths,
load_html_effect_file, register_html_effects, register_html_effects_stepped,
};
pub use meta_parser::{
HtmlControlKind, HtmlControlMetadata, ParsedHtmlEffectMetadata, parse_html_effect_metadata,
Expand Down
Loading
Loading