From 712ea6ddd4fec7bf86aa45a9487fb8da86c5d8f2 Mon Sep 17 00:00:00 2001 From: relan Date: Tue, 19 Apr 2016 14:47:44 +0300 Subject: [PATCH] Pick app icon from the latest APK It does not really matter that much which APK we take app icon from. They rarely change and it's a question of aestetics. Just take the latest icon version, like we do with app description. --- index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.go b/index.go index 101cf49..4895bb4 100644 --- a/index.go +++ b/index.go @@ -83,11 +83,11 @@ func getIconsDir(density IconDensity) string { } func (a *App) IconURLForDensity(density IconDensity) string { - cur := a.CurApk() - if cur == nil { + if len(a.Apks) == 0 { return "" } - return fmt.Sprintf("%s/%s/%s", cur.Repo.URL, getIconsDir(density), a.Icon) + return fmt.Sprintf("%s/%s/%s", a.Apks[0].Repo.URL, + getIconsDir(density), a.Icon) } func (a *App) IconURL() string {