mirror of
https://github.com/baairon/torlink.git
synced 2026-07-08 18:28:22 +02:00
feat: terminal-native torrent discovery TUI
Curated, multi-source torrent search and download from the terminal: concurrent search across built-in sources with streamed, source-tagged results; a download-only webtorrent engine with true pause/resume and restart recovery; magnet paste; and a calm Ink + React TUI. No indexer server, no setup.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export function wrapStep(current: number, delta: number, length: number): number {
|
||||
if (length <= 0) return 0;
|
||||
return (((current + delta) % length) + length) % length;
|
||||
}
|
||||
|
||||
export function windowStart(cursor: number, total: number, height: number): number {
|
||||
if (total <= height) return 0;
|
||||
const half = Math.floor(height / 2);
|
||||
return Math.max(0, Math.min(cursor - half, total - height));
|
||||
}
|
||||
Reference in New Issue
Block a user