fix(downloads): a download larger than the space left says so, not "processing failed"
yt-dlp refuses a file announced over `max_filesize` by logging one line and returning with no file (measured, and pinned in test_formats against a local server): the worker found no output and failed the job as `postprocess`. `formats.watching_size_cap` now sees that line through our yt-dlp logger, and the download (and, should it ever happen, a YouTube clip's range fetch) fails as the owner's refusal with DOWNLOAD_TOO_BIG_MESSAGE, classified `quota_exceeded`. The download's quota copy says it does not fit in what is left — true at a full cap too — instead of "Storage full". A pre-existing type error the change touched is fixed (baseline down by one).
This commit is contained in:
@@ -307,8 +307,8 @@
|
||||
"body": "Something went wrong with this download. The technical details below may help."
|
||||
},
|
||||
"quota_exceeded": {
|
||||
"short": "Storage full",
|
||||
"body": "This download was stopped because your storage quota is already used up. Delete something from your library, then try again."
|
||||
"short": "Not enough storage",
|
||||
"body": "This download doesn't fit in the storage you have left. Delete something from your library, then try again."
|
||||
}
|
||||
},
|
||||
"catalog": {
|
||||
|
||||
@@ -307,8 +307,8 @@
|
||||
"body": "Valami hiba történt ennél a letöltésnél. Az alábbi technikai részletek segíthetnek."
|
||||
},
|
||||
"quota_exceeded": {
|
||||
"short": "Betelt a tárhely",
|
||||
"body": "Ez a letöltés leállt, mert a tárhelykereted már elfogyott. Törölj valamit a könyvtáradból, aztán próbáld újra."
|
||||
"short": "Nincs elég tárhely",
|
||||
"body": "Ez a letöltés nem fér bele a megmaradt tárhelyedbe. Törölj valamit a könyvtáradból, aztán próbáld újra."
|
||||
}
|
||||
},
|
||||
"catalog": {
|
||||
|
||||
@@ -81,13 +81,31 @@ describe("failTitleKey", () => {
|
||||
expect(i18n.t(failCopyKeys(download, "body"))).toBe(
|
||||
i18n.t("downloads.errors.fail.cat.quota_exceeded.body"),
|
||||
);
|
||||
// Its headline too: space is left, so not "Storage full".
|
||||
// Its headline too, worded for the converted file rather than the download it is not.
|
||||
const short = i18n.t(failCopyKeys(upload, "short"));
|
||||
expect(short).not.toMatch(/^downloads\./);
|
||||
expect(short).not.toBe(i18n.t("downloads.errors.fail.cat.quota_exceeded.short"));
|
||||
}
|
||||
});
|
||||
|
||||
it("a download refused for storage says it does not fit, true with space left or none", async () => {
|
||||
// Refused at a full cap before it starts, or by yt-dlp for a file larger than what is left: one
|
||||
// sentence true of both, so never "full" or "used up".
|
||||
const download = {
|
||||
error_code: "quota_exceeded",
|
||||
error_detail: null,
|
||||
job_kind: "download",
|
||||
} as const;
|
||||
for (const lng of ["en", "hu"]) {
|
||||
await i18n.changeLanguage(lng);
|
||||
for (const part of ["short", "body"] as const) {
|
||||
const text = i18n.t(failCopyKeys(download, part));
|
||||
expect(text).not.toMatch(/^downloads\./);
|
||||
expect(text).not.toMatch(/full|used up|betelt|elfogyott/i);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("a clip refused for storage says so of a clip, and not that the quota is used up", async () => {
|
||||
// Refused before it is cut (nothing left) or after (the cut is bigger than what is left): one
|
||||
// sentence true of both, worded for a clip and naming the clip-side way out.
|
||||
|
||||
Reference in New Issue
Block a user