Finding/editing runs of a deleted category
2 years ago
Arizona, USA

I'm looking to reinstate some deleted categories, and restore the runs that were deleted. I was wondering if there was a way to see runs on deleted categories, and move them to new ones. I'm able to recreate the deleted categories by using the aduit log, but I can't seem to find and edit the deleted runs.

Spain

Runs that are in a deleted category still exist in the API but with an invalid category id (Apparently they don't for Granny 2, maybe this is because they were "deleted" so long ago?) So here is a script in JavaScript that I've made to get them

const gameId = "w6jl725d" const deletedCategoryIds = await fetch(https://www.speedrun.com/api/v1/games/${gameId}/categories).then(async x => (await x.json()).data.map(cat => cat.id)) let deletedRuns = []

for(let offset = 0; ; offset++) { const {data, pagination} = await fetch(https://www.speedrun.com/api/v1/runs?game=${gameId}&max=200&offset=${offset * 200}).then(x => x.json()) deletedRuns.push(...data.filter(x => !deletedCategoryIds.includes(x.category)).map(x => ${x.weblink}/edit))

if(pagination.size < 200) break

}

console.log(deletedRuns.join("\n"))

Edytowane przez autor 2 years ago
Oh_my_gourdness i Jubilee podobało się to