Skip to content

Commit

Permalink
use media ids for data paths
Browse files Browse the repository at this point in the history
iliazeus committed May 3, 2023
1 parent 82edc84 commit 7a79894
Showing 3 changed files with 19 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
18 changes: 13 additions & 5 deletions src/god/file_layout.rs
Original file line number Diff line number Diff line change
@@ -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())
}
}

0 comments on commit 7a79894

Please sign in to comment.