[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix UTF-8 chars panic

Kasper (Sep 16, 2025, 12:51 PM +0200) 735f9c92 d2593692

+6 -2
+1
src-native/data_js.rs
··· 20 20 library_path: Option<String>, 21 21 env: Env, 22 22 ) -> Result<()> { 23 + // This does not work on macOS 23 24 std::panic::set_hook(Box::new(move |info| { 24 25 let thread = std::thread::current(); 25 26 let thread_name = thread.name().unwrap_or("<unnamed>");
+5 -2
src-native/filter.rs
··· 58 58 } 59 59 60 60 fn strip_prefix_ignore_case<'a>(text: &'a str, prefix: &str) -> Option<&'a str> { 61 - if text.len() >= prefix.len() && text[..prefix.len()].eq_ignore_ascii_case(prefix) { 61 + if text.len() >= prefix.len() && text.get(..prefix.len())?.eq_ignore_ascii_case(prefix) { 62 62 Some(&text[prefix.len()..]) 63 63 } else { 64 64 None ··· 66 66 } 67 67 68 68 fn strip_suffix_ignore_case<'a>(text: &'a str, suffix: &str) -> Option<&'a str> { 69 - if text.len() >= suffix.len() && text[text.len() - suffix.len()..].eq_ignore_ascii_case(suffix) 69 + if text.len() >= suffix.len() 70 + && text 71 + .get(text.len() - suffix.len()..)? 72 + .eq_ignore_ascii_case(suffix) 70 73 { 71 74 Some(&text[..text.len() - suffix.len()]) 72 75 } else {