mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-16 17:59:49 +00:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
parent
fa50bbad9c
commit
19c25713c4
387 changed files with 4785 additions and 4109 deletions
|
@ -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}>
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue