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.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/grils/gril.go b/modules/grils/gril.go
index fe316cd..89dd7c4 100644
--- a/modules/grils/gril.go
+++ b/modules/grils/gril.go
@@ -3,9 +3,12 @@ package grils
3import ( 3import (
4 "database/sql" 4 "database/sql"
5 "fmt" 5 "fmt"
6 "github.com/lib/pq"
7 "os" 6 "os"
7 "strconv"
8 "strings"
8 "time" 9 "time"
10
11 "github.com/lib/pq"
9) 12)
10 13
11type DataSource int 14type DataSource int
@@ -28,6 +31,16 @@ type Gril struct {
28 Lists []int 31 Lists []int
29} 32}
30 33
34func (g *Gril) Slug() string {
35 if g.RomajiName == "" {
36 return strconv.Itoa(g.ID)
37 }
38 return fmt.Sprintf(
39 "%d/%s",
40 g.ID,
41 strings.Replace(g.RomajiName, " ", "", -1))
42}
43
31func (g *Gril) ImagePath(prioritizeThumbnail bool) string { 44func (g *Gril) ImagePath(prioritizeThumbnail bool) string {
32 var big string 45 var big string
33 exts := []string{"png", "jpg", "gif", "jpeg"} 46 exts := []string{"png", "jpg", "gif", "jpeg"}