Skip to content

Commit

Permalink
Default to jpg over gif on quicklinks when not animated (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinrouillard authored Sep 20, 2024
1 parent 777eb25 commit 7fe6680
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/api/routes/quicklinks/discord_cdn.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ defmodule Lanyard.Api.Quicklinks.DiscordCdn do
end

defp get_proxied_avatar(id, avatar, _discriminator, file_type) when is_binary(avatar) do
file_type =
if !String.starts_with?(avatar, "a_") && file_type == "gif" do
"jpg"
else
file_type
end

constructed_cdn_url = "#{@discord_cdn}/avatars/#{id}/#{avatar}.#{file_type}?size=1024"

:get
Expand Down

0 comments on commit 7fe6680

Please sign in to comment.