Add easy way to verify games against the Redump database, supplied as CSV.

This commit is contained in:
Henrik Rydgård committed 2023-10-23 19:11:01 -05:00
1 parent 42dd37352f
commit 87ddb3f3b1
17 files changed
+333 -26

No files matched your search

+21 -2
View File
@@ -111,7 +111,7 @@ bool GameInfo::Delete() {
}
}
u64 GameInfo::GetGameSizeInBytes() {
u64 GameInfo::GetGameSizeOnDiskInBytes() {
switch (fileType) {
case IdentifiedFileType::PSP_PBP_DIRECTORY:
case IdentifiedFileType::PSP_SAVEDATA_DIRECTORY:
@@ -122,6 +122,22 @@ u64 GameInfo::GetGameSizeInBytes() {
}
}
u64 GameInfo::GetGameSizeUncompressedInBytes() {
switch (fileType) {
case IdentifiedFileType::PSP_PBP_DIRECTORY:
case IdentifiedFileType::PSP_SAVEDATA_DIRECTORY:
return File::ComputeRecursiveDirectorySize(ResolvePBPDirectory(filePath_));
default:
{
BlockDevice *blockDevice = constructBlockDevice(GetFileLoader().get());
u64 size = blockDevice->GetUncompressedSize();
delete blockDevice;
return size;
}
}
}
// Not too meaningful if the object itself is a savedata directory...
std::vector<Path> GameInfo::GetSaveDataDirectories() {
Path memc = GetSysDirectory(DIRECTORY_SAVEDATA);
@@ -659,10 +675,13 @@ handleELF:
if (info_->wantFlags & GAMEINFO_WANTSIZE) {
std::lock_guard<std::mutex> lock(info_->lock);
info_->gameSize = info_->GetGameSizeInBytes();
info_->gameSizeOnDisk = info_->GetGameSizeOnDiskInBytes();
info_->saveDataSize = info_->GetSaveDataSizeInBytes();
info_->installDataSize = info_->GetInstallDataSizeInBytes();
}
if (info_->wantFlags & GAMEINFO_WANTUNCOMPRESSEDSIZE) {
info_->gameSizeUncompressed = info_->GetGameSizeUncompressedInBytes();
}
// INFO_LOG(SYSTEM, "Completed writing info for %s", info_->GetTitle().c_str());
}