aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/script/player/mod.ts7
-rw-r--r--web/style/nodepage.css12
2 files changed, 17 insertions, 2 deletions
diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts
index 0d4dc32..85befcc 100644
--- a/web/script/player/mod.ts
+++ b/web/script/player/mod.ts
@@ -153,10 +153,13 @@ function send_player_progress(node_id: string, player: Player) {
const nt = player.video.currentTime
if (t != nt) {
t = nt
- fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" })
+ const start = nt < 1 * 60
+ const end = nt > player.duration.value - 5 * 60
+
+ if (!start) fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" })
+ if (end) fetch(`/n/${encodeURIComponent(node_id)}/watched?state=true`, { method: "POST" })
}
}, 10000)
-
}
function mouse_idle(e: HTMLElement, timeout: number, cb: (b: boolean) => unknown) {
diff --git a/web/style/nodepage.css b/web/style/nodepage.css
index 3829fcd..576e398 100644
--- a/web/style/nodepage.css
+++ b/web/style/nodepage.css
@@ -70,3 +70,15 @@
.props p.federation::before {
content: "link";
}
+.props p.watched {
+ background: rgba(106, 224, 70, 0.522);
+}
+.props p.watched::before {
+ content: "check";
+}
+.props p.progress {
+ background: rgba(225, 255, 58, 0.522);
+}
+.props p.progress::before {
+ content: "pending";
+}