diff --git a/docs/widgets/services/suwayomi.md b/docs/widgets/services/suwayomi.md index c4a7b416..21672598 100644 --- a/docs/widgets/services/suwayomi.md +++ b/docs/widgets/services/suwayomi.md @@ -5,7 +5,7 @@ description: Suwayomi Widget Configuration Learn more about [Suwayomi](https://github.com/Suwayomi/Suwayomi-Server). -Allowed fields:["download", "nondownload", "read", "unread", "downloadedread", "downloadedunread", "nondownloadedread", "nondownloadedunread"] +Allowed fields: ["download", "nondownload", "read", "unread", "downloadedread", "downloadedunread", "nondownloadedread", "nondownloadedunread"] The widget defaults to the first four above. If more than four fields are provided, only the first 4 are displayed. Category IDs can be obtained from the url when navigating to it, `?tab={categoryID}`. diff --git a/src/widgets/suwayomi/component.jsx b/src/widgets/suwayomi/component.jsx index fa753917..b7c34820 100644 --- a/src/widgets/suwayomi/component.jsx +++ b/src/widgets/suwayomi/component.jsx @@ -20,7 +20,6 @@ export default function Component({ service }) { widget.fields = ["download", "nondownload", "read", "unread"]; } else if (widget.fields.length > 4) { widget.fields = widget.fields.slice(0, 4); - widget.fields = widget.fields.map((field) => field.toLowerCase()); } return ( diff --git a/src/widgets/suwayomi/proxy.js b/src/widgets/suwayomi/proxy.js index eb19f388..d4d71675 100644 --- a/src/widgets/suwayomi/proxy.js +++ b/src/widgets/suwayomi/proxy.js @@ -132,7 +132,6 @@ export default async function suwayomiProxyHandler(req, res) { widget.fields = ["download", "nondownload", "read", "unread"]; } else if (widget.fields.length > 4) { widget.fields = widget.fields.slice(0, 4); - widget.fields = widget.fields.map((field) => field.toLowerCase()); } const url = new URL(formatApiCall(widgets[widget.type].api, { endpoint, ...widget })); @@ -169,9 +168,7 @@ export default async function suwayomiProxyHandler(req, res) { return res.status(status).send({ error: { message: "Error getting data. body: %s, data: %s", body, data } }); } - const responseJSON = JSON.parse(data); - - const returnData = extractCounts(responseJSON, widget.fields); + const returnData = extractCounts(JSON.parse(data), widget.fields); if (contentType) res.setHeader("Content-Type", contentType); return res.status(status).send(returnData);