release: prepare v2.0.55 metadata preview
Publish pre-download metadata resolution for 1Fichier and DDownload together with the rebuilt package-oriented link collector. Restore structured queue JSON imports and direct Ctrl+L/File-menu access to link analysis before creating release artifacts.
This commit is contained in:
+65
-13
@@ -837,7 +837,29 @@ export function getSnapshotRenderDelay(itemCount: number, running: boolean, acti
|
||||
if (activeTab !== "downloads") delay = Math.max(delay, 800);
|
||||
return delay;
|
||||
}
|
||||
|
||||
|
||||
export function classifyCollectorImportFileName(fileName: string): "queue" | "links" | "unsupported" {
|
||||
const normalized = String(fileName || "").trim().toLowerCase();
|
||||
if (normalized.endsWith(".json")) return "queue";
|
||||
if (normalized.endsWith(".txt")) return "links";
|
||||
return "unsupported";
|
||||
}
|
||||
|
||||
export async function readCollectorImportFiles(
|
||||
files: ReadonlyArray<{ name: string; text: () => Promise<string> }>
|
||||
): Promise<{ queueJson: string[]; linkText: string }> {
|
||||
const queueJson: string[] = [];
|
||||
const linkText: string[] = [];
|
||||
for (const file of files) {
|
||||
const kind = classifyCollectorImportFileName(file.name);
|
||||
if (kind === "unsupported") continue;
|
||||
const text = await file.text();
|
||||
if (kind === "queue") queueJson.push(text);
|
||||
else linkText.push(text);
|
||||
}
|
||||
return { queueJson, linkText: linkText.join("\n") };
|
||||
}
|
||||
|
||||
const KNOWN_HOSTERS: { id: string; label: string }[] = [
|
||||
{ id: "rapidgator", label: "Rapidgator" },
|
||||
{ id: "uploaded", label: "Uploaded" },
|
||||
@@ -3498,9 +3520,35 @@ export function App(): ReactElement {
|
||||
});
|
||||
};
|
||||
|
||||
onImportDlcRef.current = onImportDlc;
|
||||
|
||||
const onDrop = async (event: DragEvent<HTMLElement>): Promise<void> => {
|
||||
onImportDlcRef.current = onImportDlc;
|
||||
|
||||
const importQueueJsonTexts = async (queueJson: string[]): Promise<void> => {
|
||||
if (queueJson.length === 0) return;
|
||||
setCollectorError("");
|
||||
await performQuickAction(async () => {
|
||||
await persistDraftSettings();
|
||||
const existingIds = new Set(Object.keys(snapshotRef.current.session.packages));
|
||||
let addedPackages = 0;
|
||||
let addedLinks = 0;
|
||||
for (const json of queueJson) {
|
||||
const result = await window.rd.importQueue(json);
|
||||
addedPackages += result.addedPackages;
|
||||
addedLinks += result.addedLinks;
|
||||
}
|
||||
if (addedLinks === 0) {
|
||||
setCollectorError("Keine gültigen Links in der Queue-Datei gefunden");
|
||||
showToast("Keine gültigen Links in der Queue-Datei gefunden", 3000);
|
||||
return;
|
||||
}
|
||||
showToast(`Importiert: ${addedPackages} Paket(e), ${addedLinks} Link(s)`);
|
||||
if (snapshotRef.current.settings.collapseNewPackages) await collapseNewPackages(existingIds);
|
||||
}, (error) => {
|
||||
setCollectorError(`Import fehlgeschlagen: ${String(error)}`);
|
||||
showToast(`Import fehlgeschlagen: ${String(error)}`, 2600);
|
||||
});
|
||||
};
|
||||
|
||||
const onDrop = async (event: DragEvent<HTMLElement>): Promise<void> => {
|
||||
event.preventDefault();
|
||||
dragDepthRef.current = 0;
|
||||
dragOverRef.current = false;
|
||||
@@ -3515,8 +3563,9 @@ export function App(): ReactElement {
|
||||
if (dlc.length > 0) {
|
||||
await enqueueCollectorInspection(() => window.rd.inspectCollectorContainers(dlc, Date.now()));
|
||||
} else if (importFiles.length > 0) {
|
||||
const importedText = (await Promise.all(importFiles.map((file) => file.text()))).join("\n");
|
||||
await inspectCollectorRawText(importedText);
|
||||
const { queueJson, linkText } = await readCollectorImportFiles(importFiles);
|
||||
await importQueueJsonTexts(queueJson);
|
||||
if (linkText.trim()) await inspectCollectorRawText(linkText);
|
||||
} else if (droppedText.trim()) {
|
||||
await inspectCollectorRawText(droppedText);
|
||||
}
|
||||
@@ -3566,7 +3615,9 @@ export function App(): ReactElement {
|
||||
return;
|
||||
}
|
||||
releasePickerBusy();
|
||||
await inspectCollectorRawText(await file.text());
|
||||
const { queueJson, linkText } = await readCollectorImportFiles([file]);
|
||||
await importQueueJsonTexts(queueJson);
|
||||
if (linkText.trim()) await inspectCollectorRawText(linkText);
|
||||
};
|
||||
|
||||
clearImportQueueFocusListener();
|
||||
@@ -3673,6 +3724,7 @@ export function App(): ReactElement {
|
||||
|
||||
const openCollectorInput = (): void => {
|
||||
setCollectorError("");
|
||||
setTab("collector");
|
||||
setCollectorInput({ draft: "" });
|
||||
};
|
||||
|
||||
@@ -4478,11 +4530,11 @@ export function App(): ReactElement {
|
||||
void window.rd.quit();
|
||||
return;
|
||||
}
|
||||
if (!e.shiftKey && e.key.toLowerCase() === "l") {
|
||||
if (inInput) return;
|
||||
e.preventDefault();
|
||||
setTab("collector");
|
||||
setOpenMenu(null);
|
||||
if (!e.shiftKey && e.key.toLowerCase() === "l") {
|
||||
if (inInput) return;
|
||||
e.preventDefault();
|
||||
openCollectorInput();
|
||||
setOpenMenu(null);
|
||||
return;
|
||||
}
|
||||
if (!e.shiftKey && e.key.toLowerCase() === "p") {
|
||||
@@ -5613,7 +5665,7 @@ export function App(): ReactElement {
|
||||
Datei
|
||||
</button>
|
||||
<div aria-hidden={openMenu !== "datei"} className={`menu-dropdown${openMenu === "datei" ? " is-open" : ""}`}>
|
||||
<button className="menu-dropdown-item" onClick={() => { closeMenus(); setTab("collector"); }}>
|
||||
<button className="menu-dropdown-item" onClick={() => { closeMenus(); openCollectorInput(); }}>
|
||||
<span>Text mit Links analysieren</span>
|
||||
<span className="shortcut">Strg+L</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user