|
|
@ -9,7 +9,7 @@ import ( |
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/internal/config" |
|
|
|
"git.aiterp.net/rpdata/api/internal/store" |
|
|
|
"git.aiterp.net/rpdata/api/model/file" |
|
|
|
"git.aiterp.net/rpdata/api/models/files" |
|
|
|
) |
|
|
|
|
|
|
|
func main() { |
|
|
@ -33,7 +33,7 @@ func main() { |
|
|
|
store.Init() |
|
|
|
|
|
|
|
for _, info := range data.Query.Allimages { |
|
|
|
existing, err := file.FindName("wiki", info.Name, info.User) |
|
|
|
existing, err := files.FindName("wiki", info.Name, info.User) |
|
|
|
if err == nil && existing.ID != "" { |
|
|
|
log.Println("Skipping", info.Name, "because it already exists") |
|
|
|
continue |
|
|
@ -45,7 +45,7 @@ func main() { |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
file, err := file.Insert(info.Name, "wiki", info.Mime, info.User, ts, info.Size, info.URL) |
|
|
|
file, err := files.Insert(info.Name, "wiki", info.Mime, info.User, ts, info.Size, info.URL) |
|
|
|
if err != nil { |
|
|
|
log.Println("Skipping", info.Name, "error:", err) |
|
|
|
continue |
|
|
|