fix: preserve user figures in avatar imager
CI / check (push) Successful in 26s
CI / release (push) Skipped
CI / deploy (push) Successful in 44s

This commit is contained in:
Simo committed 2026-08-09 21:48:43 +02:00
1 parent 49185dd7a9
commit 4a6fcd050e
5 files changed
+12 -251

No files matched your search

+2 -4
View File
@@ -8,7 +8,6 @@
export type { AvatarOptions } from "@/types/admin";
import { env } from "@/env";
import { getNewFormatFigure } from "@/lib/figure-convert";
import type { AvatarOptions } from "@/types/admin";
const DEFAULT_IMAGER_URL = "https://epicnabbo.nl/imaging/avatarimage";
@@ -28,14 +27,13 @@ export function resolveImagerBase(): string {
/**
* Build an avatar image URL using the configured imager.
* Uses effect=14 and img_format=apng by default for epicnabbo.nl compatibility.
* Automatically converts old Habbo figure format to new epicnabbo.nl format.
* Preserves the user's stored figure so the rendered avatar matches the account.
* Omits default parameters (direction=2, head_direction=3, size=m) for cleaner URLs.
*/
export function getAvatarUrl(
figure: string,
options: AvatarOptions = {},
): string {
const convertedFigure = getNewFormatFigure(figure);
const {
size = "m",
direction = 2,
@@ -48,7 +46,7 @@ export function getAvatarUrl(
} = options;
const params = new URLSearchParams({
figure: convertedFigure,
figure,
img_format,
effect: String(effect),
});