diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json
index 7a4633a2..4547995f 100644
--- a/public/locales/ar/common.json
+++ b/public/locales/ar/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json
index ce929cab..1f8ee314 100644
--- a/public/locales/bg/common.json
+++ b/public/locales/bg/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/ca/common.json b/public/locales/ca/common.json
index b85e5377..a0315c2d 100644
--- a/public/locales/ca/common.json
+++ b/public/locales/ca/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json
index bf6bbed8..00d37dd5 100644
--- a/public/locales/cs/common.json
+++ b/public/locales/cs/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/da/common.json b/public/locales/da/common.json
index af3cf514..e521791b 100644
--- a/public/locales/da/common.json
+++ b/public/locales/da/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/de/common.json b/public/locales/de/common.json
index f700d34c..3ad21697 100644
--- a/public/locales/de/common.json
+++ b/public/locales/de/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index dc928ef9..0efa1150 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -466,5 +466,16 @@
"days": "Days",
"uptime": "Uptime",
"volumeAvailable": "Available"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
\ No newline at end of file
diff --git a/public/locales/eo/common.json b/public/locales/eo/common.json
index 215b5a7d..5b7b4c41 100644
--- a/public/locales/eo/common.json
+++ b/public/locales/eo/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/es/common.json b/public/locales/es/common.json
index f1864972..a020c4b1 100644
--- a/public/locales/es/common.json
+++ b/public/locales/es/common.json
@@ -451,5 +451,16 @@
"libraries": "Librerías",
"series": "Series",
"books": "Libros"
+ },
+ "mylar": {
+ "issues": "Issues",
+ "series": "Series",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/fi/common.json b/public/locales/fi/common.json
index d0ea0f45..1e168b4a 100644
--- a/public/locales/fi/common.json
+++ b/public/locales/fi/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json
index b27e5e66..172e4019 100644
--- a/public/locales/fr/common.json
+++ b/public/locales/fr/common.json
@@ -451,5 +451,16 @@
"libraries": "Librairies",
"series": "Séries",
"books": "Livres"
+ },
+ "mylar": {
+ "series": "Séries",
+ "issues": "Issues",
+ "wanted": "Demande"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/he/common.json b/public/locales/he/common.json
index 3539c91d..56bc65e8 100644
--- a/public/locales/he/common.json
+++ b/public/locales/he/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json
index c7eb9ea9..a1731ffb 100644
--- a/public/locales/hi/common.json
+++ b/public/locales/hi/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json
index 6fbe0278..b8274e88 100644
--- a/public/locales/hr/common.json
+++ b/public/locales/hr/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "videos": "Videos",
+ "albums": "Albums",
+ "photos": "Photos",
+ "people": "People"
}
}
diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json
index d1b8baf6..0fb1f273 100644
--- a/public/locales/hu/common.json
+++ b/public/locales/hu/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/it/common.json b/public/locales/it/common.json
index 6e54b5ab..423d3807 100644
--- a/public/locales/it/common.json
+++ b/public/locales/it/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json
index fc1a1a26..fdf13ebc 100644
--- a/public/locales/ja/common.json
+++ b/public/locales/ja/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json
index 967dbc14..079f1e93 100644
--- a/public/locales/lv/common.json
+++ b/public/locales/lv/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/ms/common.json b/public/locales/ms/common.json
index 4522de97..ed5113dc 100644
--- a/public/locales/ms/common.json
+++ b/public/locales/ms/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json
index 20090c4a..fceaa779 100644
--- a/public/locales/nb-NO/common.json
+++ b/public/locales/nb-NO/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json
index 5132e27e..0e2d31fb 100644
--- a/public/locales/nl/common.json
+++ b/public/locales/nl/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "wanted": "Wanted",
+ "series": "Series",
+ "issues": "Issues"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json
index 5d287c8d..13237fb7 100644
--- a/public/locales/pl/common.json
+++ b/public/locales/pl/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/pt-BR/common.json b/public/locales/pt-BR/common.json
index e1a4f53b..fc27cf7c 100644
--- a/public/locales/pt-BR/common.json
+++ b/public/locales/pt-BR/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "videos": "Videos",
+ "albums": "Albums",
+ "photos": "Photos",
+ "people": "People"
}
}
diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json
index a6337ee0..bbd7a52d 100644
--- a/public/locales/pt/common.json
+++ b/public/locales/pt/common.json
@@ -460,5 +460,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/ro/common.json b/public/locales/ro/common.json
index 225ae3ba..d5a99b64 100644
--- a/public/locales/ro/common.json
+++ b/public/locales/ro/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json
index ad81e13c..467e3697 100644
--- a/public/locales/ru/common.json
+++ b/public/locales/ru/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/sr/common.json b/public/locales/sr/common.json
index e624b14b..80dec787 100644
--- a/public/locales/sr/common.json
+++ b/public/locales/sr/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json
index 7e8ac3e6..7dcfff55 100644
--- a/public/locales/sv/common.json
+++ b/public/locales/sv/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/te/common.json b/public/locales/te/common.json
index ef020175..6049527d 100644
--- a/public/locales/te/common.json
+++ b/public/locales/te/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json
index c393e601..680ced37 100644
--- a/public/locales/tr/common.json
+++ b/public/locales/tr/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json
index f4761972..be2aada0 100644
--- a/public/locales/uk/common.json
+++ b/public/locales/uk/common.json
@@ -451,5 +451,16 @@
"libraries": "Бібліотеки",
"series": "Серії",
"books": "Книжки"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json
index b3f33f10..9044deab 100644
--- a/public/locales/vi/common.json
+++ b/public/locales/vi/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People",
+ "albums": "Albums"
}
}
diff --git a/public/locales/yue/common.json b/public/locales/yue/common.json
index 270b9706..9f035377 100644
--- a/public/locales/yue/common.json
+++ b/public/locales/yue/common.json
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json
index fb6d8766..a221c984 100644
--- a/public/locales/zh-CN/common.json
+++ b/public/locales/zh-CN/common.json
@@ -204,7 +204,7 @@
"devices": "设备",
"lan_devices": "局域网设备",
"wlan_devices": "无线局域网设备",
- "empty_data": "Subsystem status unknown"
+ "empty_data": "子系统状态未知"
},
"plex": {
"streams": "活动流",
@@ -451,5 +451,16 @@
"libraries": "Libraries",
"series": "Series",
"books": "Books"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json
index 708626d3..b88f754d 100644
--- a/public/locales/zh-Hant/common.json
+++ b/public/locales/zh-Hant/common.json
@@ -451,5 +451,16 @@
"libraries": "文庫",
"series": "叢刊",
"books": "書刊"
+ },
+ "mylar": {
+ "series": "Series",
+ "issues": "Issues",
+ "wanted": "Wanted"
+ },
+ "photoprism": {
+ "albums": "Albums",
+ "photos": "Photos",
+ "videos": "Videos",
+ "people": "People"
}
}
diff --git a/src/widgets/components.js b/src/widgets/components.js
index c9509607..f7258a52 100644
--- a/src/widgets/components.js
+++ b/src/widgets/components.js
@@ -29,6 +29,7 @@ const components = {
miniflux: dynamic(() => import("./miniflux/component")),
mikrotik: dynamic(() => import("./mikrotik/component")),
moonraker: dynamic(() => import("./moonraker/component")),
+ mylar: dynamic(() => import("./mylar/component")),
navidrome: dynamic(() => import("./navidrome/component")),
nextdns: dynamic(() => import("./nextdns/component")),
npm: dynamic(() => import("./npm/component")),
@@ -39,6 +40,7 @@ const components = {
opnsense: dynamic(() => import("./opnsense/component")),
overseerr: dynamic(() => import("./overseerr/component")),
paperlessngx: dynamic(() => import("./paperlessngx/component")),
+ photoprism: dynamic(() => import("./photoprism/component")),
proxmoxbackupserver: dynamic(() => import("./proxmoxbackupserver/component")),
pihole: dynamic(() => import("./pihole/component")),
plex: dynamic(() => import("./plex/component")),
diff --git a/src/widgets/mylar/component.jsx b/src/widgets/mylar/component.jsx
new file mode 100644
index 00000000..e284c93f
--- /dev/null
+++ b/src/widgets/mylar/component.jsx
@@ -0,0 +1,40 @@
+import { useTranslation } from "next-i18next";
+
+import Container from "components/services/widget/container";
+import Block from "components/services/widget/block";
+import useWidgetAPI from "utils/proxy/use-widget-api";
+
+export default function Component({ service }) {
+ const { t } = useTranslation();
+
+ const { widget } = service;
+
+ const { data: seriesData, error: seriesError } = useWidgetAPI(widget, "series");
+ const { data: issuesData, error: issuesError } = useWidgetAPI(widget, "issues");
+ const { data: wantedData, error: wantedError } = useWidgetAPI(widget, "wanted");
+
+ if (seriesError || issuesError || wantedError) {
+ const finalError = seriesError ?? issuesError ?? wantedError;
+ return ;
+ }
+
+ if (!seriesData || !issuesData || !wantedData) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ const totalIssues = issuesData.data.reduce((acc, series) => acc + series.totalIssues, 0);
+
+ return (
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/widgets/mylar/widget.js b/src/widgets/mylar/widget.js
new file mode 100644
index 00000000..031d43d6
--- /dev/null
+++ b/src/widgets/mylar/widget.js
@@ -0,0 +1,20 @@
+import genericProxyHandler from "utils/proxy/handlers/generic";
+
+const widget = {
+ api: "{url}/api?cmd={endpoint}&apikey={key}",
+ proxyHandler: genericProxyHandler,
+
+ mappings: {
+ issues: {
+ endpoint: "getIndex"
+ },
+ series: {
+ endpoint: "seriesjsonListing"
+ },
+ wanted: {
+ endpoint: "getWanted"
+ },
+ },
+};
+
+export default widget;
\ No newline at end of file
diff --git a/src/widgets/photoprism/component.jsx b/src/widgets/photoprism/component.jsx
new file mode 100644
index 00000000..ee489d35
--- /dev/null
+++ b/src/widgets/photoprism/component.jsx
@@ -0,0 +1,37 @@
+import { useTranslation } from "next-i18next";
+
+import Container from "components/services/widget/container";
+import Block from "components/services/widget/block";
+import useWidgetAPI from "utils/proxy/use-widget-api";
+
+export default function Component({ service }) {
+ const { t } = useTranslation();
+
+ const { widget } = service;
+
+ const { data: photoprismData, error: photoprismError } = useWidgetAPI(widget);
+
+ if (photoprismError) {
+ return ;
+ }
+
+ if (!photoprismData) {
+ return (
+
+
+
+
+
+
+ );
+ }
+
+ return (
+
+
+
+
+
+
+ );
+}
diff --git a/src/widgets/photoprism/proxy.js b/src/widgets/photoprism/proxy.js
new file mode 100644
index 00000000..b7ee0bf9
--- /dev/null
+++ b/src/widgets/photoprism/proxy.js
@@ -0,0 +1,48 @@
+import { formatApiCall } from "utils/proxy/api-helpers";
+import { httpProxy } from "utils/proxy/http";
+import getServiceWidget from "utils/config/service-helpers";
+import createLogger from "utils/logger";
+
+const logger = createLogger("photoprismProxyHandler");
+
+export default async function photoprismProxyHandler(req, res) {
+ const { group, service } = req.query;
+
+ if (!group || !service) {
+ logger.debug("Invalid or missing service '%s' or group '%s'", service, group);
+ return res.status(400).json({ error: "Invalid proxy service type" });
+ }
+
+ const widget = await getServiceWidget(group, service);
+
+ if (!widget) {
+ logger.debug("Invalid or missing widget for service '%s' in group '%s'", service, group);
+ return res.status(400).json({ error: "Invalid proxy service type" });
+ }
+
+ const url = new URL(formatApiCall("{url}/api/v1/session", { ...widget }));
+ const params = {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: null
+ };
+
+ if (widget.username && widget.password) {
+ params.body = JSON.stringify({
+ "username": widget.username,
+ "password": widget.password
+ });
+ }
+
+ const [status, contentType, data] = await httpProxy(url, params);
+
+ if (status !== 200) {
+ logger.error("HTTP %d getting data from PhotoPrism. Data: %s", status, data);
+ return res.status(status).json({error: {message: `HTTP Error ${status}`, url, data}});
+ }
+
+ const json = JSON.parse(data.toString())
+
+ if (contentType) res.setHeader("Content-Type", contentType);
+ return res.status(200).send(json?.config?.count);
+}
diff --git a/src/widgets/photoprism/widget.js b/src/widgets/photoprism/widget.js
new file mode 100644
index 00000000..eaddbcc9
--- /dev/null
+++ b/src/widgets/photoprism/widget.js
@@ -0,0 +1,7 @@
+import photoprismProxyHandler from "./proxy";
+
+const widget = {
+ proxyHandler: photoprismProxyHandler,
+};
+
+export default widget;
diff --git a/src/widgets/widgets.js b/src/widgets/widgets.js
index dfe606a5..feae40cd 100644
--- a/src/widgets/widgets.js
+++ b/src/widgets/widgets.js
@@ -23,6 +23,7 @@ import medusa from "./medusa/widget";
import miniflux from "./miniflux/widget";
import mikrotik from "./mikrotik/widget";
import moonraker from "./moonraker/widget";
+import mylar from "./mylar/widget";
import navidrome from "./navidrome/widget";
import nextdns from "./nextdns/widget";
import npm from "./npm/widget";
@@ -33,6 +34,7 @@ import ombi from "./ombi/widget";
import opnsense from "./opnsense/widget";
import overseerr from "./overseerr/widget";
import paperlessngx from "./paperlessngx/widget";
+import photoprism from "./photoprism/widget";
import proxmoxbackupserver from "./proxmoxbackupserver/widget";
import pihole from "./pihole/widget";
import plex from "./plex/widget";
@@ -88,6 +90,7 @@ const widgets = {
miniflux,
mikrotik,
moonraker,
+ mylar,
navidrome,
nextdns,
npm,
@@ -98,6 +101,7 @@ const widgets = {
opnsense,
overseerr,
paperlessngx,
+ photoprism,
proxmoxbackupserver,
pihole,
plex,