mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Skip extras without filename
This commit is contained in:
parent
0230a3517d
commit
584b953bd7
@ -2250,9 +2250,13 @@ std::vector<gameFile> Downloader::getExtrasFromJSON(const Json::Value& json, con
|
||||
path = "/" + gamename + "/extras/" + path;
|
||||
}
|
||||
|
||||
// Get name from path if name was not specified
|
||||
// Get filename
|
||||
std::string filename;
|
||||
filename.assign(path.begin()+path.find_last_of("/")+1,path.end());
|
||||
|
||||
// Use filename if name was not specified
|
||||
if (name.empty())
|
||||
name.assign(path.begin()+path.find_last_of("/")+1,path.end());
|
||||
name = filename;
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
@ -2263,6 +2267,15 @@ std::vector<gameFile> Downloader::getExtrasFromJSON(const Json::Value& json, con
|
||||
continue;
|
||||
}
|
||||
|
||||
if (filename.empty())
|
||||
{
|
||||
#ifdef DEBUG
|
||||
std::cerr << "DEBUG INFO (getExtrasFromJSON)" << std::endl;
|
||||
std::cerr << "Skipped file without a filename (game: " << gamename << ", fileid: " << id << ", name: " << name << ")" << std::endl;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
extras.push_back(
|
||||
gameFile ( false,
|
||||
id,
|
||||
|
Loading…
Reference in New Issue
Block a user