Skip to content

Commit

Permalink
Merge pull request #161 from Frodo45127/master
Browse files Browse the repository at this point in the history
Add file_name field to QueryResult.
  • Loading branch information
Noxime authored Apr 26, 2024
2 parents f5cff60 + fce751f commit 96b0c95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ugc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,9 @@ impl<'a> QueryResults<'a> {
num_children: raw_details.m_unNumChildren,
tags,
tags_truncated: raw_details.m_bTagsTruncated,
file_name: CStr::from_ptr(raw_details.m_pchFileName.as_ptr())
.to_string_lossy()
.into_owned(),
file_type: raw_details.m_eFileType.into(),
file_size: raw_details.m_nFileSize.max(0) as u32,
})
Expand Down Expand Up @@ -1786,6 +1789,8 @@ pub struct QueryResult {
pub accepted_for_use: bool,
pub tags: Vec<String>,
pub tags_truncated: bool,
/// Original file name of the workshop item. Used in old games, like Total War: Shogun 2.
pub file_name: String,
pub file_type: FileType,
pub file_size: u32,

Expand Down

0 comments on commit 96b0c95

Please sign in to comment.