Skip to content

Commit 61d0d03

Browse files
davidgut1982claude
andcommitted
fix: correct score badge double-% and timestamp first-wins strategy
- ScoreBadge: remove duplicate % (API already appends it) - historyMap: use first-wins (backend returns DESC, first = most recent) - historyMap: include action=2 (Manual downloads) for score display Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1cbbb04 commit 61d0d03

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

frontend/src/pages/Movies/Details/table.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const ScoreBadge: React.FC<{ score?: string }> = ({ score }) => {
3434
const color = pct >= 90 ? "green" : pct >= 70 ? "yellow" : "red";
3535
return (
3636
<Badge color={color} size="sm">
37-
{score}%
37+
{score}
3838
</Badge>
3939
);
4040
};
@@ -63,9 +63,8 @@ const Table: FunctionComponent<Props> = ({
6363
const map = new Map<string, History.Movie>();
6464
history?.forEach((h) => {
6565
if (!h.subtitles_path) return;
66-
if (h.action === 1 || h.action === 3) {
67-
const existing = map.get(h.subtitles_path);
68-
if (!existing || h.timestamp > existing.timestamp) {
66+
if (h.action === 1 || h.action === 2 || h.action === 3) {
67+
if (!map.has(h.subtitles_path)) {
6968
map.set(h.subtitles_path, h);
7069
}
7170
}

0 commit comments

Comments
 (0)