Skip to content

Commit

Permalink
IGDB various updates (#131)
Browse files Browse the repository at this point in the history
- updated deprecated API call (`age_ratings.`)
- added cover and screenshot scraping
- added ability to query IGDB with gameId (`--query="id=..."`)
- updated API enums for age ratings and regions
- fixed off-by-one bug in random pick
- replaced non-uniform random modulo with `bounded()`
  • Loading branch information
Gemba authored Mar 8, 2025
1 parent ae4f8d9 commit 46a58ca
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 81 deletions.
4 changes: 2 additions & 2 deletions docs/CONFIGINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -978,14 +978,14 @@ Some scraping modules require a `key` or `user:password` to work. You can create

```ini
[screenscraper]
userCreds="user:password"
userCreds="<account>:<password>"
```

or

```ini
[igdb]
userCreds="key"
userCreds="<Client-ID>:<Client-Secret>"
```

Default value: unset
Expand Down
3 changes: 3 additions & 0 deletions peas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,7 @@
"aliases": [
"dos",
"pc (microsoft windows)",
"linux",
"pc dos",
"pc win3.xx",
"steamos",
Expand Down Expand Up @@ -1521,6 +1522,7 @@
"ports": {
"aliases": [
"dos",
"linux",
"pc (microsoft windows)",
"pc dos",
"pc win3.xx",
Expand Down Expand Up @@ -1754,6 +1756,7 @@
"dos",
"microsoft xbox one",
"pc (microsoft windows)",
"linux",
"pc dos",
"pc win3.xx",
"sony playstation 4",
Expand Down
4 changes: 1 addition & 3 deletions src/abstractscraper.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ class AbstractScraper : public QObject {

QString lookupSearchName(const QFileInfo &info, const QString &baseName,
QString &debug);
QString lookupAliasMap(
const QString &baseName,
QString &debug);
QString lookupAliasMap(const QString &baseName, QString &debug);
MatchType type = ABSTRACT;

QList<int> fetchOrder;
Expand Down
2 changes: 1 addition & 1 deletion src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void Cli::showHint() {
hintsXml
.elementsByTagName("hint")
#if QT_VERSION >= 0x050a00
.at(QRandomGenerator::global()->generate() % hintNodes.length())
.at(QRandomGenerator::system()->bounded(hintNodes.length()))
#else
.at(qrand() % hintNodes.length())
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/gamebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void GamebaseScraper::getSearchResults(QList<GameEntry> &gameEntries,
oper = "LIKE";
}
clause = clause.arg(oper);
} else if (c== "Filename") {
} else if (c == "Filename") {
// match PIRATES!_05727_05.zip from gamefile PIRATES!.d64
clause = clause.arg(searchNameIsFilename ? "%" : "");
}
Expand Down
Loading

0 comments on commit 46a58ca

Please sign in to comment.