Lower finished threshold from 90% to 75%
Applies to frontend player, backend safety net, and stats display. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,7 @@ def get_stats(
|
|||||||
avg_completion = db.execute(
|
avg_completion = db.execute(
|
||||||
text("""
|
text("""
|
||||||
SELECT AVG(uv.completion_percent) AS avg_pct,
|
SELECT AVG(uv.completion_percent) AS avg_pct,
|
||||||
COUNT(CASE WHEN uv.completion_percent >= 90 THEN 1 END) AS finished_count,
|
COUNT(CASE WHEN uv.completion_percent >= 75 THEN 1 END) AS finished_count,
|
||||||
COUNT(CASE WHEN uv.completion_percent < 20 AND uv.completion_percent IS NOT NULL THEN 1 END) AS bailed_count,
|
COUNT(CASE WHEN uv.completion_percent < 20 AND uv.completion_percent IS NOT NULL THEN 1 END) AS bailed_count,
|
||||||
SUM(uv.rewatch_count) AS total_rewatches,
|
SUM(uv.rewatch_count) AS total_rewatches,
|
||||||
COUNT(CASE WHEN uv.rewatch_count > 0 THEN 1 END) AS rewatched_videos
|
COUNT(CASE WHEN uv.rewatch_count > 0 THEN 1 END) AS rewatched_videos
|
||||||
|
|||||||
@@ -999,10 +999,10 @@ def update_progress(
|
|||||||
if pct < 0.20:
|
if pct < 0.20:
|
||||||
_update_affinity(db, current_user.id, video, -0.5)
|
_update_affinity(db, current_user.id, video, -0.5)
|
||||||
|
|
||||||
# Backend safety net: auto-mark watched at ≥90% completion even if the frontend
|
# Backend safety net: auto-mark watched at ≥75% completion even if the frontend
|
||||||
# didn't send watched=True (e.g. browser closed before debounce fired)
|
# didn't send watched=True (e.g. browser closed before debounce fired)
|
||||||
if (not prev_watched and not uv.watched
|
if (not prev_watched and not uv.watched
|
||||||
and uv.completion_percent is not None and uv.completion_percent >= 90
|
and uv.completion_percent is not None and uv.completion_percent >= 75
|
||||||
and video.duration_seconds and video.duration_seconds > 60):
|
and video.duration_seconds and video.duration_seconds > 60):
|
||||||
uv.watched = True
|
uv.watched = True
|
||||||
_update_affinity(db, current_user.id, video, +2.0)
|
_update_affinity(db, current_user.id, video, +2.0)
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export default function VideoPlayer() {
|
|||||||
saveTimerRef.current = setTimeout(() => {
|
saveTimerRef.current = setTimeout(() => {
|
||||||
if (video?.id) {
|
if (video?.id) {
|
||||||
const duration = video.duration_seconds ?? 0;
|
const duration = video.duration_seconds ?? 0;
|
||||||
const watched = duration > 0 && secs >= duration * 0.9;
|
const watched = duration > 0 && secs >= duration * 0.75;
|
||||||
updateProgress(video.id, { watch_progress_seconds: secs, watched });
|
updateProgress(video.id, { watch_progress_seconds: secs, watched });
|
||||||
}
|
}
|
||||||
}, 10_000);
|
}, 10_000);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default function Stats() {
|
|||||||
<StatCard
|
<StatCard
|
||||||
label="Finished"
|
label="Finished"
|
||||||
value={(data.finished_count || 0).toLocaleString()}
|
value={(data.finished_count || 0).toLocaleString()}
|
||||||
sub="watched ≥90%"
|
sub="watched ≥75%"
|
||||||
/>
|
/>
|
||||||
<StatCard
|
<StatCard
|
||||||
label="Bailed early"
|
label="Bailed early"
|
||||||
|
|||||||
Reference in New Issue
Block a user