aboutsummaryrefslogtreecommitdiff
path: root/tools/animeimporter
diff options
context:
space:
mode:
Diffstat (limited to 'tools/animeimporter')
-rw-r--r--tools/animeimporter/ACDv2Reader.go4
-rw-r--r--tools/animeimporter/main.go9
2 files changed, 6 insertions, 7 deletions
diff --git a/tools/animeimporter/ACDv2Reader.go b/tools/animeimporter/ACDv2Reader.go
index 36564e4..38162d6 100644
--- a/tools/animeimporter/ACDv2Reader.go
+++ b/tools/animeimporter/ACDv2Reader.go
@@ -7,7 +7,7 @@ import (
7 "strconv" 7 "strconv"
8 "strings" 8 "strings"
9 9
10 "fagott.pw/grilist/modules/grils" 10 "fagott.pw/grilist/models"
11) 11)
12 12
13func ifErrExit(err error) { 13func ifErrExit(err error) {
@@ -55,5 +55,5 @@ func (r *ACDv2Reader) Read(path string) WrappedSeries {
55} 55}
56 56
57func (r *ACDv2Reader) ID() int { 57func (r *ACDv2Reader) ID() int {
58 return int(grils.DataSourceACD) 58 return int(models.DataSourceACD)
59} 59}
diff --git a/tools/animeimporter/main.go b/tools/animeimporter/main.go
index 81ba516..17da658 100644
--- a/tools/animeimporter/main.go
+++ b/tools/animeimporter/main.go
@@ -8,8 +8,7 @@ import (
8 "path/filepath" 8 "path/filepath"
9 9
10 "fagott.pw/grilist/grilist" 10 "fagott.pw/grilist/grilist"
11 "fagott.pw/grilist/modules/series" 11 "fagott.pw/grilist/models"
12 "fagott.pw/grilist/modules/tags"
13) 12)
14 13
15var path string 14var path string
@@ -20,7 +19,7 @@ var db *sql.DB
20var r SeriesReader 19var r SeriesReader
21 20
22type WrappedSeries struct { 21type WrappedSeries struct {
23 Series series.Series 22 Series models.Series
24 Image string 23 Image string
25} 24}
26 25
@@ -104,7 +103,7 @@ func InsertTags(dbID int, s WrappedSeries, taglist map[string]int) {
104 } 103 }
105 var id int 104 var id int
106 row := db.QueryRow("INSERT INTO grilist.tags (name, type) VALUES ($1, $2) RETURNING id;", 105 row := db.QueryRow("INSERT INTO grilist.tags (name, type) VALUES ($1, $2) RETURNING id;",
107 v, tags.TagTypeSeries) 106 v, models.TagTypeSeries)
108 row.Scan(&id) 107 row.Scan(&id)
109 taglist[v] = id 108 taglist[v] = id
110 fmt.Printf("Inserted tag %s as %d\n", v, id) 109 fmt.Printf("Inserted tag %s as %d\n", v, id)
@@ -167,7 +166,7 @@ func main() {
167 } 166 }
168 167
169 taglist := make(map[string]int) 168 taglist := make(map[string]int)
170 rows, err := db.Query("SELECT id, name FROM grilist.tags WHERE type = $1;", tags.TagTypeSeries) 169 rows, err := db.Query("SELECT id, name FROM grilist.tags WHERE type = $1;", models.TagTypeSeries)
171 LogErr(err) 170 LogErr(err)
172 for rows.Next() { 171 for rows.Next() {
173 var id int 172 var id int