resize images for index page
This commit is contained in:
parent
554ffcccbc
commit
b6fd0b50ab
7 changed files with 635 additions and 26 deletions
25
scripts/fix_image.js
Executable file
25
scripts/fix_image.js
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/env node
|
||||
|
||||
import GameCommon from '../common/GameCommon.js'
|
||||
import { logger } from '../common/Util.js'
|
||||
import Game from '../server/Game.js'
|
||||
|
||||
const log = logger('fix_image.js')
|
||||
|
||||
function fix(gameId) {
|
||||
Game.loadGame(gameId)
|
||||
let changed = false
|
||||
|
||||
let imgUrl = GameCommon.getImageUrl(gameId)
|
||||
if (imgUrl.match(/^\/example-images\//)) {
|
||||
log.log(`found bad imgUrl: ${imgUrl}`)
|
||||
imgUrl = imgUrl.replace(/^\/example-images\//, '/uploads/')
|
||||
GameCommon.setImageUrl(gameId, imgUrl)
|
||||
changed = true
|
||||
}
|
||||
if (changed) {
|
||||
Game.persistGame(gameId)
|
||||
}
|
||||
}
|
||||
|
||||
fix(process.argv[2])
|
||||
Loading…
Add table
Add a link
Reference in a new issue