Feature: add tencent-cos options for url

ISSUES CLOSED: #862, #863, #865, #524, #845, #732
This commit is contained in:
PiEgg
2022-04-04 19:22:30 +08:00
parent f1c8507927
commit af291e4f11
13 changed files with 68 additions and 27 deletions

View File

@@ -35,6 +35,11 @@ const updateShortKeyFromVersion212 = (db: typeof ConfigStore, shortKeyConfig: IS
const migrateGalleryFromVersion230 = async (configDB: typeof ConfigStore, galleryDB: DBStore, picgo: PicGoCore) => {
const originGallery: ImgInfo[] = configDB.get('uploaded')
// if hasMigrate, we don't need to migrate
const hasMigrate: boolean = configDB.get('__migrateUploaded')
if (hasMigrate) {
return
}
const configPath = configDB.getConfigPath()
const configBakPath = path.join(path.dirname(configPath), 'config.bak.json')
// migrate gallery from config to gallery db
@@ -44,7 +49,8 @@ const migrateGalleryFromVersion230 = async (configDB: typeof ConfigStore, galler
}
await galleryDB.insertMany(originGallery)
picgo.saveConfig({
uploaded: []
uploaded: [],
__migrateUploaded: true
})
}
}