Skip to content

Commit

Permalink
Hack to allow loading retroachievements covers
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Crane <[email protected]>
  • Loading branch information
marcus-crane committed Sep 23, 2024
1 parent 56d78aa commit 1393412
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ func colorToHexString(c color.Color) string {
}

func LoadCover(cfg config.Config, hash string, extension string) (string, error) {
// TODO: Properly standardise on webp or something
if strings.Contains(hash, "retroachievements") {
extension = "png"
}
coverLocation := fmt.Sprintf("%s/%s.%s", cfg.Gunslinger.StorageDir, strings.ReplaceAll(hash, ":", "."), extension)
slog.With(slog.String("cover_location", coverLocation)).Debug("Loading cover from disc")
img, err := os.ReadFile(coverLocation)
Expand Down

0 comments on commit 1393412

Please sign in to comment.