WebUI: disallow unnecessary quotes in property name

Those two forms are the same and from now on we enforce to one style.
This commit is contained in:
Chocobo1 2024-12-20 19:08:27 +08:00
commit e630aedce1
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
41 changed files with 144 additions and 143 deletions

View file

@ -42,7 +42,7 @@ export default [
"Stylistic/no-mixed-operators": [ "Stylistic/no-mixed-operators": [
"error", "error",
{ {
"groups": [ groups: [
["&", "|", "^", "~", "<<", ">>", ">>>", "==", "!=", "===", "!==", ">", ">=", "<", "<=", "&&", "||", "in", "instanceof"] ["&", "|", "^", "~", "<<", ">>", ">>>", "==", "!=", "===", "!==", ">", ">=", "<", "<=", "&&", "||", "in", "instanceof"]
] ]
} }
@ -52,12 +52,13 @@ export default [
"error", "error",
"double", "double",
{ {
"avoidEscape": true, avoidEscape: true,
"allowTemplateLiterals": true allowTemplateLiterals: true
} }
], ],
"Stylistic/quote-props": ["error", "consistent-as-needed"],
"Stylistic/semi": "error", "Stylistic/semi": "error",
"Stylistic/spaced-comment": ["error", "always", { "exceptions": ["*"] }] "Stylistic/spaced-comment": ["error", "always", { exceptions: ["*"] }]
} }
} }
]; ];

View file

@ -39,8 +39,8 @@
fetch("api/v2/torrents/addPeers", { fetch("api/v2/torrents/addPeers", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hash, hashes: hash,
"peers": peers.join("|") peers: peers.join("|")
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -30,8 +30,8 @@
fetch("api/v2/torrents/addTrackers", { fetch("api/v2/torrents/addTrackers", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": new URI().getData("hash"), hash: new URI().getData("hash"),
"urls": $("trackersUrls").value urls: $("trackersUrls").value
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -29,8 +29,8 @@
fetch("api/v2/torrents/addWebSeeds", { fetch("api/v2/torrents/addWebSeeds", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": new URI().getData("hash"), hash: new URI().getData("hash"),
"urls": $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|") urls: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -29,7 +29,7 @@
fetch("api/v2/rss/removeItem", { fetch("api/v2/rss/removeItem", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"path": decodeURIComponent(path) path: decodeURIComponent(path)
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -30,7 +30,7 @@
fetch("api/v2/rss/removeRule", { fetch("api/v2/rss/removeRule", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"ruleName": decodeURIComponent(rule) ruleName: decodeURIComponent(rule)
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -28,8 +28,8 @@
fetch("api/v2/torrents/removeTrackers", { fetch("api/v2/torrents/removeTrackers", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": "*", hash: "*",
"urls": urls urls: urls
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -53,7 +53,7 @@
fetch("api/v2/transfer/setDownloadLimit", { fetch("api/v2/transfer/setDownloadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"limit": limit limit: limit
}) })
}) })
.then(async (response) => { .then(async (response) => {
@ -68,8 +68,8 @@
fetch("api/v2/torrents/setDownloadLimit", { fetch("api/v2/torrents/setDownloadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|"), hashes: hashes.join("|"),
"limit": limit limit: limit
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -54,8 +54,8 @@
fetch("api/v2/rss/setFeedURL", { fetch("api/v2/rss/setFeedURL", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"path": new URI().getData("path"), path: new URI().getData("path"),
"url": newUrl url: newUrl
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -40,9 +40,9 @@
fetch("api/v2/torrents/editTracker", { fetch("api/v2/torrents/editTracker", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": new URI().getData("hash"), hash: new URI().getData("hash"),
"origUrl": currentUrl, origUrl: currentUrl,
"newUrl": $("trackerUrl").value newUrl: $("trackerUrl").value
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -36,9 +36,9 @@
fetch("api/v2/torrents/editWebSeed", { fetch("api/v2/torrents/editWebSeed", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": new URI().getData("hash"), hash: new URI().getData("hash"),
"origUrl": origUrl, origUrl: origUrl,
"newUrl": encodeURIComponent($("url").value.trim()) newUrl: encodeURIComponent($("url").value.trim())
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -75,8 +75,8 @@
fetch("api/v2/torrents/createCategory", { fetch("api/v2/torrents/createCategory", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"category": categoryName, category: categoryName,
"savePath": savePath savePath: savePath
}) })
}) })
.then((response) => { .then((response) => {
@ -88,8 +88,8 @@
fetch("api/v2/torrents/setCategory", { fetch("api/v2/torrents/setCategory", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": uriHashes, hashes: uriHashes,
"category": categoryName category: categoryName
}) })
}) })
.then((response) => { .then((response) => {
@ -111,8 +111,8 @@
fetch("api/v2/torrents/createCategory", { fetch("api/v2/torrents/createCategory", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"category": categoryName, category: categoryName,
"savePath": savePath savePath: savePath
}) })
}) })
.then((response) => { .then((response) => {
@ -130,8 +130,8 @@
fetch("api/v2/torrents/editCategory", { fetch("api/v2/torrents/editCategory", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"category": uriCategoryName, // category name can't be changed category: uriCategoryName, // category name can't be changed
"savePath": savePath savePath: savePath
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -45,8 +45,8 @@
fetch("api/v2/rss/addFeed", { fetch("api/v2/rss/addFeed", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"url": feedURL, url: feedURL,
"path": path ? (path + "\\" + feedURL) : "" path: path ? (path + "\\" + feedURL) : ""
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -46,7 +46,7 @@
fetch("api/v2/rss/addFolder", { fetch("api/v2/rss/addFolder", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"path": path ? (path + "\\" + folderName) : folderName path: path ? (path + "\\" + folderName) : folderName
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -43,8 +43,8 @@
fetch("api/v2/rss/setRule", { fetch("api/v2/rss/setRule", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"ruleName": name, ruleName: name,
"ruleDef": "{}" ruleDef: "{}"
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -59,8 +59,8 @@
fetch("api/v2/torrents/addTags", { fetch("api/v2/torrents/addTags", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": uriHashes, hashes: uriHashes,
"tags": tagName tags: tagName
}) })
}) })
.then(async (response) => { .then(async (response) => {
@ -78,7 +78,7 @@
fetch("api/v2/torrents/createTags", { fetch("api/v2/torrents/createTags", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"tags": tagName tags: tagName
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -47,8 +47,8 @@
fetch("api/v2/torrents/rename", { fetch("api/v2/torrents/rename", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": hash, hash: hash,
"name": name name: name
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -54,8 +54,8 @@
fetch("api/v2/rss/moveItem", { fetch("api/v2/rss/moveItem", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"itemPath": oldPath, itemPath: oldPath,
"destPath": newPath destPath: newPath
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -63,9 +63,9 @@
fetch((isFolder ? "api/v2/torrents/renameFolder" : "api/v2/torrents/renameFile"), { fetch((isFolder ? "api/v2/torrents/renameFolder" : "api/v2/torrents/renameFile"), {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": hash, hash: hash,
"oldPath": oldPath, oldPath: oldPath,
"newPath": newPath newPath: newPath
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -64,11 +64,11 @@
new Keyboard({ new Keyboard({
defaultEventType: "keydown", defaultEventType: "keydown",
events: { events: {
"Escape": function(event) { Escape: (event) => {
window.qBittorrent.Client.closeWindow(windowEl); window.qBittorrent.Client.closeWindow(windowEl);
event.preventDefault(); event.preventDefault();
}, },
"Esc": function(event) { Esc: (event) => {
window.qBittorrent.Client.closeWindow(windowEl); window.qBittorrent.Client.closeWindow(windowEl);
event.preventDefault(); event.preventDefault();
} }

View file

@ -54,8 +54,8 @@
fetch("api/v2/rss/renameRule", { fetch("api/v2/rss/renameRule", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"ruleName": oldName, ruleName: oldName,
"newRuleName": newName newRuleName: newName
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -121,7 +121,7 @@ window.qBittorrent.Cache ??= (() => {
fetch("api/v2/app/setPreferences", { fetch("api/v2/app/setPreferences", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"json": JSON.stringify(obj.data) json: JSON.stringify(obj.data)
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -724,25 +724,25 @@ window.addEventListener("DOMContentLoaded", () => {
}; };
const statusSortOrder = Object.freeze({ const statusSortOrder = Object.freeze({
"unknown": -1, unknown: -1,
"forcedDL": 0, forcedDL: 0,
"downloading": 1, downloading: 1,
"forcedMetaDL": 2, forcedMetaDL: 2,
"metaDL": 3, metaDL: 3,
"stalledDL": 4, stalledDL: 4,
"forcedUP": 5, forcedUP: 5,
"uploading": 6, uploading: 6,
"stalledUP": 7, stalledUP: 7,
"checkingResumeData": 8, checkingResumeData: 8,
"queuedDL": 9, queuedDL: 9,
"queuedUP": 10, queuedUP: 10,
"checkingUP": 11, checkingUP: 11,
"checkingDL": 12, checkingDL: 12,
"stoppedDL": 13, stoppedDL: 13,
"stoppedUP": 14, stoppedUP: 14,
"moving": 15, moving: 15,
"missingFiles": 16, missingFiles: 16,
"error": 17 error: 17
}); });
let syncMainDataTimeoutID = -1; let syncMainDataTimeoutID = -1;

View file

@ -64,7 +64,7 @@ window.qBittorrent.DynamicTable ??= (() => {
}; };
let DynamicTableHeaderContextMenuClass = null; let DynamicTableHeaderContextMenuClass = null;
let ProgressColumnWidth = -1; let progressColumnWidth = -1;
const DynamicTable = new Class({ const DynamicTable = new Class({
@ -772,8 +772,8 @@ window.qBittorrent.DynamicTable ??= (() => {
if (!this.rows.has(rowId)) { if (!this.rows.has(rowId)) {
row = { row = {
"full_data": {}, full_data: {},
"rowId": rowId rowId: rowId
}; };
this.rows.set(rowId, row); this.rows.set(rowId, row);
} }
@ -1231,16 +1231,16 @@ window.qBittorrent.DynamicTable ??= (() => {
const div = td.getChildren("div")[0]; const div = td.getChildren("div")[0];
if (td.resized) { if (td.resized) {
td.resized = false; td.resized = false;
div.setWidth(ProgressColumnWidth - 5); div.setWidth(progressColumnWidth - 5);
} }
if (div.getValue() !== progressFormatted) if (div.getValue() !== progressFormatted)
div.setValue(progressFormatted); div.setValue(progressFormatted);
} }
else { else {
if (ProgressColumnWidth < 0) if (progressColumnWidth < 0)
ProgressColumnWidth = td.offsetWidth; progressColumnWidth = td.offsetWidth;
td.append(new window.qBittorrent.ProgressBar.ProgressBar(progressFormatted.toFloat(), { td.append(new window.qBittorrent.ProgressBar.ProgressBar(progressFormatted.toFloat(), {
"width": ProgressColumnWidth - 5 width: progressColumnWidth - 5
})); }));
td.resized = false; td.resized = false;
} }
@ -1249,11 +1249,11 @@ window.qBittorrent.DynamicTable ??= (() => {
this.columns["progress"].onResize = function(columnName) { this.columns["progress"].onResize = function(columnName) {
const pos = this.getColumnPos(columnName); const pos = this.getColumnPos(columnName);
const trs = this.tableBody.getElements("tr"); const trs = this.tableBody.getElements("tr");
ProgressColumnWidth = -1; progressColumnWidth = -1;
for (let i = 0; i < trs.length; ++i) { for (let i = 0; i < trs.length; ++i) {
const td = trs[i].getElements("td")[pos]; const td = trs[i].getElements("td")[pos];
if (ProgressColumnWidth < 0) if (progressColumnWidth < 0)
ProgressColumnWidth = td.offsetWidth; progressColumnWidth = td.offsetWidth;
td.resized = true; td.resized = true;
this.columns[columnName].updateTd(td, this.rows.get(trs[i].rowId)); this.columns[columnName].updateTd(td, this.rows.get(trs[i].rowId));
} }
@ -3265,7 +3265,7 @@ window.qBittorrent.DynamicTable ??= (() => {
initColumnsFunctions: function() { initColumnsFunctions: function() {
this.columns["timestamp"].updateTd = function(td, row) { this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString(); const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ "text": date, "title": date }); td.set({ text: date, title: date });
}; };
this.columns["type"].updateTd = function(td, row) { this.columns["type"].updateTd = function(td, row) {
@ -3293,7 +3293,7 @@ window.qBittorrent.DynamicTable ??= (() => {
addClass = "logUnknown"; addClass = "logUnknown";
break; break;
} }
td.set({ "text": logLevel, "title": logLevel }); td.set({ text: logLevel, title: logLevel });
td.closest("tr").className = `logTableRow${addClass}`; td.closest("tr").className = `logTableRow${addClass}`;
}; };
}, },
@ -3340,7 +3340,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this.columns["timestamp"].updateTd = function(td, row) { this.columns["timestamp"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString(); const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
td.set({ "text": date, "title": date }); td.set({ text: date, title: date });
}; };
this.columns["blocked"].updateTd = function(td, row) { this.columns["blocked"].updateTd = function(td, row) {
@ -3353,7 +3353,7 @@ window.qBittorrent.DynamicTable ??= (() => {
status = "QBT_TR(Banned)QBT_TR[CONTEXT=ExecutionLogWidget]"; status = "QBT_TR(Banned)QBT_TR[CONTEXT=ExecutionLogWidget]";
addClass = "peerBanned"; addClass = "peerBanned";
} }
td.set({ "text": status, "title": status }); td.set({ text: status, title: status });
td.closest("tr").className = `logTableRow${addClass}`; td.closest("tr").className = `logTableRow${addClass}`;
}; };
}, },

View file

@ -41,18 +41,18 @@ window.qBittorrent.FileTree ??= (() => {
}; };
const FilePriority = { const FilePriority = {
"Ignored": 0, Ignored: 0,
"Normal": 1, Normal: 1,
"High": 6, High: 6,
"Maximum": 7, Maximum: 7,
"Mixed": -1 Mixed: -1
}; };
Object.freeze(FilePriority); Object.freeze(FilePriority);
const TriState = { const TriState = {
"Unchecked": 0, Unchecked: 0,
"Checked": 1, Checked: 1,
"Partial": 2 Partial: 2
}; };
Object.freeze(TriState); Object.freeze(TriState);

View file

@ -600,7 +600,7 @@ const initializeWindows = () => {
url: "api/v2/torrents/recheck", url: "api/v2/torrents/recheck",
method: "post", method: "post",
data: { data: {
"hashes": hashes.join("|"), hashes: hashes.join("|"),
}, },
onSuccess: () => { onSuccess: () => {
updateMainData(); updateMainData();
@ -694,7 +694,7 @@ const initializeWindows = () => {
paddingHorizontal: 0, paddingHorizontal: 0,
width: 800, width: 800,
height: 420, height: 420,
resizeLimit: { "x": [800], "y": [420] } resizeLimit: { x: [800], y: [420] }
}); });
} }
} }

View file

@ -48,13 +48,13 @@ window.qBittorrent.PiecesBar ??= (() => {
const PiecesBar = new Class({ const PiecesBar = new Class({
initialize: (pieces, parameters) => { initialize: (pieces, parameters) => {
const vals = { const vals = {
"id": "piecesbar_" + (piecesBarUniqueId++), id: "piecesbar_" + (piecesBarUniqueId++),
"width": 0, width: 0,
"height": 0, height: 0,
"downloadingColor": "hsl(110deg 94% 27%)", // @TODO palette vars not supported for this value, apply average downloadingColor: "hsl(110deg 94% 27%)", // @TODO palette vars not supported for this value, apply average
"haveColor": "hsl(210deg 55% 55%)", // @TODO palette vars not supported for this value, apply average haveColor: "hsl(210deg 55% 55%)", // @TODO palette vars not supported for this value, apply average
"borderSize": 1, borderSize: 1,
"borderColor": "var(--color-border-default)" borderColor: "var(--color-border-default)"
}; };
if (parameters && (typeOf(parameters) === "object")) if (parameters && (typeOf(parameters) === "object"))

View file

@ -36,18 +36,18 @@ window.qBittorrent.ProgressBar ??= (() => {
}; };
}; };
let ProgressBars = 0; let progressBars = 0;
const ProgressBar = new Class({ const ProgressBar = new Class({
initialize: (value, parameters) => { initialize: (value, parameters) => {
const vals = { const vals = {
"id": "progressbar_" + (ProgressBars++), id: "progressbar_" + (progressBars++),
"value": [value, 0].pick(), value: [value, 0].pick(),
"width": 0, width: 0,
"height": 0, height: 0,
"darkbg": "var(--color-background-blue)", darkbg: "var(--color-background-blue)",
"darkfg": "var(--color-text-white)", darkfg: "var(--color-text-white)",
"lightbg": "var(--color-background-default)", lightbg: "var(--color-background-default)",
"lightfg": "var(--color-text-default)" lightfg: "var(--color-text-default)"
}; };
if (parameters && (typeOf(parameters) === "object")) if (parameters && (typeOf(parameters) === "object"))
Object.append(vals, parameters); Object.append(vals, parameters);

View file

@ -311,9 +311,9 @@ window.qBittorrent.PropFiles ??= (() => {
fetch("api/v2/torrents/filePrio", { fetch("api/v2/torrents/filePrio", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": current_hash, hash: current_hash,
"id": fileIds.join("|"), id: fileIds.join("|"),
"priority": priority priority: priority
}) })
}) })
.then((response) => { .then((response) => {
@ -580,7 +580,7 @@ window.qBittorrent.PropFiles ??= (() => {
paddingHorizontal: 0, paddingHorizontal: 0,
width: 800, width: 800,
height: 420, height: 420,
resizeLimit: { "x": [800], "y": [420] } resizeLimit: { x: [800], y: [420] }
}); });
}; };

View file

@ -154,8 +154,8 @@ window.qBittorrent.PropPeers ??= (() => {
fetch("api/v2/transfer/banPeers", { fetch("api/v2/transfer/banPeers", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hash": torrentsTable.getCurrentTorrentID(), hash: torrentsTable.getCurrentTorrentID(),
"peers": selectedPeers.join("|") peers: selectedPeers.join("|")
}) })
}); });
} }

View file

@ -10,9 +10,9 @@ window.qBittorrent.MultiRename ??= (() => {
}; };
const AppliesTo = { const AppliesTo = {
"FilenameExtension": "FilenameExtension", FilenameExtension: "FilenameExtension",
"Filename": "Filename", Filename: "Filename",
"Extension": "Extension" Extension: "Extension"
}; };
const RenameFiles = new Class({ const RenameFiles = new Class({

View file

@ -90,7 +90,7 @@ MochaUI.extend({
fetch("api/v2/torrents/uploadLimit", { fetch("api/v2/torrents/uploadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|") hashes: hashes.join("|")
}) })
}) })
.then(async (response) => { .then(async (response) => {
@ -199,7 +199,7 @@ MochaUI.extend({
fetch("api/v2/torrents/downloadLimit", { fetch("api/v2/torrents/downloadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|") hashes: hashes.join("|")
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -48,8 +48,8 @@
fetch("api/v2/torrents/setLocation", { fetch("api/v2/torrents/setLocation", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": new URI().getData("hashes"), hashes: new URI().getData("hashes"),
"location": location location: location
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -103,10 +103,10 @@
fetch("api/v2/torrents/setShareLimits", { fetch("api/v2/torrents/setShareLimits", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashesList.join("|"), hashes: hashesList.join("|"),
"ratioLimit": ratioLimitValue, ratioLimit: ratioLimitValue,
"seedingTimeLimit": seedingTimeLimitValue, seedingTimeLimit: seedingTimeLimitValue,
"inactiveSeedingTimeLimit": inactiveSeedingTimeLimitValue inactiveSeedingTimeLimit: inactiveSeedingTimeLimitValue
}) })
}) })
.then(async (response) => { .then(async (response) => {

View file

@ -53,7 +53,7 @@
fetch("api/v2/transfer/setUploadLimit", { fetch("api/v2/transfer/setUploadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"limit": limit limit: limit
}) })
}) })
.then((response) => { .then((response) => {
@ -68,8 +68,8 @@
fetch("api/v2/torrents/setUploadLimit", { fetch("api/v2/torrents/setUploadLimit", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|"), hashes: hashes.join("|"),
"limit": limit limit: limit
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -29,8 +29,8 @@
fetch("api/v2/torrents/setAutoManagement", { fetch("api/v2/torrents/setAutoManagement", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|"), hashes: hashes.join("|"),
"enable": enable enable: enable
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -31,7 +31,7 @@
fetch("api/v2/torrents/recheck", { fetch("api/v2/torrents/recheck", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|") hashes: hashes.join("|")
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -59,7 +59,7 @@
rememberButton.addEventListener("click", (e) => { rememberButton.addEventListener("click", (e) => {
window.qBittorrent.Cache.preferences.set({ window.qBittorrent.Cache.preferences.set({
data: { data: {
"delete_torrent_content_files": deleteCB.checked delete_torrent_content_files: deleteCB.checked
}, },
onSuccess: () => { onSuccess: () => {
prefDeleteContentFiles = deleteCB.checked; prefDeleteContentFiles = deleteCB.checked;
@ -80,8 +80,8 @@
fetch("api/v2/torrents/delete", { fetch("api/v2/torrents/delete", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"hashes": hashes.join("|"), hashes: hashes.join("|"),
"deleteFiles": deleteCB.checked deleteFiles: deleteCB.checked
}) })
}) })
.then((response) => { .then((response) => {

View file

@ -2112,7 +2112,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
method: "get", method: "get",
noCache: true, noCache: true,
data: { data: {
"iface": iface iface: iface
}, },
onFailure: () => { onFailure: () => {
alert("Could not contact qBittorrent"); alert("Could not contact qBittorrent");

View file

@ -883,8 +883,8 @@
saveWindowSize(id); saveWindowSize(id);
}), }),
resizeLimit: { resizeLimit: {
"x": [800, 2500], x: [800, 2500],
"y": [500, 2000] y: [500, 2000]
} }
}); });
}; };

View file

@ -40,8 +40,8 @@ const submitLoginForm = (event) => {
fetch("api/v2/auth/login", { fetch("api/v2/auth/login", {
method: "POST", method: "POST",
body: new URLSearchParams({ body: new URLSearchParams({
"username": usernameElement.value, username: usernameElement.value,
"password": passwordElement.value password: passwordElement.value
}) })
}) })
.then(async (response) => { .then(async (response) => {