feat(collector): rebuild link preview as package workspace
Inspect pasted links, text files and DLC containers before queue insertion and resolve supported hoster metadata without starting downloads. Group multipart files into expandable packages with size, status, availability, timestamps, filtering and stable selection. Add selected or complete transfer to Downloads while retaining entries on failed or partial handoff. Keep collector toolbar spacing consistent and show the full 1Fichier identity with its provider icon in Downloads.
This commit is contained in:
@@ -9,18 +9,42 @@ import type {
|
||||
import { parseDebridLinkApiKeys } from "../../src/shared/debrid-link-keys";
|
||||
import { getMegaDebridAccountId } from "../../src/shared/mega-debrid-accounts";
|
||||
import { createRendererState } from "../../src/main/renderer-state";
|
||||
import type { CollectorInspectionResult } from "../../src/shared/collector";
|
||||
|
||||
export const VISUAL_SCENARIOS = ["empty", "dense", "update"] as const;
|
||||
|
||||
export type VisualScenario = (typeof VISUAL_SCENARIOS)[number];
|
||||
|
||||
export interface VisualFixture {
|
||||
snapshot: UiSnapshot;
|
||||
export interface VisualFixture {
|
||||
snapshot: UiSnapshot;
|
||||
collector: CollectorInspectionResult;
|
||||
history: HistoryEntry[];
|
||||
update: UpdateCheckResult;
|
||||
traceConfig: SupportTraceConfig;
|
||||
remoteDiagnostics: RemoteDiagnosticsInfo;
|
||||
}
|
||||
}
|
||||
|
||||
function createCollectorInspection(): CollectorInspectionResult {
|
||||
return {
|
||||
invalidCount: 0,
|
||||
duplicateCount: 0,
|
||||
packages: [{
|
||||
id: "visual-collector-package-sbs14hd",
|
||||
name: "SBS14HD",
|
||||
addedAt: VISUAL_NOW_MS,
|
||||
links: Array.from({ length: 16 }, (_unused, index) => ({
|
||||
id: `visual-collector-link-${index + 1}`,
|
||||
url: `https://1fichier.com/?visual${String(index + 1).padStart(2, "0")}`,
|
||||
fileName: `SBS14HD.part${String(index + 1).padStart(2, "0")}.rar`,
|
||||
fileSizeBytes: index === 15 ? 373_517_856 : 471_859_200,
|
||||
hoster: "1fichier",
|
||||
availability: "online" as const,
|
||||
status: "ready" as const,
|
||||
addedAt: VISUAL_NOW_MS
|
||||
}))
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
||||
export interface VisualClockTarget {
|
||||
setInterval: (handler: TimerHandler, timeout?: number, ...arguments_: unknown[]) => number;
|
||||
@@ -633,7 +657,8 @@ function createRemoteDiagnostics(): RemoteDiagnosticsInfo {
|
||||
export function createVisualFixture(scenario: VisualScenario): VisualFixture {
|
||||
if (scenario === "empty") {
|
||||
return {
|
||||
snapshot: createEmptySnapshot(),
|
||||
snapshot: createEmptySnapshot(),
|
||||
collector: createCollectorInspection(),
|
||||
history: [],
|
||||
update: createUpdate(false),
|
||||
traceConfig: createTraceConfig(),
|
||||
@@ -642,7 +667,8 @@ export function createVisualFixture(scenario: VisualScenario): VisualFixture {
|
||||
}
|
||||
|
||||
return {
|
||||
snapshot: createDenseSnapshot(),
|
||||
snapshot: createDenseSnapshot(),
|
||||
collector: createCollectorInspection(),
|
||||
history: createDenseHistory(),
|
||||
update: createUpdate(scenario === "update"),
|
||||
traceConfig: createTraceConfig(),
|
||||
|
||||
Reference in New Issue
Block a user