Files
FlightTube/src/types.ts
T
vincent 5b09acd28d feat: 4K downloads, watch progress, player controls, new icon
Window chrome: titleBarStyle Overlay (Transparent left the native bar in
place, white in dark mode, with a dead strip beneath it). The app now
paints that strip itself, so it matches the page background.

Player: prev/next through the feed, a full-screen button, a spinner
while a stream resolves, Open on YouTube on downloaded videos too, and
the description collapsed behind a disclosure.

Downloads default to Best, which reaches real 4K — above 1080p YouTube
serves VP9/AV1, verified to play natively in WKWebView here. Audio stays
pinned to AAC because Opus in MP4 would be silent. A Compatible setting
keeps the old 1080p H.264 behaviour. Files are now named
'<ISO date> - <title> [<id>].mp4'.

Watch progress is recorded and drawn under thumbnails like YouTube's,
and reopening a video resumes where it left off.

Tiles clamp every text line to a fixed height so they share a baseline,
and the search field no longer clips its placeholder.

Fixes a Picture-in-Picture leak: WebKit kept a detached video playing
after the player closed, so a second video could play over the first
with no way to stop it. Every exit path now tears the element down.
2026-08-29 04:03:45 +02:00

90 lines
1.8 KiB
TypeScript

// Mirrors of the Rust structs in src-tauri/src/models.rs. Field names match
// serde's output exactly so no mapping layer is needed.
export type DownloadState =
| "queued"
| "running"
| "done"
| "failed"
| "cancelled";
export interface ChannelWithCount {
id: string;
title: string;
url: string;
video_count: number;
downloaded_count: number;
}
export interface FeedItem {
id: string;
channel_id: string;
channel_title: string;
title: string;
description: string;
/** Unix seconds. */
published: number;
thumb_url: string;
thumb_path: string | null;
views: number;
is_short: boolean;
state: DownloadState | null;
path: string | null;
pct: number | null;
error: string | null;
/** Seconds watched, and the video's length — drives the feed progress bar. */
position: number | null;
duration: number | null;
}
export interface FeedFilter {
channel_id?: string | null;
search?: string | null;
downloaded_only: boolean;
hide_shorts: boolean;
limit?: number | null;
}
export interface Prereqs {
yt_dlp: string | null;
ffmpeg: string | null;
library_path: string;
}
export interface RefreshSummary {
channels: number;
new_videos: number;
failures: string[];
}
export interface RefreshProgress {
done: number;
total: number;
channel: string;
}
export interface DownloadProgressEvent {
video_id: string;
pct: number | null;
bytes_done: number;
bytes_total: number | null;
speed: number | null;
eta: number | null;
}
export interface DownloadStateEvent {
video_id: string;
state: DownloadState;
error: string | null;
path: string | null;
}
export interface ImportPreview {
incoming: number;
removed_channels: number;
removed_videos: number;
removed_downloads: number;
}
export type Quality = "best" | "compatible";