Update some missed page moves
This commit is contained in:
parent
b3c016fe47
commit
34c71ec38a
4 changed files with 607 additions and 381 deletions
16
src/wiki.ts
16
src/wiki.ts
|
@ -33,6 +33,22 @@ export class WikiGameCacheFile extends YamlFile<WikiGameCache> {
|
|||
const pages: Array<{ pageid: number, title: string }> = JSON.parse(JSON.stringify(await wiki.categorymembers("Games")));
|
||||
for (const page of pages) {
|
||||
if (!this.data.hasOwnProperty(page.title)) {
|
||||
let newGame = true;
|
||||
for (const [k, v] of Object.entries(this.data)) {
|
||||
if (v.pageId === page.pageid) {
|
||||
newGame = false;
|
||||
this.data[page.title] = v;
|
||||
this.data[page.title].recentlyChanged = true;
|
||||
if (!(v.renamedFrom ?? []).includes(k)) {
|
||||
this.data[page.title].renamedFrom = [...(v.renamedFrom ?? []), k];
|
||||
}
|
||||
delete this.data[k];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!newGame) {
|
||||
continue;
|
||||
}
|
||||
this.data[page.title] = {
|
||||
pageId: page.pageid,
|
||||
revId: null,
|
||||
|
|
Reference in a new issue