feat: admin users can view all downloads with user badges

- Admin users (Emby IsAdministrator) see a 'Show all users' toggle
- When toggled, all tagged downloads are shown regardless of user
- Each download card shows the tagged user's name as a badge
- Non-admin users see only their own downloads (unchanged behavior)
- Backend accepts ?showAll=true query param (admin-only)
This commit is contained in:
2026-05-15 20:46:56 +01:00
parent 6463c6b3d1
commit 0957f83411
5 changed files with 89 additions and 16 deletions

View File

@@ -37,9 +37,11 @@ router.post('/login', async (req, res) => {
console.log(`[Auth] Login successful for user: ${user.Name}`);
// Set authentication cookie
const isAdmin = !!(user.Policy && user.Policy.IsAdministrator);
res.cookie('emby_user', JSON.stringify({
id: user.Id,
name: user.Name,
isAdmin: isAdmin,
token: authData.AccessToken
}), {
httpOnly: true,
@@ -50,7 +52,8 @@ router.post('/login', async (req, res) => {
success: true,
user: {
id: user.Id,
name: user.Name
name: user.Name,
isAdmin: isAdmin
}
});
} catch (error) {
@@ -76,7 +79,8 @@ router.get('/me', (req, res) => {
authenticated: true,
user: {
id: user.id,
name: user.name
name: user.name,
isAdmin: !!user.isAdmin
}
});
} catch (error) {