Merge pull request #160 from JazzFisch/add-bazarr

Add Bazarr widget
pull/163/head^2
Ben Phelps 2 years ago committed by GitHub
commit ace1610dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,6 +85,10 @@
"queued": "Queued",
"books": "Books"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
},
"ombi": {
"pending": "Pending",
"approved": "Approved",

@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
import Sonarr from "./widgets/service/sonarr";
import Radarr from "./widgets/service/radarr";
import Readarr from "./widgets/service/readarr";
import Bazarr from "./widgets/service/bazarr";
import Ombi from "./widgets/service/ombi";
import Portainer from "./widgets/service/portainer";
import Emby from "./widgets/service/emby";
@ -29,6 +30,7 @@ const widgetMappings = {
sonarr: Sonarr,
radarr: Radarr,
readarr: Readarr,
bazarr: Bazarr,
ombi: Ombi,
portainer: Portainer,
emby: Emby,

@ -0,0 +1,36 @@
import useSWR from "swr";
import { useTranslation } from "react-i18next";
import Widget from "../widget";
import Block from "../block";
import { formatApiUrl } from "utils/api-helpers";
export default function Bazarr({ service }) {
const { t } = useTranslation();
const config = service.widget;
const { data: episodesData, error: episodesError } = useSWR(formatApiUrl(config, "episodes"));
const { data: moviesData, error: moviesError } = useSWR(formatApiUrl(config, "movies"));
if (episodesError || moviesError) {
return <Widget error={t("widget.api_error")} />;
}
if (!episodesData || !moviesData) {
return (
<Widget>
<Block label={t("bazarr.missingEpisodes")} />
<Block label={t("bazarr.missingMovies")} />
</Widget>
);
}
return (
<Widget>
<Block label={t("bazarr.missingEpisodes")} value={episodesData.total} />
<Block label={t("bazarr.missingMovies")} value={moviesData.total} />
</Widget>
);
}

@ -13,6 +13,7 @@ const serviceProxyHandlers = {
radarr: genericProxyHandler,
sonarr: genericProxyHandler,
readarr: genericProxyHandler,
bazarr: genericProxyHandler,
speedtest: genericProxyHandler,
tautulli: genericProxyHandler,
traefik: genericProxyHandler,

@ -15,6 +15,7 @@ const formats = {
ombi: `{url}/api/v1/{endpoint}`,
npm: `{url}/api/{endpoint}`,
readarr: `{url}/api/v1/{endpoint}?apikey={key}`,
bazarr: `{url}/api/{endpoint}/wanted?apikey={key}`,
sabnzbd: `{url}/api/?apikey={key}&output=json&mode={endpoint}`,
coinmarketcap: `https://pro-api.coinmarketcap.com/{endpoint}`,
gotify: `{url}/{endpoint}`,

Loading…
Cancel
Save