feat(themes): persist publisher id in theme manifests
Publishing now stamps the signed-in EZPPFarm user ID into theme.json and saves it before packaging, so installed theme cards can resolve avatars by stable user ID. Older manifests keep the author-name fallback.
This commit is contained in:
1 parent
5eea428802
commit
11aefee7ed
4 files changed
+35
-6
No files matched your search
@@ -16,6 +16,8 @@ export type Theme = {
|
||||
version: string;
|
||||
apiVersion: string;
|
||||
author: string;
|
||||
/** EZPPFarm user ID stored in the manifest when the theme is published. */
|
||||
authorId?: number;
|
||||
description: string;
|
||||
nsfw: boolean;
|
||||
scriptUrl: string;
|
||||
@@ -44,6 +46,7 @@ export type ThemeInfo = {
|
||||
apiVersion?: string;
|
||||
workshopId?: string;
|
||||
author?: string;
|
||||
authorId?: number;
|
||||
description?: string;
|
||||
nsfw?: boolean;
|
||||
entry?: string;
|
||||
@@ -173,6 +176,12 @@ const themeFromFolder = async (
|
||||
version: parsed.version ?? '1.0.0',
|
||||
apiVersion,
|
||||
author: parsed.author ?? 'Unknown',
|
||||
authorId:
|
||||
typeof parsed.authorId === 'number' &&
|
||||
Number.isSafeInteger(parsed.authorId) &&
|
||||
parsed.authorId > 0
|
||||
? parsed.authorId
|
||||
: undefined,
|
||||
description: parsed.description ?? '',
|
||||
nsfw: parsed.nsfw === true,
|
||||
scriptUrl,
|
||||
@@ -523,6 +532,7 @@ export const reloadThemes = async () => {
|
||||
preview: theme.preview,
|
||||
version: theme.version,
|
||||
author: theme.author,
|
||||
authorId: theme.authorId,
|
||||
apiVersion: theme.apiVersion,
|
||||
description: theme.description,
|
||||
nsfw: theme.nsfw,
|
||||
|
||||
Reference in new issue
Block a user