This commit is contained in:
2026-09-12 06:57:10 +02:00
parent acf29df204
commit 03abac6bef
11 changed files with 178 additions and 30 deletions
+2 -1
View File
@@ -277,7 +277,8 @@
"video": "Video",
"audio": "Audio",
"image": "Bild",
"flash": "Flash"
"flash": "Flash",
"grid_mode": "Thumbnailgröße"
},
"shortcuts": {
"title": "Tastaturkürzel",
+2 -1
View File
@@ -277,7 +277,8 @@
"video": "Video",
"audio": "Audio",
"image": "Image",
"flash": "Flash"
"flash": "Flash",
"grid_mode": "Thumbnail size"
},
"shortcuts": {
"title": "Keyboard Shortcuts",
+2 -1
View File
@@ -275,7 +275,8 @@
"video": "Video",
"audio": "Audio",
"image": "Afbeelding",
"flash": "Flash"
"flash": "Flash",
"grid_mode": "Thumbnailgrootte"
},
"shortcuts": {
"title": "Sneltoetsen",
+2 -1
View File
@@ -273,7 +273,8 @@
"video": "Video",
"audio": "Tondatei",
"image": "Bild",
"flash": "Blitz"
"flash": "Blitz",
"grid_mode": "Vorschaubildgröße"
},
"shortcuts": {
"title": "Tastaturkürzel",
+9 -3
View File
@@ -2203,7 +2203,9 @@ const f0cklib = {
xd_label: meta.label,
width: r.width,
height: r.height,
has_coverart: !!r.has_coverart
has_coverart: !!r.has_coverart,
score: 0,
rank_score: 0
};
});
},
@@ -2481,7 +2483,9 @@ const f0cklib = {
width: r.width,
height: r.height,
has_coverart: !!r.has_coverart,
personalized: true
personalized: true,
score: r.rank_score != null ? Math.round(Number(r.rank_score) * 10) / 10 : 0,
rank_score: r.rank_score != null ? Math.round(Number(r.rank_score) * 10) / 10 : 0
};
});
} catch (err) {
@@ -2682,7 +2686,9 @@ const f0cklib = {
xd_label: meta.label,
width: r.width,
height: r.height,
has_coverart: !!r.has_coverart
has_coverart: !!r.has_coverart,
score: r.xd_score || 0,
rank_score: 0
};
});
+3 -1
View File
@@ -761,7 +761,9 @@ export default router => {
rating_class: item.rating_class,
xd_score: item.xd_score,
xd_tier: item.xd_tier,
personalized: !!item.personalized
personalized: !!item.personalized,
score: typeof item.score === 'number' ? item.score : (typeof item.rank_score === 'number' ? item.rank_score : (item.xd_score || 0)),
rank_score: item.rank_score ?? item.score ?? 0
}))
});
} catch (err) {
+15 -4
View File
@@ -83,7 +83,7 @@ export default router => {
});
group.post(/\/excluded_tags/, lib.loggedin, async (req, res) => {
const tagname = req.post.tagname;
const tagname = req.post?.tagname || req.body?.tagname;
if (!tagname) return res.json({ success: false, msg: 'No tag provided' }, 400);
const tag = (await db`select id, tag, normalized from tags where normalized = slugify(${tagname})`)[0];
@@ -92,10 +92,17 @@ export default router => {
await db`
update user_options
set excluded_tags = array_append(excluded_tags, ${tag.id})
where user_id = ${+req.session.id} and not (${tag.id} = any(excluded_tags))
set excluded_tags = array_append(coalesce(excluded_tags, '{}'), ${tag.id})
where user_id = ${+req.session.id} and not (${tag.id} = any(coalesce(excluded_tags, '{}')))
`;
if (req.session) {
if (!req.session.excluded_tags) req.session.excluded_tags = [];
if (!req.session.excluded_tags.includes(tag.id)) {
req.session.excluded_tags.push(tag.id);
}
}
// Return updated list
const tags = await db`
select t.id, t.tag, t.normalized
@@ -114,10 +121,14 @@ export default router => {
await db`
update user_options
set excluded_tags = array_remove(excluded_tags, ${tag.id})
set excluded_tags = array_remove(coalesce(excluded_tags, '{}'), ${tag.id})
where user_id = ${+req.session.id}
`;
if (req.session && req.session.excluded_tags) {
req.session.excluded_tags = req.session.excluded_tags.filter(id => id !== tag.id);
}
const tags = await db`
select t.id, t.tag, t.normalized
from unnest((select excluded_tags from user_options where user_id = ${+req.session.id})) as et(id)