mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-12 20:12:09 +08:00
Komga Widget (#922)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
30
src/widgets/komga/widget.js
Normal file
30
src/widgets/komga/widget.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
import { jsonArrayFilter } from "utils/proxy/api-helpers";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/api/v1/{endpoint}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
|
||||
mappings: {
|
||||
libraries: {
|
||||
endpoint: "libraries",
|
||||
map: (data) => ({
|
||||
total: jsonArrayFilter(data, (item) => !item.unavailable).length,
|
||||
}),
|
||||
},
|
||||
series: {
|
||||
endpoint: "series",
|
||||
validate: [
|
||||
"totalElements"
|
||||
]
|
||||
},
|
||||
books: {
|
||||
endpoint: "books",
|
||||
validate: [
|
||||
"totalElements"
|
||||
]
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default widget;
|
||||
Reference in New Issue
Block a user