Filter out secondary IDs that also appear as primary IDs

This commit is contained in:
mtkennerly 2024-05-20 21:03:35 -04:00
parent 6b03d46b67
commit e0d2092c5e
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
3 changed files with 39 additions and 95 deletions

View file

@ -28684,8 +28684,6 @@ Alone in the Dark 2:
gog: gog:
id: 1207660963 id: 1207660963
id: id:
gogExtra:
- 1207658923
lutris: alone-in-the-dark-2 lutris: alone-in-the-dark-2
steam: steam:
id: 548890 id: 548890
@ -28699,8 +28697,6 @@ Alone in the Dark 3:
gog: gog:
id: 1207660973 id: 1207660973
id: id:
gogExtra:
- 1207658923
lutris: alone-in-the-dark-3 lutris: alone-in-the-dark-3
steam: steam:
id: 548900 id: 548900
@ -56720,8 +56716,6 @@ Baldr Sky:
gog: gog:
id: 1207658886 id: 1207658886
id: id:
gogExtra:
- 1207666353
lutris: baldurs-gate-the-original-saga lutris: baldurs-gate-the-original-saga
"Baldur's Gate 3": "Baldur's Gate 3":
files: files:
@ -56832,8 +56826,6 @@ Baldr Sky:
gog: gog:
id: 1207658893 id: 1207658893
id: id:
gogExtra:
- 1207666373
lutris: baldurs-gate-ii-complete lutris: baldurs-gate-ii-complete
"Baldur's Gate III": "Baldur's Gate III":
alias: "Baldur's Gate 3" alias: "Baldur's Gate 3"
@ -120463,7 +120455,6 @@ Cogmind:
id: 1207659633 id: 1207659633
id: id:
gogExtra: gogExtra:
- 1207659633
- 1207659643 - 1207659643
- 1207659653 - 1207659653
- 1207659663 - 1207659663
@ -144291,9 +144282,6 @@ DRAG:
- config - config
when: when:
- os: windows - os: windows
id:
steamExtra:
- 773840
installDir: installDir:
DRAG: {} DRAG: {}
launch: launch:
@ -174908,7 +174896,6 @@ Don Bradman Cricket 17:
- 1739447650 - 1739447650
- 1742170347 - 1742170347
steamExtra: steamExtra:
- 1335800
- 1606220 - 1606220
installDir: installDir:
dont_forget_me: {} dont_forget_me: {}
@ -180402,9 +180389,6 @@ Dragon of Legends:
steam: steam:
id: 663530 id: 663530
"Dragon's Prophet": "Dragon's Prophet":
id:
steamExtra:
- 1380940
steam: steam:
id: 1380940 id: 1380940
"Dragon's Wake": "Dragon's Wake":
@ -185065,9 +185049,6 @@ DrummingVR:
- save - save
when: when:
- os: windows - os: windows
id:
steamExtra:
- 1039290
installDir: installDir:
Drumpf 2 Lost But Not Forgotten: {} Drumpf 2 Lost But Not Forgotten: {}
launch: launch:
@ -186347,8 +186328,6 @@ Duke Nukem 3D:
id: 1207658730 id: 1207658730
id: id:
lutris: duke-nukem-3d lutris: duke-nukem-3d
steamExtra:
- 225140
installDir: installDir:
Duke Nukem 3D: {} Duke Nukem 3D: {}
launch: launch:
@ -192877,7 +192856,6 @@ EXceed - Gun Bullet Children:
- os: windows - os: windows
id: id:
steamExtra: steamExtra:
- 15960
- 59925 - 59925
installDir: installDir:
eXceed - Gun Bullet Children: {} eXceed - Gun Bullet Children: {}
@ -199131,7 +199109,6 @@ Elven Legacy:
id: id:
lutris: elven-legacy lutris: elven-legacy
steamExtra: steamExtra:
- 25850
- 25880 - 25880
- 42930 - 42930
- 42940 - 42940
@ -215597,7 +215574,6 @@ Fabula Mortis:
id: id:
steamExtra: steamExtra:
- 1310220 - 1310220
- 2060550
installDir: installDir:
Fabular Once upon a Spacetime: {} Fabular Once upon a Spacetime: {}
launch: launch:
@ -225994,8 +225970,6 @@ Final Doom:
gog: gog:
id: 1435848742 id: 1435848742
id: id:
gogExtra:
- 1440161275
lutris: final-doom lutris: final-doom
installDir: installDir:
Final Doom: {} Final Doom: {}
@ -265960,7 +265934,6 @@ Gremlins vs Automatons:
- 1615869028 - 1615869028
- 1964148149 - 1964148149
steamExtra: steamExtra:
- 369990
- 458160 - 458160
- 459850 - 459850
- 459851 - 459851
@ -296346,7 +296319,6 @@ House Flipper:
steamExtra: steamExtra:
- 825570 - 825570
- 942290 - 942290
- 1021110
- 1126050 - 1126050
- 1460920 - 1460920
- 1569190 - 1569190
@ -304165,8 +304137,6 @@ Icewind Dale:
gog: gog:
id: 1207658888 id: 1207658888
id: id:
gogExtra:
- 1207666683
lutris: icewind-dale-1-complete lutris: icewind-dale-1-complete
Icewind Dale II: Icewind Dale II:
files: files:
@ -319174,7 +319144,6 @@ Jagged Alliance 2:
steamExtra: steamExtra:
- 2950 - 2950
- 12370 - 12370
- 12380
- 545210 - 545210
steam: steam:
id: 1620 id: 1620
@ -319192,9 +319161,6 @@ Jagged Alliance 2:
- os: windows - os: windows
gog: gog:
id: 1207658653 id: 1207658653
id:
steamExtra:
- 1620
installDir: installDir:
Jagged Alliance 2 Gold Unfinished Business: {} Jagged Alliance 2 Gold Unfinished Business: {}
launch: launch:
@ -320331,8 +320297,6 @@ Jazz Jackrabbit 2:
gog: gog:
id: 1917711239 id: 1917711239
id: id:
gogExtra:
- 1917711239
lutris: jazz-jackrabbit-2 lutris: jazz-jackrabbit-2
"Jazz Lightning : Castle Dungeons": "Jazz Lightning : Castle Dungeons":
installDir: installDir:
@ -346833,8 +346797,6 @@ Leisure Suit Larry - Wet Dreams Dry Twice:
gog: gog:
id: 1207662073 id: 1207662073
id: id:
gogExtra:
- 1207659158
lutris: leisure-suit-larry-5-passionate-patti-does-a-littl lutris: leisure-suit-larry-5-passionate-patti-does-a-littl
installDir: installDir:
Larry Suit Larry 5 Passionate Patti Does a Little Undercover Work: {} Larry Suit Larry 5 Passionate Patti Does a Little Undercover Work: {}
@ -346889,8 +346851,6 @@ Leisure Suit Larry Goes Looking for Love (in Several Wrong Places):
gog: gog:
id: 1207662053 id: 1207662053
id: id:
gogExtra:
- 1207659158
lutris: leisure-suit-larry-2-looking-for-love-in-several-w lutris: leisure-suit-larry-2-looking-for-love-in-several-w
installDir: installDir:
Leisure Suit Larry 2 Looking For Love (In Several Wrong Places): {} Leisure Suit Larry 2 Looking For Love (In Several Wrong Places): {}
@ -346917,8 +346877,6 @@ Leisure Suit Larry Goes Looking for Love (in Several Wrong Places):
gog: gog:
id: 1207662063 id: 1207662063
id: id:
gogExtra:
- 1207659158
lutris: leisure-suit-larry-3-passionate-patti-in-pursuit-o lutris: leisure-suit-larry-3-passionate-patti-in-pursuit-o
installDir: installDir:
Leisure Suit Larry 3 Passionate Patti in Pursuit of the Pulsating Pectorals: {} Leisure Suit Larry 3 Passionate Patti in Pursuit of the Pulsating Pectorals: {}
@ -348615,9 +348573,6 @@ Level 22:
- os: windows - os: windows
gog: gog:
id: 1454602861 id: 1454602861
id:
steamExtra:
- 293300
installDir: installDir:
Level22: {} Level22: {}
launch: launch:
@ -353370,7 +353325,6 @@ Little Nightmares:
gogExtra: gogExtra:
- 1185734803 - 1185734803
- 1352220891 - 1352220891
- 1433377508
- 1675156362 - 1675156362
- 1863057712 - 1863057712
- 1866912153 - 1866912153
@ -356572,8 +356526,6 @@ Lords of the Realm II:
gog: gog:
id: 1207663263 id: 1207663263
id: id:
gogExtra:
- 1207658780
lutris: lords-of-the-realm-ii lutris: lords-of-the-realm-ii
installDir: installDir:
Lords of the Realm II: {} Lords of the Realm II: {}
@ -410863,8 +410815,6 @@ Neighbours Back from Hell:
id: 2053240278 id: 2053240278
id: id:
lutris: neighbours-back-from-hell lutris: neighbours-back-from-hell
steamExtra:
- 1283190
installDir: installDir:
Neighbours back From Hell: {} Neighbours back From Hell: {}
launch: launch:
@ -410903,8 +410853,6 @@ Neighbours from Hell:
gogExtra: gogExtra:
- 1207658765 - 1207658765
lutris: neighbours-from-hell lutris: neighbours-from-hell
steamExtra:
- 1283190
installDir: installDir:
Neighbours from Hell: {} Neighbours from Hell: {}
launch: launch:
@ -442512,9 +442460,6 @@ Papercraft:
when: when:
- os: windows - os: windows
store: steam store: steam
id:
steamExtra:
- 905660
installDir: installDir:
PaperWar: {} PaperWar: {}
launch: launch:
@ -466102,9 +466047,6 @@ Prison Planet:
steam: steam:
id: 1148410 id: 1148410
Prison Princess: Prison Princess:
id:
steamExtra:
- 1151740
installDir: installDir:
Prison Princess: {} Prison Princess: {}
launch: launch:
@ -494918,8 +494860,6 @@ Return to Castle Wolfenstein:
gogExtra: gogExtra:
- 1441704976 - 1441704976
lutris: return-to-castle-wolfenstein lutris: return-to-castle-wolfenstein
steamExtra:
- 1379630
installDir: installDir:
Return to Castle Wolfenstein: {} Return to Castle Wolfenstein: {}
launch: launch:
@ -503539,9 +503479,6 @@ Rocket League:
steam: steam:
id: 252950 id: 252950
Rocket Mania: Rocket Mania:
id:
steamExtra:
- 1949810
installDir: installDir:
RocketMania: {} RocketMania: {}
launch: launch:
@ -504858,7 +504795,6 @@ Rogue Trooper Redux:
gogExtra: gogExtra:
- 1360356045 - 1360356045
- 1639809483 - 1639809483
- 2076502816
steamExtra: steamExtra:
- 710410 - 710410
installDir: installDir:
@ -528659,7 +528595,6 @@ Shadow Warrior (2013):
id: 1207659573 id: 1207659573
id: id:
gogExtra: gogExtra:
- 1429878383
- 1430392753 - 1430392753
lutris: shadow-warrior lutris: shadow-warrior
installDir: installDir:
@ -549744,9 +549679,6 @@ Softened Cookie:
Softporn Adventure: Softporn Adventure:
gog: gog:
id: 1207662103 id: 1207662103
id:
gogExtra:
- 1207659158
Software Inc.: Software Inc.:
files: files:
"<base>/Saves": "<base>/Saves":
@ -560551,8 +560483,6 @@ Spear of Destiny:
gog: gog:
id: 1441705126 id: 1441705126
id: id:
gogExtra:
- 1441705226
lutris: wolfenstein-3d-spear-of-destiny lutris: wolfenstein-3d-spear-of-destiny
steamExtra: steamExtra:
- 9000 - 9000
@ -582947,8 +582877,6 @@ Sudden Strike 2:
gog: gog:
id: 1421964930 id: 1421964930
id: id:
gogExtra:
- 1421964930
lutris: sudden-strike-2-gold lutris: sudden-strike-2-gold
installDir: installDir:
Sudden Strike 2 Gold: {} Sudden Strike 2 Gold: {}
@ -635608,7 +635536,6 @@ The Outer Worlds:
- 1393110 - 1393110
- 1393111 - 1393111
- 1425450 - 1425450
- 1920490
installDir: installDir:
TheOuterWorlds: {} TheOuterWorlds: {}
steam: steam:
@ -637873,9 +637800,6 @@ The Raven Remastered:
- os: linux - os: linux
gog: gog:
id: 1749614448 id: 1749614448
id:
gogExtra:
- 1749614448
installDir: installDir:
The Raven Remastered: {} The Raven Remastered: {}
launch: launch:
@ -641626,7 +641550,6 @@ The Sinking City:
id: 1134504983 id: 1134504983
id: id:
gogExtra: gogExtra:
- 1134504983
- 1281247417 - 1281247417
- 1705130517 - 1705130517
- 1801191124 - 1801191124
@ -660381,7 +660304,6 @@ Torimodosu:
- 1563444452 - 1563444452
- 1700870503 - 1700870503
- 1832019184 - 1832019184
- 1958306970
lutris: torment-tides-of-numenera lutris: torment-tides-of-numenera
steamExtra: steamExtra:
- 342210 - 342210
@ -665397,7 +665319,6 @@ Train Simulator:
- 277747 - 277747
- 277748 - 277748
- 277749 - 277749
- 277751
- 277752 - 277752
- 277753 - 277753
- 277754 - 277754
@ -675404,9 +675325,6 @@ Two Worlds II Castle Defense:
- os: windows - os: windows
gog: gog:
id: 1207661843 id: 1207661843
id:
gogExtra:
- 1207659214
installDir: installDir:
Two Worlds II Castle Defense: {} Two Worlds II Castle Defense: {}
launch: launch:
@ -683890,9 +683808,6 @@ Urban Empire:
store: steam store: steam
gog: gog:
id: 1936881415 id: 1936881415
id:
gogExtra:
- 1936881415
installDir: installDir:
Urban Empire: {} Urban Empire: {}
launch: launch:
@ -693087,8 +693002,6 @@ Viscera Cleanup Detail:
gog: gog:
id: 1429878383 id: 1429878383
id: id:
gogExtra:
- 1207659573
lutris: viscera-cleanup-detail-shadow-warrior lutris: viscera-cleanup-detail-shadow-warrior
installDir: installDir:
Viscera Cleanup Detail Shadow Warrior: {} Viscera Cleanup Detail Shadow Warrior: {}
@ -710587,7 +710500,6 @@ Wildlife Park:
id: id:
steamExtra: steamExtra:
- 337970 - 337970
- 664120
installDir: installDir:
Wildlife Park: {} Wildlife Park: {}
launch: launch:
@ -724482,7 +724394,6 @@ Yooka-Laylee:
id: id:
gogExtra: gogExtra:
- 1354053863 - 1354053863
- 1445853962
steamExtra: steamExtra:
- 426750 - 426750
installDir: installDir:

View file

@ -4,7 +4,7 @@ use crate::{
path, path,
resource::ResourceFile, resource::ResourceFile,
steam::{self, SteamCache, SteamCacheEntry}, steam::{self, SteamCache, SteamCacheEntry},
wiki::{PathKind, WikiCache, WikiCacheEntry}, wiki::{PathKind, PrimaryIds, WikiCache, WikiCacheEntry},
Error, Error,
}; };
@ -153,13 +153,15 @@ impl Manifest {
) -> Result<(), Error> { ) -> Result<(), Error> {
self.0.clear(); self.0.clear();
let primary_ids = wiki_cache.primary_ids();
for (title, info) in &wiki_cache.0 { for (title, info) in &wiki_cache.0 {
if overrides.0.get(title).map(|x| x.omit).unwrap_or(false) { if overrides.0.get(title).map(|x| x.omit).unwrap_or(false) {
continue; continue;
} }
let mut game = Game::default(); let mut game = Game::default();
game.integrate_wiki(info, title); game.integrate_wiki(info, title, &primary_ids);
for rename in &info.renamed_from { for rename in &info.renamed_from {
if rename.to_lowercase() == title.to_lowercase() || self.0.contains_key(rename) { if rename.to_lowercase() == title.to_lowercase() || self.0.contains_key(rename) {
continue; continue;
@ -213,14 +215,24 @@ pub struct Game {
} }
impl Game { impl Game {
pub fn integrate_wiki(&mut self, cache: &WikiCacheEntry, title: &str) { pub fn integrate_wiki(&mut self, cache: &WikiCacheEntry, title: &str, primary_ids: &PrimaryIds) {
self.steam = SteamMetadata { id: cache.steam }; self.steam = SteamMetadata { id: cache.steam };
self.gog = GogMetadata { id: cache.gog }; self.gog = GogMetadata { id: cache.gog };
self.id = IdMetadata { self.id = IdMetadata {
flatpak: None, flatpak: None,
gog_extra: cache.gog_side.clone(), gog_extra: cache
.gog_side
.iter()
.filter(|x| !primary_ids.gog.contains(x))
.copied()
.collect(),
lutris: cache.lutris.clone(), lutris: cache.lutris.clone(),
steam_extra: cache.steam_side.clone(), steam_extra: cache
.steam_side
.iter()
.filter(|x| !primary_ids.steam.contains(x))
.copied()
.collect(),
}; };
let paths = cache.parse_paths(title.to_string()); let paths = cache.parse_paths(title.to_string());

View file

@ -1,4 +1,4 @@
use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use regex::Regex; use regex::Regex;
@ -92,6 +92,12 @@ async fn is_game_article(query: &str) -> Result<bool, Error> {
Ok(false) Ok(false)
} }
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct PrimaryIds {
pub steam: HashSet<u32>,
pub gog: HashSet<u64>,
}
impl WikiCache { impl WikiCache {
pub async fn flag_recent_changes(&mut self, meta: &mut WikiMetaCache) -> Result<(), Error> { pub async fn flag_recent_changes(&mut self, meta: &mut WikiMetaCache) -> Result<(), Error> {
struct RecentChange { struct RecentChange {
@ -379,6 +385,21 @@ impl WikiCache {
Ok(()) Ok(())
} }
pub fn primary_ids(&self) -> PrimaryIds {
let mut out = PrimaryIds::default();
for info in self.0.values() {
if let Some(id) = info.steam {
out.steam.insert(id);
}
if let Some(id) = info.gog {
out.gog.insert(id);
}
}
out
}
} }
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]