Run pre-commit hooks over existing codebase

Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
shamoon 2023-10-17 23:26:55 -07:00
parent fa50bbad9c
commit 19c25713c4
387 changed files with 4785 additions and 4109 deletions

View file

@ -12,7 +12,7 @@ export default function Component({ service }) {
const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents");
if (torrentError || !torrentData?.torrents) {
return <Container service={service} error={torrentError ?? {message: "No torrent data returned"}} />;
return <Container service={service} error={torrentError ?? { message: "No torrent data returned" }} />;
}
if (!torrentData || !torrentData.torrents) {
@ -31,16 +31,16 @@ export default function Component({ service }) {
let completed = 0;
let leech = 0;
Object.values(torrentData.torrents).forEach(torrent => {
Object.values(torrentData.torrents).forEach((torrent) => {
rateDl += torrent.downRate;
rateUl += torrent.upRate;
if(torrent.status.includes('complete')){
if (torrent.status.includes("complete")) {
completed += 1;
}
if(torrent.status.includes('downloading')){
if (torrent.status.includes("downloading")) {
leech += 1;
}
})
});
return (
<Container service={service}>

View file

@ -9,16 +9,16 @@ async function login(widget) {
logger.debug("flood is rejecting the request, logging in.");
const loginUrl = new URL(`${widget.url}/api/auth/authenticate`).toString();
const loginParams = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: null
const loginParams = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: null,
};
if (widget.username && widget.password) {
loginParams.body = JSON.stringify({
"username": widget.username,
"password": widget.password
username: widget.username,
password: widget.password,
});
}