diff --git a/README.md b/README.md index f85e1164..8aff3198 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Present [Plex](https://plex.tv) user statistics and habits in a beautiful and or - 📆 Rewind - allows your Plex users view their statistics and habits for a given year. - 👀 Dashboard - provides an easily glanceable overview of activity on your server for all your libraries. - ✨ Beautiful animations with [Framer Motion](https://www.framer.com/motion). -- 🔗 Integrates with [Overseerr](https://overseerr.dev) & [Tautulli](https://tautulli.com). +- 📊 Fuelled by data from [Tautulli](https://tautulli.com) - the backbone responsible for the heavy lifting regarding stats. +- 🔗 Integrates with [Overseerr](https://overseerr.dev) - show request breakdowns and totals. - 🔐 Log in with Plex - uses [NextAuth.js](https://next-auth.js.org) to enable secure login and session management with your Plex account. - 🚀 PWA support - installable on mobile devices and desktops thanks to [Serwist](https://github.com/serwist/serwist). - 🐳 Easy deployment - run the application in a containerized environment with [Docker](https://www.docker.com). @@ -53,6 +54,12 @@ services: > _NOTE: If you run into authentication issues, try setting `NEXTAUTH_URL` and `NEXT_PUBLIC_SITE_URL` to your external Docker IP, instead of localhost. For example `http://192.168.1.1:8383`._ +### Unraid + +Plex Rewind is available in the Community Apps store for Unraid. Search for "Plex Rewind" and install it from grtgbln's repository. + +As noted in the installation instructions, you will need to download a copy of "settings.json" into the associated settings path **before** running the application. To download the file, you can open a terminal, enter the directory and run `curl -o settings.json https://raw.githubusercontent.com/RaunoT/plex-rewind/main/config/settings.example.json`. + ## Updating To update, run `docker compose pull` and then `docker compose up -d`. diff --git a/config/settings.example.json b/config/settings.example.json new file mode 100644 index 00000000..66230a7c --- /dev/null +++ b/config/settings.example.json @@ -0,0 +1,28 @@ +{ + "connection": { + "tautulliUrl": "", + "tautulliApiKey": "", + "overseerrUrl": "", + "overseerrApiKey": "", + "tmdbApiKey": "" + }, + "features": { + "isRewindActive": true, + "isDashboardActive": true, + "isUsersPageActive": true, + "activeLibraries": [], + "activeDashboardItemStatistics": [ + "year", + "rating", + "duration", + "plays", + "users", + "requests" + ], + "activeDashboardTotalStatistics": ["size", "duration", "count", "requests"], + "dashboardDefaultPeriod": "custom", + "dashboardCustomPeriod": "30", + "googleAnalyticsId": "" + }, + "test": false +} diff --git a/next.config.mjs b/next.config.mjs index 5361a0ca..6938b964 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -14,13 +14,17 @@ const nextConfig = { protocol: 'https', hostname: 'plex.tv', }, + { + protocol: 'https', + hostname: 'image.tmdb.org', + }, ], }, - logging: { - fetches: { - fullUrl: true, - }, - }, + // logging: { + // fetches: { + // fullUrl: true, + // }, + // }, async headers() { return [ { diff --git a/src/actions/update-feature-settings.ts b/src/actions/update-feature-settings.ts index 94ad13c4..c0b20ea5 100644 --- a/src/actions/update-feature-settings.ts +++ b/src/actions/update-feature-settings.ts @@ -1,6 +1,10 @@ 'use server' -import { SettingsFormInitialState } from '@/types' +import { + DashboardItemStatistics, + DashboardTotalStatistics, + SettingsFormInitialState, +} from '@/types' import { SETTINGS_PATH } from '@/utils/constants' import getSettings from '@/utils/getSettings' import { promises as fs } from 'fs' @@ -12,8 +16,10 @@ const schema = z.object({ isDashboardActive: z.boolean(), isUsersPageActive: z.boolean(), activeLibraries: z.array(z.string()), - activeDashboardStatistics: z.array(z.string()), - dashboardDefaultPeriod: z.string().refine( + activeDashboardItemStatistics: z.array(z.string()), + activeDashboardTotalStatistics: z.array(z.string()), + dashboardDefaultPeriod: z.string(), + dashboardCustomPeriod: z.string().refine( (value) => { const number = parseFloat(value) @@ -35,10 +41,14 @@ export async function saveFeaturesSettings( isDashboardActive: formData.get('isDashboardActive') === 'on', isUsersPageActive: formData.get('isUsersPageActive') === 'on', activeLibraries: formData.getAll('activeLibraries') as string[], - activeDashboardStatistics: formData.getAll( - 'activeDashboardStatistics', - ) as string[], + activeDashboardItemStatistics: formData.getAll( + 'activeDashboardItemStatistics', + ) as DashboardItemStatistics, + activeDashboardTotalStatistics: formData.getAll( + 'activeDashboardTotalStatistics', + ) as DashboardTotalStatistics, dashboardDefaultPeriod: formData.get('dashboardDefaultPeriod') as string, + dashboardCustomPeriod: formData.get('dashboardCustomPeriod') as string, googleAnalyticsId: formData.get('googleAnalyticsId') as string, } diff --git a/src/app/_components/Home.tsx b/src/app/_components/Home.tsx index 310b01c7..15df5fed 100644 --- a/src/app/_components/Home.tsx +++ b/src/app/_components/Home.tsx @@ -106,7 +106,7 @@ export default function Home({ settings }: Props) { return (