Compare commits
No commits in common. "2f44e050bc5eb3a0e38cbac7d28e0a98f55c73fe" and "f447c0f37a86ca65388cf2976360020e4100996f" have entirely different histories.
2f44e050bc
...
f447c0f37a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "real-debrid-downloader",
|
"name": "real-debrid-downloader",
|
||||||
"version": "1.7.83",
|
"version": "1.7.82",
|
||||||
"description": "Desktop downloader",
|
"description": "Desktop downloader",
|
||||||
"main": "build/main/main/main.js",
|
"main": "build/main/main/main.js",
|
||||||
"author": "Sucukdeluxe",
|
"author": "Sucukdeluxe",
|
||||||
|
|||||||
@ -1822,15 +1822,13 @@ export class DownloadManager extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public resetSessionStats(): void {
|
public resetSessionStats(): void {
|
||||||
const now = nowMs();
|
|
||||||
this.session.totalDownloadedBytes = 0;
|
this.session.totalDownloadedBytes = 0;
|
||||||
this.sessionDownloadedBytes = 0;
|
this.sessionDownloadedBytes = 0;
|
||||||
this.sessionCompletedFiles = 0;
|
this.sessionCompletedFiles = 0;
|
||||||
this.session.runStartedAt = this.session.running ? now : 0;
|
this.session.runStartedAt = this.session.running ? nowMs() : 0;
|
||||||
this.appSessionStartedAt = now;
|
|
||||||
this.session.summaryText = "";
|
this.session.summaryText = "";
|
||||||
this.lastGlobalProgressBytes = 0;
|
this.lastGlobalProgressBytes = 0;
|
||||||
this.lastGlobalProgressAt = now;
|
this.lastGlobalProgressAt = nowMs();
|
||||||
this.speedEvents = [];
|
this.speedEvents = [];
|
||||||
this.speedEventsHead = 0;
|
this.speedEventsHead = 0;
|
||||||
this.speedBytesLastWindow = 0;
|
this.speedBytesLastWindow = 0;
|
||||||
|
|||||||
@ -6978,35 +6978,6 @@ describe("download manager", () => {
|
|||||||
expect(savedSettings.totalRuntimeAllTimeMs || 0).toBeGreaterThanOrEqual(2 * 60 * 60 * 1000 + 100);
|
expect(savedSettings.totalRuntimeAllTimeMs || 0).toBeGreaterThanOrEqual(2 * 60 * 60 * 1000 + 100);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
it("resets session runtime without affecting all-time runtime", async () => {
|
|
||||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
|
||||||
tempDirs.push(root);
|
|
||||||
|
|
||||||
const manager = new DownloadManager(
|
|
||||||
{
|
|
||||||
...defaultSettings(),
|
|
||||||
token: "rd-token",
|
|
||||||
outputDir: path.join(root, "downloads"),
|
|
||||||
extractDir: path.join(root, "extract"),
|
|
||||||
totalRuntimeAllTimeMs: 90 * 60 * 1000
|
|
||||||
},
|
|
||||||
emptySession(),
|
|
||||||
createStoragePaths(path.join(root, "state"))
|
|
||||||
);
|
|
||||||
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 120));
|
|
||||||
|
|
||||||
const beforeReset = manager.getStats();
|
|
||||||
expect(beforeReset.sessionRuntimeMs).toBeGreaterThanOrEqual(100);
|
|
||||||
|
|
||||||
manager.resetSessionStats();
|
|
||||||
|
|
||||||
const afterReset = manager.getStats();
|
|
||||||
expect(afterReset.sessionRuntimeMs).toBeLessThan(beforeReset.sessionRuntimeMs);
|
|
||||||
expect(afterReset.sessionRuntimeMs).toBeLessThan(100);
|
|
||||||
expect(afterReset.totalRuntimeMs).toBeGreaterThanOrEqual(90 * 60 * 1000);
|
|
||||||
}, 10000);
|
|
||||||
|
|
||||||
it("writes auto-rename details into rename and item logs", async () => {
|
it("writes auto-rename details into rename and item logs", async () => {
|
||||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
||||||
tempDirs.push(root);
|
tempDirs.push(root);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user