Browse Source

rpdata-wikifileimport: Fixed it to use new models module.

1.1
Gisle Aune 6 years ago
parent
commit
b414cf118f
  1. 6
      cmd/rpdata-wikifileimport/main.go

6
cmd/rpdata-wikifileimport/main.go

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

Loading…
Cancel
Save