diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-03-15 11:08:00 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-03-15 11:08:00 -0500 |
| commit | c7c94d527f2eb9791541e55857353d045152d95e (patch) | |
| tree | 6e514318430758b5174757392c48e582a1ea708f | |
| parent | 7d65971847354f9068ae7ea2c3bf53857566189f (diff) | |
| parent | 0165b5f6cbae759acfe337170f831a11a45634e9 (diff) | |
| download | slskd-c7c94d527f2eb9791541e55857353d045152d95e.tar.gz | |
Merge remote-tracking branch 'origin/master' into retries
| -rw-r--r-- | docs/vpn.md | 3 | ||||
| -rw-r--r-- | src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs | 8 | ||||
| -rw-r--r-- | src/slskd/Files/FileExtensions.cs | 28 | ||||
| -rw-r--r-- | src/slskd/Files/FileService.cs | 4 | ||||
| -rw-r--r-- | src/slskd/Transfers/Types/Transfer.cs | 2 | ||||
| -rw-r--r-- | src/web/package-lock.json | 297 | ||||
| -rw-r--r-- | src/web/package.json | 2 | ||||
| -rw-r--r-- | src/web/src/components/Search/Detail/SearchDetail.jsx | 2 | ||||
| -rw-r--r-- | tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs | 75 |
9 files changed, 266 insertions, 155 deletions
diff --git a/docs/vpn.md b/docs/vpn.md index 47b45b3b..08fa84a0 100644 --- a/docs/vpn.md +++ b/docs/vpn.md @@ -45,7 +45,6 @@ services: - WIREGUARD_PRIVATE_KEY=<your key> - SERVER_COUNTRIES=Netherlands - VPN_PORT_FORWARDING=on - - GLUETUN_HTTP_CONTROL_SERVER_ENABLE=on - HTTP_CONTROL_SERVER_AUTH_DEFAULT_ROLE='{"auth":"apikey","apikey":"abcd123"}' restart: unless-stopped slskd: @@ -64,4 +63,4 @@ services: volumes: - ~/slskd/:/app restart: unless-stopped -```
\ No newline at end of file +``` diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs index 66083a83..5965f7b7 100644 --- a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs @@ -46,6 +46,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration // check to see if the Attempts and BatchId columns exist if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) + && columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt)) && columns.Any(c => c.Name == nameof(Transfer.BatchId)) && indexes.Any(i => i.Name.Equals("IDX_Transfers_BatchId", StringComparison.OrdinalIgnoreCase))) { @@ -78,7 +79,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration command.ExecuteNonQuery(); } - Log.Information("> Adding BatchId and Attempts columns to the Transfers table..."); + Log.Information("> Adding BatchId, Attempts, and NextAttemptAt columns to the Transfers table..."); if (!columns.Any(c => c.Name == nameof(Transfer.BatchId))) { @@ -90,6 +91,11 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); } + if (!columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt))) + { + Exec("ALTER TABLE Transfers ADD COLUMN NextAttemptAt TEXT NULL;"); + } + Log.Information("> New columns added"); Log.Information("> Adding missing index(es) on the Transfers table..."); diff --git a/src/slskd/Files/FileExtensions.cs b/src/slskd/Files/FileExtensions.cs index 4aa7a648..4a0a2369 100644 --- a/src/slskd/Files/FileExtensions.cs +++ b/src/slskd/Files/FileExtensions.cs @@ -59,4 +59,32 @@ public static class FileExtensions return (UnixFileMode)mode; } + + /// <summary> + /// Returns the specified <paramref name="unixFileMode"/> with execute flags added for each read flag, ensuring that the resulting + /// mask can be used for directories (which require the execute flag for traversal). + /// </summary> + /// <param name="unixFileMode">The existing mode.</param> + /// <returns>The updated mode.</returns> + public static UnixFileMode WithExecuteFlagsForEachReadFlag(this UnixFileMode unixFileMode) + { + var u = unixFileMode; + + if (u.HasFlag(UnixFileMode.UserRead)) + { + u |= UnixFileMode.UserExecute; + } + + if (u.HasFlag(UnixFileMode.GroupRead)) + { + u |= UnixFileMode.GroupExecute; + } + + if (u.HasFlag(UnixFileMode.OtherRead)) + { + u |= UnixFileMode.OtherExecute; + } + + return u; + } }
\ No newline at end of file diff --git a/src/slskd/Files/FileService.cs b/src/slskd/Files/FileService.cs index de577b6c..a325a588 100644 --- a/src/slskd/Files/FileService.cs +++ b/src/slskd/Files/FileService.cs @@ -333,7 +333,7 @@ namespace slskd.Files { if (!OperatingSystem.IsWindows() && unixCreateMode.HasValue) { - Directory.CreateDirectory(path, unixCreateMode.Value); + Directory.CreateDirectory(path, unixCreateMode.Value.WithExecuteFlagsForEachReadFlag()); } else { @@ -407,7 +407,7 @@ namespace slskd.Files { if (!OperatingSystem.IsWindows() && unixCreateMode.HasValue) { - Directory.CreateDirectory(destinationDirectory, unixCreateMode.Value); + Directory.CreateDirectory(destinationDirectory, unixCreateMode.Value.WithExecuteFlagsForEachReadFlag()); } else { diff --git a/src/slskd/Transfers/Types/Transfer.cs b/src/slskd/Transfers/Types/Transfer.cs index 56f6b333..7facb3ee 100644 --- a/src/slskd/Transfers/Types/Transfer.cs +++ b/src/slskd/Transfers/Types/Transfer.cs @@ -69,6 +69,8 @@ namespace slskd.Transfers public int Attempts { get; set; } = 0; + public DateTime? NextAttemptAt { get; set; } = null; + [JsonIgnore] public bool Removed { get; set; } diff --git a/src/web/package-lock.json b/src/web/package-lock.json index e3b4e90c..e0a23e40 100644 --- a/src/web/package-lock.json +++ b/src/web/package-lock.json @@ -32,7 +32,7 @@ "@semantic-ui-react/craco-less": "^3.0.0", "@semantic-ui-react/css-patch": "^1.0.0", "eslint": "^8.56.0", - "eslint-config-canonical": "^42.8.1", + "eslint-config-canonical": "^42.8.3", "react-scripts": "^5.0.0" } }, @@ -8654,10 +8654,11 @@ } }, "node_modules/eslint-config-canonical": { - "version": "42.8.1", - "resolved": "https://registry.npmjs.org/eslint-config-canonical/-/eslint-config-canonical-42.8.1.tgz", - "integrity": "sha512-OsQD1TQJAVUH/tnLwumPyKFnB+wcZLIwIUJ73rLupvgD9XzinBaDf8ZAz1cPIkG/Fej3SgKvHWiPSFAp2Nd27w==", + "version": "42.8.3", + "resolved": "https://registry.npmjs.org/eslint-config-canonical/-/eslint-config-canonical-42.8.3.tgz", + "integrity": "sha512-sWPKXdlUKNI42ZIqbtyHJvrfM0jegmTZzo4xV13fvfcYefsgRSlxzXNkR+/62fsi8s/SyZsf8ZW3TyT3pv3aLg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.23.0", "@babel/eslint-parser": "^7.22.15", @@ -8666,8 +8667,8 @@ "@graphql-eslint/eslint-plugin": "^3.20.1", "@next/eslint-plugin-next": "^13.5.4", "@rushstack/eslint-patch": "^1.5.1", - "@typescript-eslint/eslint-plugin": "^6.19.0", - "@typescript-eslint/parser": "^6.19.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-ava": "^14.0.0", @@ -8677,7 +8678,7 @@ "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-fp": "^2.3.0", "eslint-plugin-import": "npm:eslint-plugin-i@^2.28.1", - "eslint-plugin-jest": "^27.4.2", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -8691,7 +8692,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-regexp": "^1.15.0", "eslint-plugin-simple-import-sort": "^10.0.0", - "eslint-plugin-typescript-sort-keys": "^3.1.0", + "eslint-plugin-typescript-sort-keys": "^3.2.0", "eslint-plugin-unicorn": "^48.0.1", "eslint-plugin-vitest": "^0.3.2", "eslint-plugin-yml": "^1.10.0", @@ -8708,33 +8709,32 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8742,52 +8742,28 @@ } } }, - "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8796,16 +8772,17 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8813,25 +8790,26 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8839,38 +8817,14 @@ } } }, - "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8878,22 +8832,23 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8906,12 +8861,13 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, + "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -8920,17 +8876,41 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8938,10 +8918,11 @@ } }, "node_modules/eslint-config-canonical/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -8973,19 +8954,20 @@ } }, "node_modules/eslint-config-canonical/node_modules/eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "28.14.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.14.0.tgz", + "integrity": "sha512-P9s/qXSMTpRTerE2FQ0qJet2gKbcGyFTPAJipoKxmWqR6uuFqIqk8FuEfg5yBieOezVrEfAMZrEwJ6yEp+1MFQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", - "eslint": "^7.0.0 || ^8.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -8998,10 +8980,11 @@ } }, "node_modules/eslint-config-canonical/node_modules/eslint-plugin-typescript-sort-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-3.1.0.tgz", - "integrity": "sha512-rgZeYfEguqKni/V7sbmgFu9/94UDAQd7YqNd0J7Qhw7SdLIGd0iBk2KgpjhRhe2ge4rPSLDIdFWwUiDqBOst6Q==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-3.3.0.tgz", + "integrity": "sha512-bRW3Rc/VNdrSP9OoY5wgjjaXCOOkZKpzvl/Mk6l8Sg8CMehVIcg9K4y33l+ZcZiknpl0aR6rKusxuCJNGZWmVw==", "dev": true, + "license": "ISC", "dependencies": { "@typescript-eslint/experimental-utils": "^5.0.0", "json-schema": "^0.4.0", @@ -9011,11 +8994,24 @@ "node": ">= 16" }, "peerDependencies": { - "@typescript-eslint/parser": "^6", + "@typescript-eslint/parser": ">=6", "eslint": "^7 || ^8", "typescript": "^3 || ^4 || ^5" } }, + "node_modules/eslint-config-canonical/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -10766,10 +10762,11 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12002,10 +11999,11 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -14920,10 +14918,11 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -18247,10 +18246,11 @@ } }, "node_modules/rollup": { - "version": "2.79.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", - "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", + "version": "2.80.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.80.0.tgz", + "integrity": "sha512-cIFJOD1DESzpjOBl763Kp1AH7UE/0fcdHe6rZXUdQ9c50uvgigvW97u3IcSeBwOkgqL/PXPBktBCh0KEu5L8XQ==", "dev": true, + "license": "MIT", "bin": { "rollup": "dist/bin/rollup" }, @@ -19994,10 +19994,11 @@ "dev": true }, "node_modules/ts-api-utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", - "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, diff --git a/src/web/package.json b/src/web/package.json index a4b30cb6..a0ffa143 100644 --- a/src/web/package.json +++ b/src/web/package.json @@ -37,7 +37,7 @@ "@semantic-ui-react/craco-less": "^3.0.0", "@semantic-ui-react/css-patch": "^1.0.0", "eslint": "^8.56.0", - "eslint-config-canonical": "^42.8.1", + "eslint-config-canonical": "^42.8.3", "react-scripts": "^5.0.0" }, "homepage": ".", diff --git a/src/web/src/components/Search/Detail/SearchDetail.jsx b/src/web/src/components/Search/Detail/SearchDetail.jsx index 1ec53849..458da3d3 100644 --- a/src/web/src/components/Search/Detail/SearchDetail.jsx +++ b/src/web/src/components/Search/Detail/SearchDetail.jsx @@ -129,7 +129,7 @@ const SearchDetail = ({ const create = async ({ navigate, search: searchForCreate }) => { reset(); - onCreate({ navigate, searchForCreate }); + onCreate({ navigate, search: searchForCreate }); }; const remove = async () => { diff --git a/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs b/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs index c270bb31..ea24bbd4 100644 --- a/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs +++ b/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs @@ -68,4 +68,79 @@ public class FileExtensionsTests Assert.NotNull(ex); Assert.IsType<ArgumentOutOfRangeException>(ex); } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_UserExecute_When_UserRead_Is_Set() + { + var result = UnixFileMode.UserRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.UserExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_GroupExecute_When_GroupRead_Is_Set() + { + var result = UnixFileMode.GroupRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.GroupExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_OtherExecute_When_OtherRead_Is_Set() + { + var result = UnixFileMode.OtherRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.OtherExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_UserExecute_When_UserRead_Is_Not_Set() + { + var result = UnixFileMode.UserWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.UserExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_GroupExecute_When_GroupRead_Is_Not_Set() + { + var result = UnixFileMode.GroupWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.GroupExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_OtherExecute_When_OtherRead_Is_Not_Set() + { + var result = UnixFileMode.OtherWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.OtherExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Preserves_Existing_Flags() + { + var mode = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead; + + var result = mode.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.UserRead)); + Assert.True(result.HasFlag(UnixFileMode.UserWrite)); + Assert.True(result.HasFlag(UnixFileMode.GroupRead)); + } + + [Theory] + [InlineData(UnixFileMode.UserRead | UnixFileMode.GroupRead | UnixFileMode.OtherRead, + UnixFileMode.UserRead | UnixFileMode.UserExecute | UnixFileMode.GroupRead | UnixFileMode.GroupExecute | UnixFileMode.OtherRead | UnixFileMode.OtherExecute)] + [InlineData(UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead | UnixFileMode.OtherRead, + UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute | UnixFileMode.GroupRead | UnixFileMode.GroupExecute | UnixFileMode.OtherRead | UnixFileMode.OtherExecute)] + [InlineData(UnixFileMode.None, UnixFileMode.None)] + [InlineData(UnixFileMode.UserWrite | UnixFileMode.GroupWrite | UnixFileMode.OtherWrite, + UnixFileMode.UserWrite | UnixFileMode.GroupWrite | UnixFileMode.OtherWrite)] + public void WithExecuteFlagsForEachReadFlag_Works_As_Expected(UnixFileMode input, UnixFileMode expected) + { + var result = input.WithExecuteFlagsForEachReadFlag(); + + Assert.Equal(expected, result); + } }
\ No newline at end of file |
