admin: introducing speedy deep sync and themed deep sync

This commit is contained in:
nemunaire 2020-01-20 08:41:36 +01:00
parent f7762c0828
commit a4c87b92a5
5 changed files with 170 additions and 31 deletions

View file

@ -52,10 +52,23 @@ func init() {
return map[string]interface{}{"progress": sync.DeepSyncProgress}, nil
}
}))
router.POST("/api/sync/speed", apiHandler(
func(_ httprouter.Params, _ []byte) (interface{}, error) {
st := sync.SpeedySyncDeep(sync.GlobalImporter)
sync.EditDeepReport(st, false)
return st, nil
}))
router.POST("/api/sync/deep", apiHandler(
func(_ httprouter.Params, _ []byte) (interface{}, error) {
return sync.SyncDeep(sync.GlobalImporter), nil
}))
router.POST("/api/sync/deep/:thid", apiHandler(themeHandler(
func(theme fic.Theme, _ []byte) (interface{}, error) {
st := sync.SyncThemeDeep(sync.GlobalImporter, theme, 0, 250)
sync.EditDeepReport(map[string][]string{theme.Name: st}, false)
sync.DeepSyncProgress = 255
return st, nil
})))
router.POST("/api/sync/themes", apiHandler(
func(_ httprouter.Params, _ []byte) (interface{}, error) {
return sync.SyncThemes(sync.GlobalImporter), nil