Code cleanup + lint

pull/687/head
Michael Shamoon 2 years ago
parent aaa1f76176
commit 12ed730897

@ -26,13 +26,10 @@ export default function Component({ service }) {
);
}
// const { torrents } = tdarrData.arguments;
const queue = parseInt(tdarrData.table1Count) + parseInt(tdarrData.table4Count);
const processed = parseInt(tdarrData.table2Count) + parseInt(tdarrData.table5Count);
const errored = parseInt(tdarrData.table3Count) + parseInt(tdarrData.table6Count);
const saved = parseFloat(tdarrData.sizeDiff) * 1000000000;
const queue = parseInt(tdarrData.table1Count, 10) + parseInt(tdarrData.table4Count, 10);
const processed = parseInt(tdarrData.table2Count, 10) + parseInt(tdarrData.table5Count, 10);
const errored = parseInt(tdarrData.table3Count, 10) + parseInt(tdarrData.table6Count, 10);
const saved = parseFloat(tdarrData.sizeDiff, 10) * 1000000000;
return (
<Container service={service}>

@ -22,32 +22,22 @@ export default async function tdarrProxyHandler(req, res) {
return res.status(400).json({ error: "Invalid proxy service type" });
}
const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget }));
const method = "POST";
const headers = {
"content-type": "application/json",
};
const body = JSON.stringify({
"data": {
"collection": "StatisticsJSONDB",
"mode": "getById",
"docID": "statistics"
}
const [status, contentType, data] = await httpProxy(url, {
method: "POST",
body: JSON.stringify({
"data": {
"collection": "StatisticsJSONDB",
"mode": "getById",
"docID": "statistics"
},
}),
headers: {
"content-type": "application/json",
},
});
let [status, contentType, data, responseHeaders] = await httpProxy(url, {
method,
body,
headers,
});
if (status !== 200) {
logger.error("Error getting data from Tdarr: %d. Data: %s", status, data);
return res.status(500).send({error: {message:"Error getting data from Tdarr", url, data}});

Loading…
Cancel
Save