Repository navigation
feat(links): stable web links next to deep links (#3) - #9
Merged
Merged
Conversation
…#3) Deep links only open on machines with Vixel installed; the issue asked for a network service so search results can live in notes. With the Local API on (or in the NAS web UI), Copy Web Link / Copy Markdown with Thumbnail give http://<host>:<port>/open?hash=…&t=…, addressed by content hash like deep links: the web UI resolves it (resolveLink, now shared by desktop and server), opens the item and seeks video; signed-out visits go through login and back (same-site next only). Markdown embeds /media/thumbh/<hash>. MCP httpUrl is now this page link, raw file as mediaUrl. Clipboard falls back to execCommand on plain-http NAS. Also fixes the video-id fallback when resolving links: link hashes are the representative frame's, so look up the representative by video id instead of the video file hash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #6 for issue #3 ("把搜索到的文件链接集成到自己的笔记中").
Deep links (
vixel://open?…) only open on machines with Vixel installed, so they don't help when notes are read on a phone or in a web-based note app. This adds stable web links next to them.http://<host>:<port>/open?hash=…&video=…&t=…— same params as the deep link, addressed by content hash, so it survives re-indexing. The web UI resolves it via a sharedresolveLinkservice method (desktop main now uses the same one), opens the item and seeks the video. Signed-out visits redirect to/login?next=…and come back (same-site paths only;//xand/\xrejected)./media/thumbh/<hash>(auth required like all media).httpUrlis now the page link; the raw file moved tomediaUrl.execCommand('copy')in non-secure contexts (plain-http NAS).Verified (live): server edition: signed-out
/open→ 302 to login withnext→ after login lands on seagull-chicks.mp4 at 0:32 with the 0:32–0:45 segment highlighted, URL cleaned to/;/media/thumbh/<hash>200 image/webp, unknown hash 404, unauthenticated 401;next=//evil.comandnext=/\evil.com→/. Desktop dev with Local API on: inspector shows the two new buttons; copiedhttp://127.0.0.1:41798/open?hash=…&video=3and the Markdown thumbnail embed both load.npm test395 passed, typecheck (node/web/server) clean.