Add Showy Homepage dashboard widget
Homepage widget with totals, library, and watchlist mappings. Displays total entries, collections, favorites, library breakdown (movies/series), and watchlist breakdown (movies/series).
This commit is contained in:
1 parent
63aca7e7b8
commit
e660b1ec87
3 files changed
+149
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { asJson } from "utils/proxy/api-helpers";
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/api/v1/{endpoint}?token={dashboardToken}",
|
||||
proxyHandler: genericProxyHandler,
|
||||
|
||||
mappings: {
|
||||
totals: {
|
||||
endpoint: "homepage-integration",
|
||||
map: (data) => ({
|
||||
totalEntries: asJson(data).totalEntries,
|
||||
collections: asJson(data).collections,
|
||||
favorits: asJson(data).favorits,
|
||||
}),
|
||||
},
|
||||
library: {
|
||||
endpoint: "homepage-integration",
|
||||
map: (data) => ({
|
||||
library: asJson(data).library,
|
||||
libraryMovies: asJson(data).libraryMovies,
|
||||
librarySeries: asJson(data).librarySeries,
|
||||
}),
|
||||
},
|
||||
watchlist: {
|
||||
endpoint: "homepage-integration",
|
||||
map: (data) => ({
|
||||
watchlist: asJson(data).watchlist,
|
||||
watchlistMovies: asJson(data).watchlistMovies,
|
||||
watchlistSeries: asJson(data).watchlistSeries,
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default widget;
|
||||
Reference in new issue
Block a user