Handle articles without categories

This commit is contained in:
mtkennerly 2024-04-22 00:15:23 -04:00
parent baf3084f90
commit 378878c49e
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
4 changed files with 8 additions and 27 deletions

View file

@ -440528,19 +440528,6 @@ Paper Beast - Folded Edition:
- config - config
steam: steam:
id: 1403830 id: 1403830
Paper Cut Mansion:
gog:
id: 1702566435
installDir:
PaperCutMansion: {}
launch:
"<base>/PaperCutMansion.exe":
- when:
- bit: 64
os: windows
store: steam
steam:
id: 1004370
Paper Dungeons: Paper Dungeons:
installDir: installDir:
Paper Dungeons: {} Paper Dungeons: {}

View file

@ -18314,7 +18314,6 @@
* [Paparazzi](https://www.pcgamingwiki.com/wiki/?curid=48677) * [Paparazzi](https://www.pcgamingwiki.com/wiki/?curid=48677)
* [Paparazzi Simulator](https://www.pcgamingwiki.com/wiki/?curid=154404) * [Paparazzi Simulator](https://www.pcgamingwiki.com/wiki/?curid=154404)
* [Paparazzi!: Tales of Tinseltown](https://www.pcgamingwiki.com/wiki/?curid=177406) * [Paparazzi!: Tales of Tinseltown](https://www.pcgamingwiki.com/wiki/?curid=177406)
* [Paper Cut Mansion](https://www.pcgamingwiki.com/wiki/?curid=182965)
* [Paper Dungeons](https://www.pcgamingwiki.com/wiki/?curid=48170) * [Paper Dungeons](https://www.pcgamingwiki.com/wiki/?curid=48170)
* [Paper Dungeons Crawler](https://www.pcgamingwiki.com/wiki/?curid=91188) * [Paper Dungeons Crawler](https://www.pcgamingwiki.com/wiki/?curid=91188)
* [Paper Fire Rookie](https://www.pcgamingwiki.com/wiki/?curid=73302) * [Paper Fire Rookie](https://www.pcgamingwiki.com/wiki/?curid=73302)

View file

@ -127104,10 +127104,6 @@ Paper Beast - Folded Edition:
templates: templates:
- "{{Game data/config|Windows|{{p|hkcu}}\\SOFTWARE\\Pixel Reef\\Paper Beast\\}}" - "{{Game data/config|Windows|{{p|hkcu}}\\SOFTWARE\\Pixel Reef\\Paper Beast\\}}"
- "{{Game data/saves|Windows|{{p|userprofile}}\\AppData\\LocalLow\\Pixel Reef\\Paper Beast\\PaperBeast.save}}" - "{{Game data/saves|Windows|{{p|userprofile}}\\AppData\\LocalLow\\Pixel Reef\\Paper Beast\\PaperBeast.save}}"
Paper Cut Mansion:
gog: 1702566435
pageId: 182965
steam: 1004370
Paper Dungeons: Paper Dungeons:
pageId: 48170 pageId: 48170
steam: 283040 steam: 283040

View file

@ -76,10 +76,8 @@ async fn is_game_article(query: &str) -> Result<bool, Error> {
{ {
let title = page["title"].as_str().ok_or(Error::WikiData("query.pages[].title"))?; let title = page["title"].as_str().ok_or(Error::WikiData("query.pages[].title"))?;
if title == query { if title == query {
for category in page["categories"] if let Some(categories) = page["categories"].as_array() {
.as_array() for category in categories {
.ok_or(Error::WikiData("query.pages[].categories"))?
{
let category_name = category["title"] let category_name = category["title"]
.as_str() .as_str()
.ok_or(Error::WikiData("query.pages[].categories[].title"))?; .ok_or(Error::WikiData("query.pages[].categories[].title"))?;
@ -89,6 +87,7 @@ async fn is_game_article(query: &str) -> Result<bool, Error> {
} }
} }
} }
}
Ok(false) Ok(false)
} }