aboutsummaryrefslogtreecommitdiff
path: root/modules/grils/gril.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/grils/gril.go')
-rw-r--r--modules/grils/gril.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/grils/gril.go b/modules/grils/gril.go
index edf25a9..c8c6538 100644
--- a/modules/grils/gril.go
+++ b/modules/grils/gril.go
@@ -2,8 +2,12 @@ package grils
2 2
3import ( 3import (
4 "database/sql" 4 "database/sql"
5 "github.com/lib/pq" 5 "fmt"
6 "strconv"
7 "strings"
6 "time" 8 "time"
9
10 "github.com/lib/pq"
7) 11)
8 12
9type DataSource int 13type DataSource int
@@ -25,3 +29,13 @@ type Gril struct {
25 UpdatedAt time.Time 29 UpdatedAt time.Time
26 Lists []int 30 Lists []int
27} 31}
32
33func (g *Gril) Slug() string {
34 if g.RomajiName == "" {
35 return strconv.Itoa(g.ID)
36 }
37 return fmt.Sprintf(
38 "%d/%s",
39 g.ID,
40 strings.Replace(g.RomajiName, " ", "", -1))
41}