diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-28 09:04:21 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-28 09:04:21 +0100 |
| commit | 4b9d9661751379ea62ebdc2587dff20544c4ada4 (patch) | |
| tree | 2b118fb50a98c8e84e11cec39157bb244b0bca04 /static/modules/xbox.js | |
| parent | 8397638ec70b23e05ef490e15f5d7c5c05e52d1f (diff) | |
| download | deck-it-4b9d9661751379ea62ebdc2587dff20544c4ada4.tar.gz deck-it-4b9d9661751379ea62ebdc2587dff20544c4ada4.zip | |
feat(xbox): mark captures saved on the PC, icon save button
A capture whose file is already in Pictures/Xbox or Videos/Xbox carries
`saved` and gets a check on its tile. The viewer keeps one icon button,
save to PC; the download to the tablet is gone. Deleting from Xbox Live
was tried and dropped: mediahub's DELETE answers 403 (errorCode 10401)
to a token from our own Azure app.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'static/modules/xbox.js')
| -rw-r--r-- | static/modules/xbox.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/static/modules/xbox.js b/static/modules/xbox.js index ad6eda2..1b58fb4 100644 --- a/static/modules/xbox.js +++ b/static/modules/xbox.js @@ -30,6 +30,7 @@ export function sessionPeek(st, store = globalThis.localStorage) { // Nerd Font (Material Design) glyphs. const G = { + save: "\u{F01DA}", check: "\u{F012C}", xbox: "\u{F05B9}", power: "\u{F0425}", play: "\u{F040A}", pause: "\u{F03E4}", vol_down: "\u{F075E}", vol_up: "\u{F075D}", mute: "\u{F0581}", unmute: "\u{F057E}", }; @@ -213,15 +214,12 @@ function gameTile(t) { function view(c, dlg) { const media = c.kind === "clip" ? h("video", "xb-vmedia") : img(c.url, "xb-vmedia"); if (c.kind === "clip") Object.assign(media, { src: c.url, controls: true, autoplay: true, playsInline: true }); - const a = h("a", "ib xb-vdl", "Tablet"); - a.href = c.url; - a.download = `${c.id}.${c.kind === "clip" ? "mp4" : "png"}`; - a.referrerPolicy = "no-referrer"; const meta = [c.title, new Date(c.date).toLocaleString(), c.expires ? `kept until ${new Date(c.expires).toLocaleDateString()}` : null].filter(Boolean).join(" · "); const info = h("div", "xb-gmeta", meta); // The PC downloads it into Pictures/Xbox or Videos/Xbox; the answer names the file. - const pc = h("button", "ib xb-vdl", "Save to PC"); + const pc = h("button", "ib nf xb-vdl", G.save); + pc.setAttribute("aria-label", "Save to PC"); pc.onclick = async () => { pc.disabled = true; info.textContent = "Saving…"; @@ -237,9 +235,7 @@ function view(c, dlg) { pc.disabled = false; }; const foot = h("div", "xb-vfoot"); - const btns = h("div", "xb-vbtns"); - btns.append(pc, a); - foot.append(info, btns); + foot.append(info, pc); const close = h("button", "ib nf xb-vclose", "\u{F0156}"); close.setAttribute("aria-label", "Close"); close.onclick = () => dlg.close(); @@ -253,6 +249,7 @@ function captureTile(c, dlg) { const art = h("div", "xb-gart"); art.append(img(c.thumb, "xb-gcover xb-ccover")); if (c.kind === "clip") art.append(h("span", "xb-badge", `Clip · ${c.seconds ?? "?"} s`)); + if (c.saved) art.append(h("span", "nf xb-saved", G.check)); tile.append(art, h("div", "xb-gname", c.title ?? ""), h("div", "xb-gmeta", ago(c.date))); tile.onclick = () => view(c, dlg); return tile; |
