aboutsummaryrefslogtreecommitdiff
path: root/modules/grils
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2015-12-30 15:10:35 (UTC)
committerjan <jan@ruken.pw>2015-12-30 15:10:35 (UTC)
commitbcab80f3e81b3aea7b1a6e84b39838bd19402975 (patch)
tree5ba8fb024fde49f203863b57724158ed4171ff99 /modules/grils
parent836099557e2327813668d50d5abb73ac43ad212d (diff)
nur noch eine datenbankabfrage. results sehen jetzt ziemlich leer aus, muss bestimmt mal neu gestaltet werden.
Diffstat (limited to 'modules/grils')
-rw-r--r--modules/grils/gril.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/grils/gril.go b/modules/grils/gril.go
index 89dd7c4..af84d04 100644
--- a/modules/grils/gril.go
+++ b/modules/grils/gril.go
@@ -41,11 +41,11 @@ func (g *Gril) Slug() string {
41 strings.Replace(g.RomajiName, " ", "", -1)) 41 strings.Replace(g.RomajiName, " ", "", -1))
42} 42}
43 43
44func (g *Gril) ImagePath(prioritizeThumbnail bool) string { 44func ImagePath(id int, prioritizeThumbnail bool) string {
45 var big string 45 var big string
46 exts := []string{"png", "jpg", "gif", "jpeg"} 46 exts := []string{"png", "jpg", "gif", "jpeg"}
47 for _, ext := range exts { 47 for _, ext := range exts {
48 path := fmt.Sprintf("assets/img/gril/%d/0.%s", g.ID, ext) 48 path := fmt.Sprintf("assets/img/gril/%d/0.%s", id, ext)
49 if _, err := os.Stat(path); err == nil { 49 if _, err := os.Stat(path); err == nil {
50 if prioritizeThumbnail { 50 if prioritizeThumbnail {
51 big = path 51 big = path
@@ -56,7 +56,7 @@ func (g *Gril) ImagePath(prioritizeThumbnail bool) string {
56 } 56 }
57 57
58 for _, ext := range exts { 58 for _, ext := range exts {
59 path := fmt.Sprintf("assets/img/gril/%d/1.%s", g.ID, ext) 59 path := fmt.Sprintf("assets/img/gril/%d/1.%s", id, ext)
60 if _, err := os.Stat(path); err == nil { 60 if _, err := os.Stat(path); err == nil {
61 return path 61 return path
62 } 62 }
@@ -64,3 +64,7 @@ func (g *Gril) ImagePath(prioritizeThumbnail bool) string {
64 64
65 return big 65 return big
66} 66}
67
68func (g *Gril) ImagePath(prioritizeThumbnail bool) string {
69 return ImagePath(g.ID, prioritizeThumbnail)
70}