diff --git a/Cargo.lock b/Cargo.lock index a6c67f1..ff4cea4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.5" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1f23fa97e1d1641371b51f35535cb26959b8e27ab50d167a8b996b5bada819" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" dependencies = [ "clap_builder", "clap_derive", @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.5" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdc5d93c358224b4d6867ef1356d740de2303e9892edc06c5340daeccd96bab" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" dependencies = [ "anstream", "anstyle", @@ -661,7 +661,7 @@ dependencies = [ [[package]] name = "iso2god" -version = "1.4.7" +version = "1.4.8" dependencies = [ "anyhow", "bitflags 2.2.1", diff --git a/Cargo.toml b/Cargo.toml index 03c334c..771e6a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iso2god" -version = "1.4.7" +version = "1.4.8" description = "A tool to convert between Xbox 360 ISO and Games On Demand file formats" repository = "https://github.com/iliazeus/iso2god-rs" edition = "2021" diff --git a/src/god/file_layout.rs b/src/god/file_layout.rs index 6425a5b..15cefb4 100644 --- a/src/god/file_layout.rs +++ b/src/god/file_layout.rs @@ -29,11 +29,19 @@ impl<'a> FileLayout<'a> { hex::encode_upper(self.exe_info.title_id) } + fn content_type_string(&self) -> String { + format!("{:08X}", self.content_type as u32) + } + + fn media_id_string(&self) -> String { + hex::encode_upper(self.exe_info.media_id) + } + pub fn data_dir_path(&self) -> PathBuf { self.base_path - .join(hex::encode_upper(self.exe_info.title_id)) - .join(format!("{:08X}", self.content_type as u32)) - .join(self.title_id_string() + ".data") + .join(self.title_id_string()) + .join(self.content_type_string()) + .join(self.media_id_string() + ".data") } pub fn part_file_path(&'a self, part_index: u64) -> PathBuf { @@ -42,8 +50,8 @@ impl<'a> FileLayout<'a> { pub fn con_header_file_path(&self) -> PathBuf { self.base_path - .join(hex::encode_upper(self.exe_info.title_id)) - .join(format!("{:08X}", self.content_type as u32)) .join(self.title_id_string()) + .join(self.content_type_string()) + .join(self.media_id_string()) } }