bkmdfg
This commit is contained in:
@@ -277,7 +277,8 @@
|
||||
"video": "Video",
|
||||
"audio": "Audio",
|
||||
"image": "Bild",
|
||||
"flash": "Flash"
|
||||
"flash": "Flash",
|
||||
"grid_mode": "Thumbnailgröße"
|
||||
},
|
||||
"shortcuts": {
|
||||
"title": "Tastaturkürzel",
|
||||
|
||||
@@ -277,7 +277,8 @@
|
||||
"video": "Video",
|
||||
"audio": "Audio",
|
||||
"image": "Image",
|
||||
"flash": "Flash"
|
||||
"flash": "Flash",
|
||||
"grid_mode": "Thumbnail size"
|
||||
},
|
||||
"shortcuts": {
|
||||
"title": "Keyboard Shortcuts",
|
||||
|
||||
@@ -275,7 +275,8 @@
|
||||
"video": "Video",
|
||||
"audio": "Audio",
|
||||
"image": "Afbeelding",
|
||||
"flash": "Flash"
|
||||
"flash": "Flash",
|
||||
"grid_mode": "Thumbnailgrootte"
|
||||
},
|
||||
"shortcuts": {
|
||||
"title": "Sneltoetsen",
|
||||
|
||||
@@ -273,7 +273,8 @@
|
||||
"video": "Video",
|
||||
"audio": "Tondatei",
|
||||
"image": "Bild",
|
||||
"flash": "Blitz"
|
||||
"flash": "Blitz",
|
||||
"grid_mode": "Vorschaubildgröße"
|
||||
},
|
||||
"shortcuts": {
|
||||
"title": "Tastaturkürzel",
|
||||
|
||||
@@ -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
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user