Use file name and extension in file struct

This commit is contained in:
2022-07-16 05:18:57 +00:00
committed by GitHub
parent 9fea200eaf
commit 4b4aefffb8
2 changed files with 28 additions and 52 deletions

View File

@@ -314,7 +314,19 @@ impl FanboxFile {
self.data["url"].as_str()
}
create_fanbox_download_helper!(url);
create_fanbox_download_helper!(url, {
match self.name() {
Some(name) => match self.extension() {
Some(ext) => {
dh.set_file_name((name.to_owned() + "." + ext).as_str());
}
None => {
dh.set_file_name(name);
}
},
None => {}
}
});
}
impl CheckUnknown for FanboxFile {