Add script type detect for paz archive

This commit is contained in:
2025-11-02 19:49:36 +08:00
parent 22544bef9d
commit ec0a962365

View File

@@ -435,6 +435,18 @@ impl<T: Read> ArchiveContent for PazFileEntry<T> {
fn name(&self) -> &str {
&self.entry.name
}
fn script_type(&self) -> Option<&ScriptType> {
let ext_name = std::path::Path::new(&self.entry.name)
.extension()
.and_then(|s| s.to_str())
.unwrap_or("")
.to_lowercase();
match ext_name.as_str() {
"sc" => Some(&ScriptType::Musica),
_ => None,
}
}
}
#[test]