introduce concept of context in various format, to communicate information found in detection phase to extractor

- this does bring inconsistency to the detectors of formats, but  I will work on fixing that. all detectors should be using Result<> anyway.
- also add some static values to mtk_pkg , mtk_bdp
- these improvements will be applied to other formats in future as well
This commit is contained in:
theubusu
2026-02-02 01:54:35 +01:00
parent 13482802ba
commit cf46b29e3d
7 changed files with 172 additions and 129 deletions
+2 -2
View File
@@ -111,10 +111,10 @@ pub fn extract_sony_bdp(mut file: &File, output_folder: &str) -> Result<(), Box<
if last_file_path.is_some() {
println!("\nChecking if it's also MTK BDP...");
let last_file = File::open(last_file_path.unwrap())?;
if formats::mtk_bdp::is_mtk_bdp_file(&last_file) {
if let Some(result) = formats::mtk_bdp::is_mtk_bdp_file(&last_file)? {
println!("- MTK BDP file detected!\n");
let mtk_extraction_path = format!("{}/{}", &output_folder, i - 1);
formats::mtk_bdp::extract_mtk_bdp(&last_file, &mtk_extraction_path)?;
formats::mtk_bdp::extract_mtk_bdp(&last_file, &mtk_extraction_path, result)?;
} else {
println!("- Not an MTK BDP file.");
}