2023-11-26 22:39:05 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
2023-12-07 23:25:17 +00:00
|
|
|
"strings"
|
|
|
|
|
2023-11-26 22:39:05 +00:00
|
|
|
"github.com/ectrc/snow/fortnite"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
|
|
|
|
2023-12-07 23:25:17 +00:00
|
|
|
func GetPreloadedCosmetics(c *fiber.Ctx) error {
|
2023-11-26 22:39:05 +00:00
|
|
|
return c.JSON(fortnite.Cosmetics)
|
2023-12-07 23:25:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetPlaylistImage(c *fiber.Ctx) error {
|
|
|
|
playlist := c.Params("playlist")
|
|
|
|
if playlist == "" {
|
|
|
|
return c.SendStatus(404)
|
|
|
|
}
|
|
|
|
playlist = strings.Split(playlist, ".")[0]
|
|
|
|
|
|
|
|
image, ok := fortnite.PlaylistImages[playlist]
|
|
|
|
if !ok {
|
|
|
|
return c.SendStatus(404)
|
|
|
|
}
|
|
|
|
|
|
|
|
c.Set("Content-Type", "image/png")
|
|
|
|
return c.Send(image)
|
|
|
|
}
|