mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Command to update content hashes
This commit is contained in:
parent
c939022b92
commit
759520b3fa
1 changed files with 16 additions and 0 deletions
|
|
@ -328,12 +328,28 @@ program
|
|||
"--refresh-archive-files",
|
||||
"Refresh the data we keep about files within skin archives"
|
||||
)
|
||||
.option(
|
||||
"--refresh-content-hash",
|
||||
"Refresh content hash"
|
||||
)
|
||||
.action(
|
||||
async ({
|
||||
uploadIaScreenshot,
|
||||
uploadMissingScreenshots,
|
||||
refreshArchiveFiles,
|
||||
refreshContentHash
|
||||
}) => {
|
||||
if (refreshContentHash) {
|
||||
const ctx = new UserContext();
|
||||
const skinRows = await knex("skins").select();
|
||||
console.log(`Found ${skinRows.length} skins to update`);
|
||||
const skins = skinRows.map((row) => new SkinModel(ctx, row));
|
||||
for (const skin of skins) {
|
||||
await Skins.setContentHash(skin.getMd5());
|
||||
process.stdout.write(".");
|
||||
}
|
||||
|
||||
}
|
||||
if (uploadIaScreenshot) {
|
||||
const md5 = uploadIaScreenshot;
|
||||
if (!(await SyncToArchive.uploadScreenshotIfSafe(md5))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue