Added dynamic affiliate URLs and video player restrictions.

This commit is contained in:
2026-01-28 00:57:32 +01:00
parent 31c62e01f9
commit 0bf0b716b2
7 changed files with 54 additions and 23 deletions

View File

@@ -29,6 +29,7 @@ export function curateUser(user, _assets = {}) {
isIdentityVerified: user.identity_verified,
avatar: `/media/avatars/${user.id}_${user.username}.png`,
role: user.role,
abilities: user.abilities,
createdAt: user.created_at,
};
@@ -61,23 +62,6 @@ export async function fetchUser(userId, options = {}, _reqUser) {
throw new HttpError(`User '${userId}' not found`, 404);
}
/*
const [stashes, templates] = await Promise.all([
knex('stashes')
.select('stashes.*', 'stashes_meta.*')
.leftJoin('stashes_meta', 'stashes_meta.stash_id', 'stashes.id')
.where('user_id', user.id)
.modify((builder) => {
if (reqUser?.id !== user.id && !options.includeStashes) {
builder.where('public', true);
}
}),
options.includeTemplates
? knex('users_templates').where('user_id', user.id)
: null,
]);
*/
if (options.raw) {
// return { user, stashes, templates };
return { user };