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
+30 -4
View File
@@ -3196,13 +3196,11 @@ body.sidebar-right-hidden #sidebar-drag-zone {
.sidebar-video-meta {
display: flex;
align-items: center;
gap: 5px;
flex-wrap: wrap;
gap: 3px 5px;
font-size: 0.7em;
color: #777;
margin-top: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar-video-time {
@@ -3232,6 +3230,34 @@ body.sidebar-right-hidden #sidebar-drag-zone {
font-size: 0.9em;
}
.sidebar-dev-score {
font-size: 0.85em;
font-weight: 700;
padding: 1px 5px;
border-radius: 3px;
display: inline-flex;
align-items: center;
gap: 3px;
background: rgba(255, 170, 0, 0.16);
color: #ffaa00;
border: 1px solid rgba(255, 170, 0, 0.4);
letter-spacing: 0.02em;
font-family: monospace, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
flex-shrink: 0;
}
.sidebar-dev-score i {
font-size: 0.85em;
opacity: 0.85;
}
html[theme='light'] .sidebar-dev-score,
html[theme='paper'] .sidebar-dev-score {
background: rgba(217, 119, 6, 0.14);
color: #b45309;
border-color: rgba(217, 119, 6, 0.35);
}
/* Light / Paper themes */
html[theme='light'] .sidebar-tabs,
html[theme='paper'] .sidebar-tabs {
+26 -6
View File
@@ -6668,14 +6668,23 @@ window.cancelAnimFrame = (function () {
if (!tagname) return;
suggestions.style.display = 'none';
try {
const csrf = window.f0ckSession?.csrf_token || document.querySelector('input[name="csrf_token"]')?.value || '';
const res = await fetch('/api/v2/settings/excluded_tags', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ tagname })
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf
},
body: JSON.stringify({ tagname, csrf_token: csrf })
});
const data = await res.json();
if (data.success) { renderTags(); input.value = ''; }
else window.flashMessage(data.msg || 'Error adding tag', 3000, 'error');
if (data.success) {
renderTags();
input.value = '';
if (typeof gridCacheMap !== 'undefined') gridCacheMap.clear();
} else {
window.flashMessage(data.msg || 'Error adding tag', 3000, 'error');
}
} catch (e) {
console.error(e);
} finally {
@@ -6699,9 +6708,20 @@ window.cancelAnimFrame = (function () {
e.preventDefault();
const tag = e.target.getAttribute('data-tag');
try {
const res = await fetch(`/api/v2/settings/excluded_tags/${encodeURIComponent(tag)}`, { method: 'DELETE' });
const csrf = window.f0ckSession?.csrf_token || document.querySelector('input[name="csrf_token"]')?.value || '';
const res = await fetch(`/api/v2/settings/excluded_tags/${encodeURIComponent(tag)}`, {
method: 'DELETE',
headers: {
'X-CSRF-Token': csrf
}
});
const data = await res.json();
if (data.success) renderTags();
if (data.success) {
renderTags();
if (typeof gridCacheMap !== 'undefined') gridCacheMap.clear();
} else {
window.flashMessage(data.msg || 'Error removing tag', 3000, 'error');
}
} catch (e) { console.error(e); }
}
});
+16 -1
View File
@@ -1199,6 +1199,19 @@
? `<span class="sidebar-personalized-pill" title="Personalized recommendation based on your interests"><i class="fa-solid fa-wand-magic-sparkles"></i> For You</span>`
: '';
const isDev = !!(window.f0ckSession && window.f0ckSession.development);
const rawScore = (typeof video.score === 'number')
? video.score
: (typeof video.rank_score === 'number' ? video.rank_score : (video.xd_score || 0));
const formattedScore = (typeof rawScore === 'number')
? (Number.isInteger(rawScore) ? rawScore : +(rawScore.toFixed(1)))
: rawScore;
const devScoreAttr = isDev ? ` data-score="${escapeHtml(String(formattedScore))}"` : '';
const devScoreBadge = isDev
? `<span class="sidebar-video-score sidebar-dev-score" title="Development Score: ${formattedScore} (Algo: ${video.score ?? video.rank_score ?? 0}, xD: ${video.xd_score ?? 0})"><i class="fa-solid fa-code"></i> score: ${formattedScore}</span>`
: '';
const isTagFeed = options.isTagFeed || false;
const tagContext = options.tag || null;
const targetHref = (isTagFeed && tagContext)
@@ -1207,7 +1220,7 @@
const activeClass = options.isActive ? ' active-tag-item' : '';
return `
<div class="sidebar-video-card${activeClass}" data-id="${video.id}" data-slug="${escapeHtml(video.slug || '')}" data-file="${escapeHtml(video.dest || '')}" data-mime="${escapeHtml(video.mime || '')}" data-ext="${escapeHtml(ext ? ext.toLowerCase() : '')}" data-mode="${rClass}" data-personalized="${video.personalized ? 'true' : 'false'}">
<div class="sidebar-video-card${activeClass}" data-id="${video.id}" data-slug="${escapeHtml(video.slug || '')}" data-file="${escapeHtml(video.dest || '')}" data-mime="${escapeHtml(video.mime || '')}" data-ext="${escapeHtml(ext ? ext.toLowerCase() : '')}" data-mode="${rClass}" data-personalized="${video.personalized ? 'true' : 'false'}"${devScoreAttr}>
<a href="${targetHref}" class="sidebar-video-link" data-mode="${rClass}" data-inherit-context="false">
<div class="sidebar-video-thumb-wrap" data-file="${escapeHtml(video.dest || '')}" data-mime="${escapeHtml(video.mime || '')}" data-ext="${escapeHtml(ext ? ext.toLowerCase() : '')}" data-mode="${rClass}">
${thumbContentHtml}
@@ -1226,6 +1239,8 @@
${xdBadge}
${((timeStr || xdBadge) && forYouBadge) ? `&bull;` : ''}
${forYouBadge}
${((timeStr || xdBadge || forYouBadge) && devScoreBadge) ? `&bull;` : ''}
${devScoreBadge}
</div>
</div>
</div>