Skip to content

Commit

Permalink
Apply prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
soruly committed Jul 8, 2023
1 parent 3a6aac5 commit 3e2ab53
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions components/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default function Layout({ anilist: src }) {
...(src.synonyms_chinese || []),
]
.filter((e) => e)
.filter((e) => e !== src.title.native || e !== src.title.romaji)
)
.filter((e) => e !== src.title.native || e !== src.title.romaji),
),
)
.sort()
.map((title, i) => {
Expand Down
4 changes: 2 additions & 2 deletions image-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const handleRequest = async (originalRequest) => {
referer: imageURL.origin,
"User-Agent": "googlebot",
},
})
}),
);
if (response.status === 200) {
const ogImageURL = (await webResponse.text())
Expand All @@ -69,7 +69,7 @@ const handleRequest = async (originalRequest) => {
headers: {
referer: imageURL.origin,
},
})
}),
);
if (response.status >= 400) {
return new Response(response.body, {
Expand Down
10 changes: 5 additions & 5 deletions pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ChartJS.register(
LineElement,
Title,
Tooltip,
Legend
Legend,
);

const getDatabaseStatus = async () => {
Expand All @@ -62,7 +62,7 @@ const getDatabaseStatus = async () => {

const getMediaStatus = async () => {
const { mediaCount, mediaFramesTotal, mediaDurationTotal } = await fetch(
`${NEXT_PUBLIC_API_ENDPOINT}/stats?type=media`
`${NEXT_PUBLIC_API_ENDPOINT}/stats?type=media`,
).then((e) => e.json());
return {
mediaCount,
Expand Down Expand Up @@ -441,7 +441,7 @@ const About = () => {
Total Duration:{" "}
{mediaDurationTotal
? `${Number((mediaDurationTotal / 3600).toFixed(2)).toLocaleString(
navigator.language
navigator.language,
)} hours`
: "counting..."}
</li>
Expand Down Expand Up @@ -474,7 +474,7 @@ const About = () => {
if (!e.target.value.match(/\d+/)) return;
setMessage("Searching...");
const status = await fetch(
`${NEXT_PUBLIC_API_ENDPOINT}/status?id=${e.target.value}`
`${NEXT_PUBLIC_API_ENDPOINT}/status?id=${e.target.value}`,
).then((e) => e.json());
setMessage(`Found ${status.length} records`);
if (status.length) {
Expand All @@ -483,7 +483,7 @@ const About = () => {
.join("\n");
} else {
document.querySelector(
"pre"
"pre",
).innerText = `Cannot find any record for ID ${e.target.value}`;
}
}}
Expand Down
8 changes: 4 additions & 4 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Index = () => {
setSearchImageSrc(
searchParams.get("url").startsWith(location.origin)
? searchParams.get("url")
: `/image-proxy?url=${encodeURIComponent(searchParams.get("url"))}`
: `/image-proxy?url=${encodeURIComponent(searchParams.get("url"))}`,
);
}
document.addEventListener(
Expand All @@ -62,7 +62,7 @@ const Index = () => {
setSearchImageSrc(URL.createObjectURL(item.getAsFile()));
e.preventDefault();
},
false
false,
);

window.onerror = function (message, source, lineno, colno, error) {
Expand Down Expand Up @@ -124,7 +124,7 @@ const Index = () => {
search(blob);
},
"image/jpeg",
0.8
0.8,
);
};
image.onerror = () => {
Expand Down Expand Up @@ -177,7 +177,7 @@ const Index = () => {
`Searched ${frameCount.toLocaleString(navigator.language)} frames in ${(
(performance.now() - startSearchTime) /
1000
).toFixed(2)}s`
).toFixed(2)}s`,
);

if (result.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ self.addEventListener("fetch", (event) => {
} catch (e) {
return fetch(req);
}
})()
})(),
);
}
if (
Expand Down

0 comments on commit 3e2ab53

Please sign in to comment.