From 908cfec0503d45ae73123e3a4640d513747b3fe7 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 9 Oct 2016 21:00:11 +0200 Subject: bilder kommen jetzt wo anders her diff --git a/modules/grils/gril.go b/modules/grils/gril.go index 0462e86..7b54ab1 100644 --- a/modules/grils/gril.go +++ b/modules/grils/gril.go @@ -3,7 +3,6 @@ package grils import ( "database/sql" "fmt" - "os" "strconv" "strings" "time" @@ -52,37 +51,11 @@ func (g *Gril) Slug() string { strings.Replace(g.RomajiName, " ", "", -1)) } -func ImagePath(id int, prioritizeThumbnail bool) string { - // Image Priority - // without prioritizeThumbnail: Anilist > ACD (big) > ACD (thumbnail) - // with prioritizeThumbnail: Anilist > ACD (thumbnail) > ACD (big) - - anilistPath := fmt.Sprintf("assets/img/gril/%d/%d.jpg", DataSourceAnilist, id) - if _, err := os.Stat(anilistPath); err == nil { - return fmt.Sprintf(anilistPath) - } - - var big string - exts := []string{"png", "jpg", "gif", "jpeg"} - for _, ext := range exts { - path := fmt.Sprintf("assets/img/gril/%d/%d/0.%s", DataSourceACD, id, ext) - if _, err := os.Stat(path); err == nil { - if prioritizeThumbnail { - big = path - } else { - return path - } - } +func ImagePath(id int, useThumbnail bool) string { + if useThumbnail { + return fmt.Sprintf("http://img.grilist.moe/gril/thumb/%d.jpg", id) } - - for _, ext := range exts { - path := fmt.Sprintf("assets/img/gril/%d/%d/1.%s", DataSourceACD, id, ext) - if _, err := os.Stat(path); err == nil { - return path - } - } - - return big + return fmt.Sprintf("http://img.grilist.moe/gril/full/%d.jpg", id) } func (g *Gril) ImagePath(prioritizeThumbnail bool) string { -- cgit v0.10.1