Skip to content

Commit 3d0ab20

Browse files
feat: ReplayWeb.page URL link
1 parent 7ce00c4 commit 3d0ab20

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/argo-shared-archive-list.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Index as FlexIndex } from "flexsearch";
1616
import type { SharedArchive } from "./types";
1717
import { webtorrentClient as client } from "./global-webtorrent";
1818

19+
import { REPLAY_BASE_URL } from "./consts";
1920
@customElement("argo-shared-archive-list")
2021
export class ArgoSharedArchiveList extends LitElement {
2122
static styles: CSSResultGroup = [
@@ -424,7 +425,12 @@ export class ArgoSharedArchiveList extends LitElement {
424425
style="padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; justify-content: space-between;"
425426
>
426427
<md-filled-button
427-
@click=${() => this._copyLink(archive.magnetURI)}
428+
@click=${() =>
429+
this._copyLink(
430+
`${REPLAY_BASE_URL}/?source=${encodeURIComponent(
431+
archive.magnetURI,
432+
)}`,
433+
)}
428434
>
429435
<md-icon slot="icon" style="color:white"
430436
>content_copy</md-icon

src/consts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export const BEHAVIOR_READY_START = "ready";
33
export const BEHAVIOR_PAUSED = "paused";
44
export const BEHAVIOR_RUNNING = "running";
55
export const BEHAVIOR_DONE = "done";
6+
export const REPLAY_BASE_URL =
7+
"https://replayweb-page-m-git-nikita-webtorrent-integration-monadical.vercel.app";

src/sidepanel.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { getSharedArchives, setSharedArchives } from "./localstorage";
1414
import { webtorrentClient as client } from "./global-webtorrent";
1515
import { state } from "lit/decorators.js";
1616
import { isUrlInSkipList } from "./utils";
17+
import { REPLAY_BASE_URL } from "./consts";
1718

1819
import {
1920
getLocalOption,
@@ -493,15 +494,18 @@ class ArgoViewer extends LitElement {
493494
const magnetURI = torrent.magnetURI;
494495
console.log("Seeding WACZ file via WebTorrent:", magnetURI);
495496

497+
const replayLink = `${REPLAY_BASE_URL}/?source=${encodeURIComponent(
498+
magnetURI,
499+
)}`;
496500
// Copy to clipboard
497501
navigator.clipboard
498-
.writeText(magnetURI)
502+
.writeText(replayLink)
499503
.then(() => {
500-
alert(`Magnet link copied to clipboard:\n${magnetURI}`);
504+
alert(`Magnet link copied to clipboard:\n${replayLink}`);
501505
})
502506
.catch((err) => {
503507
console.error("Failed to copy magnet link:", err);
504-
alert(`Magnet Link Ready:\n${magnetURI}`);
508+
alert(`Magnet Link Ready:\n${replayLink}`);
505509
});
506510

507511
const existing = await getSharedArchives();

0 commit comments

Comments
 (0)