🟣 V0.9.1: Overserr integration and new design !

This commit is contained in:
Thomas Camlong
2022-08-11 17:20:04 +02:00
committed by ajnart
87 changed files with 8898 additions and 2115 deletions

View File

@@ -15,9 +15,9 @@ on:
- '**.md' - '**.md'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tags: tag:
required: true required: true
description: 'Tags to deploy to' description: 'Tag to deploy to'
env: env:
# Use docker.io for Docker Hub if empty # Use docker.io for Docker Hub if empty
@@ -70,6 +70,7 @@ jobs:
- run: yarn build - run: yarn build
- name: Docker meta - name: Docker meta
if: github.event_name != 'pull_request'
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
@@ -78,7 +79,8 @@ jobs:
# generate Docker tags based on the following events/attributes # generate Docker tags based on the following events/attributes
tags: | tags: |
type=ref,event=pr type=ref,event=pr
tpye=raw,value=dev,priority=1 type=raw,value=${{ github.event.inputs.tag }}, prefix=test-,enable=${{ github.event.inputs.tag != '' }}
tpye=raw,value=dev,priority=1,enable=${{ github.event.inputs.tag == '' }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
@@ -95,6 +97,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7

View File

@@ -1,25 +1,18 @@
FROM node:16-alpine FROM node:16-alpine
WORKDIR /app WORKDIR /app
RUN apk add tzdata
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY next.config.js ./ COPY next.config.js ./
COPY public ./public COPY public ./public
COPY package.json ./package.json COPY package.json ./package.json
# Automatically leverage output traces to reduce image size # Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing # https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --chown=nextjs:nodejs .next/standalone ./ COPY .next/standalone ./
COPY --chown=nextjs:nodejs .next/static ./.next/static COPY .next/static ./.next/static
USER nextjs
EXPOSE 7575 EXPOSE 7575

View File

@@ -21,7 +21,7 @@
<i>Join the discord! — Don't forget to star the repo if you are enjoying the project!</i> <i>Join the discord! — Don't forget to star the repo if you are enjoying the project!</i>
</p> </p>
<p align="center"> <p align="center">
<a href="https://homarr.ajnart.fr/"><strong> Demo ↗️ </strong></a> • <a href="#-installation"><strong> Install ➡️ </strong></a> • <a href="https://github.com/ajnart/homarr/wiki"><strong> Read the Wiki 📄 </strong></a> <a href="https://homarr.ajnart.fr/"><strong> Demo ↗️ </strong></a> • <a href="https://homarr.vercel.app/docs/quick-start/"><strong> Install ➡️ </strong></a> • <a href="https://homarr.vercel.app/docs/about"><strong> Read the Docs 📄 </strong></a>
</p> </p>
--- ---
@@ -33,7 +33,7 @@ Homarr is a simple and lightweight homepage for your server, that helps you easi
It integrates with the services you use to display information on the homepage (E.g. Show upcoming Sonarr/Radarr releases). It integrates with the services you use to display information on the homepage (E.g. Show upcoming Sonarr/Radarr releases).
For a full list of integrations look at: [wiki/integrations](https://github.com/ajnart/homarr/wiki/Integrations) For a full list of integrations, [head over to our documentation](https://homarr.vercel.app/docs/advanced-features/integrations).
If you have any questions about Homarr or want to share information with us, please go to one of the following places: If you have any questions about Homarr or want to share information with us, please go to one of the following places:
@@ -42,7 +42,7 @@ If you have any questions about Homarr or want to share information with us, ple
*Before you file an [issue](https://github.com/ajnart/homarr/issues/new/choose), make sure you have the read [known issues](#-known-issues) section.* *Before you file an [issue](https://github.com/ajnart/homarr/issues/new/choose), make sure you have the read [known issues](#-known-issues) section.*
**For more information, [read the wiki!](https://github.com/ajnart/homarr/wiki)** **For more information, [read the documentation!](https://homarr.vercel.app/docs/about)**
<details> <details>
<summary><b>Table of Contents</b></summary> <summary><b>Table of Contents</b></summary>
@@ -64,9 +64,9 @@ If you have any questions about Homarr or want to share information with us, ple
## ✨ Features ## ✨ Features
- Integrates with services you use. - Integrates with services you use.
- Search the web direcetly from your homepage. - Search the web directly from your homepage.
- Real-time status indicator for every service. - Real-time status indicator for every service.
- Automatically finds icons while you type the name of a serivce. - Automatically finds icons while you type the name of a service.
- Widgets that can display all types of information. - Widgets that can display all types of information.
- Easy deployment with Docker. - Easy deployment with Docker.
- Very light-weight and fast. - Very light-weight and fast.
@@ -195,7 +195,7 @@ SOFTWARE.
--- ---
<p align="center"> <p align="center">
<i>Thank you for visiting! <b>For more information <a href="https://github.com/ajnart/homarr/wiki">read the wiki!</a></b></i> <i>Thank you for visiting! <b>For more information <a href="https://homarr.vercel.app/docs/about">read the documentation!</a></b></i>
<br/> <br/>
<br/> <br/>
</p> </p>

View File

@@ -15,12 +15,6 @@
"modules": { "modules": {
"Search Bar": { "Search Bar": {
"enabled": true "enabled": true
},
"Date": {
"enabled": false
},
"Docker": {
"enabled": true
} }
} }
} }

View File

@@ -1,2 +1,2 @@
export const REPO_URL = 'ajnart/homarr'; export const REPO_URL = 'ajnart/homarr';
export const CURRENT_VERSION = 'v0.8.2'; export const CURRENT_VERSION = 'v0.9.1';

View File

@@ -5,6 +5,12 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
}); });
module.exports = withBundleAnalyzer({ module.exports = withBundleAnalyzer({
images: {
domains: ['cdn.jsdelivr.net'],
},
reactStrictMode: false, reactStrictMode: false,
experimental: {
outputStandalone: true,
},
output: 'standalone', output: 'standalone',
}); });

View File

@@ -1,6 +1,6 @@
{ {
"name": "homarr", "name": "homarr",
"version": "0.8.2", "version": "0.9.1",
"description": "Homarr - A homepage for your server.", "description": "Homarr - A homepage for your server.",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
@@ -30,37 +30,45 @@
"@dnd-kit/core": "^6.0.5", "@dnd-kit/core": "^6.0.5",
"@dnd-kit/sortable": "^7.0.1", "@dnd-kit/sortable": "^7.0.1",
"@dnd-kit/utilities": "^3.2.0", "@dnd-kit/utilities": "^3.2.0",
"@mantine/core": "^4.2.12", "@emotion/react": "^11.10.0",
"@mantine/dates": "^4.2.12", "@emotion/server": "^11.10.0",
"@mantine/dropzone": "^4.2.12", "@mantine/carousel": "^5.1.0",
"@mantine/form": "^4.2.12", "@mantine/core": "^5.1.0",
"@mantine/hooks": "^4.2.12", "@mantine/dates": "^5.1.0",
"@mantine/next": "^4.2.12", "@mantine/dropzone": "^5.1.0",
"@mantine/notifications": "^4.2.12", "@mantine/form": "^5.1.0",
"@mantine/prism": "^4.2.12", "@mantine/hooks": "^5.1.0",
"@mantine/modals": "^5.1.0",
"@mantine/next": "^5.1.0",
"@mantine/notifications": "^5.1.0",
"@mantine/prism": "^5.0.0",
"@nivo/core": "^0.79.0", "@nivo/core": "^0.79.0",
"@nivo/line": "^0.79.1", "@nivo/line": "^0.79.1",
"@tabler/icons": "^1.76.0", "@tabler/icons": "^1.78.0",
"add": "^2.0.6",
"axios": "^0.27.2", "axios": "^0.27.2",
"consola": "^2.15.3",
"cookies-next": "^2.1.1", "cookies-next": "^2.1.1",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"dockerode": "^3.3.2", "dockerode": "^3.3.2",
"embla-carousel-react": "^7.0.0",
"framer-motion": "^6.5.1", "framer-motion": "^6.5.1",
"js-file-download": "^0.4.12", "js-file-download": "^0.4.12",
"next": "12.2.0", "next": "12.1.6",
"prism-react-renderer": "^1.3.5", "prism-react-renderer": "^1.3.5",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"sharp": "^0.30.7",
"systeminformation": "^5.12.1", "systeminformation": "^5.12.1",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"yarn": "^1.22.19" "yarn": "^1.22.19"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "12.2.0", "@next/bundle-analyzer": "^12.1.4",
"@next/eslint-plugin-next": "12.2.0", "@next/eslint-plugin-next": "^12.1.4",
"@types/dockerode": "^3.3.9", "@types/dockerode": "^3.3.9",
"@types/node": "^18.0.6", "@types/node": "17.0.1",
"@types/react": "^18.0.15", "@types/react": "17.0.1",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7", "@typescript-eslint/parser": "^5.30.7",

View File

@@ -8,8 +8,9 @@ import {
LoadingOverlay, LoadingOverlay,
Modal, Modal,
MultiSelect, MultiSelect,
ScrollArea, PasswordInput,
Select, Select,
Stack,
Switch, Switch,
Tabs, Tabs,
TextInput, TextInput,
@@ -17,10 +18,10 @@ import {
Tooltip, Tooltip,
} from '@mantine/core'; } from '@mantine/core';
import { useForm } from '@mantine/form'; import { useForm } from '@mantine/form';
import { useDebouncedValue } from '@mantine/hooks'; import { IconApps } from '@tabler/icons';
import { IconApps as Apps } from '@tabler/icons';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { useDebouncedValue } from '@mantine/hooks';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { tryMatchPort, ServiceTypeList, StatusCodes } from '../../tools/types'; import { tryMatchPort, ServiceTypeList, StatusCodes } from '../../tools/types';
import Tip from '../layout/Tip'; import Tip from '../layout/Tip';
@@ -38,18 +39,18 @@ export function AddItemShelfButton(props: any) {
> >
<AddAppShelfItemForm setOpened={setOpened} /> <AddAppShelfItemForm setOpened={setOpened} />
</Modal> </Modal>
<ActionIcon <Tooltip withinPortal label="Add a service">
variant="default" <ActionIcon
radius="md" variant="default"
size="xl" radius="md"
color="blue" size="xl"
style={props.style} color="blue"
onClick={() => setOpened(true)} style={props.style}
> onClick={() => setOpened(true)}
<Tooltip label="Add a service"> >
<Apps /> <IconApps />
</Tooltip> </ActionIcon>
</ActionIcon> </Tooltip>
</> </>
); );
} }
@@ -77,7 +78,7 @@ function MatchService(name: string, form: any) {
} }
} }
const DEFAULT_ICON = '/favicon.svg'; const DEFAULT_ICON = '/favicon.png';
export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } & any) { export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } & any) {
const { setOpened } = props; const { setOpened } = props;
@@ -85,25 +86,26 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
const [isLoading, setLoading] = useState(false); const [isLoading, setLoading] = useState(false);
// Extract all the categories from the services in config // Extract all the categories from the services in config
const categoryList = config.services.reduce((acc, cur) => { const InitialCategories = config.services.reduce((acc, cur) => {
if (cur.category && !acc.includes(cur.category)) { if (cur.category && !acc.includes(cur.category)) {
acc.push(cur.category); acc.push(cur.category);
} }
return acc; return acc;
}, [] as string[]); }, [] as string[]);
const [categories, setCategories] = useState<string[]>(InitialCategories);
const form = useForm({ const form = useForm({
initialValues: { initialValues: {
id: props.id ?? uuidv4(), id: props.id ?? uuidv4(),
type: props.type ?? 'Other', type: props.type ?? 'Other',
category: props.category ?? undefined, category: props.category ?? null,
name: props.name ?? '', name: props.name ?? '',
icon: props.icon ?? DEFAULT_ICON, icon: props.icon ?? DEFAULT_ICON,
url: props.url ?? '', url: props.url ?? '',
apiKey: props.apiKey ?? (undefined as unknown as string), apiKey: props.apiKey ?? undefined,
username: props.username ?? (undefined as unknown as string), username: props.username ?? undefined,
password: props.password ?? (undefined as unknown as string), password: props.password ?? undefined,
openedUrl: props.openedUrl ?? (undefined as unknown as string), openedUrl: props.openedUrl ?? undefined,
status: props.status ?? ['200'], status: props.status ?? ['200'],
newTab: props.newTab ?? true, newTab: props.newTab ?? true,
}, },
@@ -133,7 +135,13 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
const [debounced, cancel] = useDebouncedValue(form.values.name, 250); const [debounced, cancel] = useDebouncedValue(form.values.name, 250);
useEffect(() => { useEffect(() => {
if (form.values.name !== debounced || form.values.icon !== DEFAULT_ICON) return; if (
form.values.name !== debounced ||
form.values.icon !== DEFAULT_ICON ||
form.values.type !== 'Other'
) {
return;
}
MatchIcon(form.values.name, form); MatchIcon(form.values.name, form);
MatchService(form.values.name, form); MatchService(form.values.name, form);
tryMatchPort(form.values.name, form); tryMatchPort(form.values.name, form);
@@ -150,7 +158,7 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
return ( return (
<> <>
<Center> <Center mb="lg">
<Image <Image
height={120} height={120}
width={120} width={120}
@@ -162,21 +170,21 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
</Center> </Center>
<form <form
onSubmit={form.onSubmit(() => { onSubmit={form.onSubmit(() => {
if (JSON.stringify(form.values.status) === JSON.stringify(['200'])) { const newForm = { ...form.values };
form.values.status = undefined; if (newForm.newTab === true) newForm.newTab = undefined;
} if (newForm.category === null) newForm.category = undefined;
if (form.values.newTab === true) { if (newForm.status.length === 1 && newForm.status[0] === '200') {
form.values.newTab = undefined; delete newForm.status;
} }
// If service already exists, update it. // If service already exists, update it.
if (config.services && config.services.find((s) => s.id === form.values.id)) { if (config.services && config.services.find((s) => s.id === newForm.id)) {
setConfig({ setConfig({
...config, ...config,
// replace the found item by matching ID // replace the found item by matching ID
services: config.services.map((s) => { services: config.services.map((s) => {
if (s.id === form.values.id) { if (s.id === newForm.id) {
return { return {
...form.values, ...newForm,
}; };
} }
return s; return s;
@@ -185,158 +193,162 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
} else { } else {
setConfig({ setConfig({
...config, ...config,
services: [...config.services, form.values], services: [...config.services, newForm],
}); });
} }
setOpened(false); setOpened(false);
form.reset(); form.reset();
})} })}
> >
<Tabs grow> <Tabs defaultValue="Options">
<Tabs.Tab label="Options"> <Tabs.List grow>
<ScrollArea style={{ height: 500 }} scrollbarSize={4}> <Tabs.Tab value="Options">Options</Tabs.Tab>
<Group direction="column" grow> <Tabs.Tab value="Advanced Options">Advanced options</Tabs.Tab>
<TextInput </Tabs.List>
required <Tabs.Panel value="Options">
label="Service name" <Stack>
placeholder="Plex" <TextInput
{...form.getInputProps('name')} required
/> label="Service name"
placeholder="Plex"
<TextInput {...form.getInputProps('name')}
required />
label="Icon URL" <TextInput
placeholder={DEFAULT_ICON} required
{...form.getInputProps('icon')} label="Icon URL"
/> placeholder={DEFAULT_ICON}
<TextInput {...form.getInputProps('icon')}
required />
label="Service URL" <TextInput
placeholder="http://localhost:7575" required
{...form.getInputProps('url')} label="Service URL"
/> placeholder="http://localhost:7575"
<TextInput {...form.getInputProps('url')}
label="On Click URL" />
placeholder="http://sonarr.example.com" <TextInput
{...form.getInputProps('openedUrl')} label="On Click URL"
/> placeholder="http://sonarr.example.com"
<Select {...form.getInputProps('openedUrl')}
label="Service type" />
defaultValue="Other" <Select
placeholder="Pick one" label="Service type"
required defaultValue="Other"
searchable placeholder="Pick one"
data={ServiceTypeList} required
{...form.getInputProps('type')} searchable
/> data={ServiceTypeList}
<Select {...form.getInputProps('type')}
label="Category" />
data={categoryList} <Select
placeholder="Select a category or create a new one" label="Category"
nothingFound="Nothing found" data={categories}
searchable placeholder="Select a category or create a new one"
clearable nothingFound="Nothing found"
creatable searchable
onClick={(e) => { clearable
e.preventDefault(); creatable
}} onCreate={(query) => {
getCreateLabel={(query) => `+ Create "${query}"`} const item = { value: query, label: query };
onCreate={(query) => {}} setCategories([...InitialCategories, query]);
{...form.getInputProps('category')} return item;
/> }}
<LoadingOverlay visible={isLoading} /> getCreateLabel={(query) => `+ Create "${query}"`}
{(form.values.type === 'Sonarr' || {...form.getInputProps('category')}
form.values.type === 'Radarr' || />
form.values.type === 'Lidarr' || <LoadingOverlay visible={isLoading} />
form.values.type === 'Readarr') && ( {(form.values.type === 'Sonarr' ||
<> form.values.type === 'Radarr' ||
<TextInput form.values.type === 'Lidarr' ||
required form.values.type === 'Overseerr' ||
label="API key" form.values.type === 'Jellyseerr' ||
placeholder="Your API key" form.values.type === 'Readarr') && (
value={form.values.apiKey} <>
onChange={(event) => { <TextInput
form.setFieldValue('apiKey', event.currentTarget.value); required
}} label="API key"
error={form.errors.apiKey && 'Invalid API key'} placeholder="Your API key"
/> value={form.values.apiKey}
<Tip> onChange={(event) => {
Get your API key{' '} form.setFieldValue('apiKey', event.currentTarget.value);
<Anchor }}
target="_blank" error={form.errors.apiKey && 'Invalid API key'}
weight="bold" />
style={{ fontStyle: 'inherit', fontSize: 'inherit' }} <Tip>
href={`${hostname}/settings/general`} Get your API key{' '}
> <Anchor
here. target="_blank"
</Anchor> weight="bold"
</Tip> style={{ fontStyle: 'inherit', fontSize: 'inherit' }}
</> href={`${hostname}/settings/general`}
)} >
{form.values.type === 'qBittorrent' && ( here.
<> </Anchor>
<TextInput </Tip>
required </>
label="Username" )}
placeholder="admin" {form.values.type === 'qBittorrent' && (
value={form.values.username} <>
onChange={(event) => { <TextInput
form.setFieldValue('username', event.currentTarget.value); required
}} label="Username"
error={form.errors.username && 'Invalid username'} placeholder="admin"
/> value={form.values.username}
<TextInput onChange={(event) => {
required form.setFieldValue('username', event.currentTarget.value);
label="Password" }}
placeholder="adminadmin" error={form.errors.username && 'Invalid username'}
value={form.values.password} />
onChange={(event) => { <PasswordInput
form.setFieldValue('password', event.currentTarget.value); required
}} label="Password"
error={form.errors.password && 'Invalid password'} placeholder="adminadmin"
/> value={form.values.password}
</> onChange={(event) => {
)} form.setFieldValue('password', event.currentTarget.value);
{form.values.type === 'Deluge' && ( }}
<> error={form.errors.password && 'Invalid password'}
<TextInput />
label="Password" </>
placeholder="password" )}
value={form.values.password} {form.values.type === 'Deluge' && (
onChange={(event) => { <>
form.setFieldValue('password', event.currentTarget.value); <PasswordInput
}} label="Password"
error={form.errors.password && 'Invalid password'} placeholder="password"
/> value={form.values.password}
</> onChange={(event) => {
)} form.setFieldValue('password', event.currentTarget.value);
{form.values.type === 'Transmission' && ( }}
<> error={form.errors.password && 'Invalid password'}
<TextInput />
label="Username" </>
placeholder="admin" )}
value={form.values.username} {form.values.type === 'Transmission' && (
onChange={(event) => { <>
form.setFieldValue('username', event.currentTarget.value); <TextInput
}} label="Username"
error={form.errors.username && 'Invalid username'} placeholder="admin"
/> value={form.values.username}
<TextInput onChange={(event) => {
label="Password" form.setFieldValue('username', event.currentTarget.value);
placeholder="adminadmin" }}
value={form.values.password} error={form.errors.username && 'Invalid username'}
onChange={(event) => { />
form.setFieldValue('password', event.currentTarget.value); <PasswordInput
}} label="Password"
error={form.errors.password && 'Invalid password'} placeholder="adminadmin"
/> value={form.values.password}
</> onChange={(event) => {
)} form.setFieldValue('password', event.currentTarget.value);
</Group> }}
</ScrollArea> error={form.errors.password && 'Invalid password'}
</Tabs.Tab> />
<Tabs.Tab label="Advanced Options"> </>
<Group direction="column" grow> )}
</Stack>
</Tabs.Panel>
<Tabs.Panel value="Advanced Options">
<Stack>
<MultiSelect <MultiSelect
required required
label="HTTP Status Codes" label="HTTP Status Codes"
@@ -354,8 +366,8 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
defaultChecked={form.values.newTab} defaultChecked={form.values.newTab}
{...form.getInputProps('newTab')} {...form.getInputProps('newTab')}
/> />
</Group> </Stack>
</Tabs.Tab> </Tabs.Panel>
</Tabs> </Tabs>
<Group grow position="center" mt="xl"> <Group grow position="center" mt="xl">
<Button type="submit">{props.message ?? 'Add service'}</Button> <Button type="submit">{props.message ?? 'Add service'}</Button>

View File

@@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Accordion, createStyles, Grid, Group, Paper, useMantineColorScheme } from '@mantine/core'; import { Accordion, Grid, Paper, Stack, useMantineColorScheme } from '@mantine/core';
import { import {
closestCenter, closestCenter,
DndContext, DndContext,
@@ -14,48 +14,26 @@ import { useLocalStorage } from '@mantine/hooks';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { SortableAppShelfItem, AppShelfItem } from './AppShelfItem'; import { SortableAppShelfItem, AppShelfItem } from './AppShelfItem';
import { ModuleMenu, ModuleWrapper } from '../modules/moduleWrapper'; import { ModuleMenu, ModuleWrapper } from '../../modules/moduleWrapper';
import { DownloadsModule } from '../modules'; import { DownloadsModule } from '../../modules';
import DownloadComponent from '../modules/downloads/DownloadsModule'; import DownloadComponent from '../../modules/downloads/DownloadsModule';
const useStyles = createStyles((theme, _params) => ({
item: {
overflow: 'hidden',
borderLeft: '3px solid transparent',
borderRight: '3px solid transparent',
borderBottom: '3px solid transparent',
borderRadius: '20px',
borderColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1],
marginTop: theme.spacing.md,
},
control: {
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1],
borderRadius: theme.spacing.md,
'&:hover': {
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1],
},
},
content: {
margin: theme.spacing.md,
},
label: {
overflow: 'visible',
},
}));
const AppShelf = (props: any) => { const AppShelf = (props: any) => {
const { classes, cx } = useStyles(props); const { config, setConfig } = useConfig();
const [toggledCategories, settoggledCategories] = useLocalStorage({ // Extract all the categories from the services in config
const categoryList = config.services.reduce((acc, cur) => {
if (cur.category && !acc.includes(cur.category)) {
acc.push(cur.category);
}
return acc;
}, [] as string[]);
const [toggledCategories, setToggledCategories] = useLocalStorage({
key: 'app-shelf-toggled', key: 'app-shelf-toggled',
// This is a bit of a hack to get the 5 first categories to be toggled on by default // This is a bit of a hack to toggle the categories on the first load, return a string[] of the categories
defaultValue: { 0: true, 1: true, 2: true, 3: true, 4: true } as Record<string, boolean>, defaultValue: categoryList,
}); });
const [activeId, setActiveId] = useState(null); const [activeId, setActiveId] = useState(null);
const { config, setConfig } = useConfig();
const { colorScheme } = useMantineColorScheme(); const { colorScheme } = useMantineColorScheme();
const sensors = useSensors( const sensors = useSensors(
@@ -93,15 +71,8 @@ const AppShelf = (props: any) => {
setActiveId(null); setActiveId(null);
} }
// Extract all the categories from the services in config
const categoryList = config.services.reduce((acc, cur) => {
if (cur.category && !acc.includes(cur.category)) {
acc.push(cur.category);
}
return acc;
}, [] as string[]);
const item = (filter?: string) => { const getItems = (filter?: string) => {
// If filter is not set, return all the services without a category or a null category // If filter is not set, return all the services without a category or a null category
let filtered = config.services; let filtered = config.services;
if (!filter) { if (!filter) {
@@ -155,54 +126,62 @@ const AppShelf = (props: any) => {
const downloadEnabled = config.modules?.[DownloadsModule.title]?.enabled ?? false; const downloadEnabled = config.modules?.[DownloadsModule.title]?.enabled ?? false;
// Create an item with 0: true, 1: true, 2: true... For each category // Create an item with 0: true, 1: true, 2: true... For each category
return ( return (
// Return one item for each category // TODO: Style accordion so that the bar is transparent to the user settings
<Group grow direction="column"> <Stack>
<Accordion <Accordion
disableIconRotation variant="separated"
classNames={classes} radius="lg"
order={2} order={2}
iconPosition="right"
multiple multiple
initialState={toggledCategories} value={toggledCategories}
onChange={(idx) => settoggledCategories(idx)} onChange={(state) => {
setToggledCategories([...state]);
}}
> >
{categoryList.map((category, idx) => ( {categoryList.map((category, idx) => (
<Accordion.Item key={category} label={category}> <Accordion.Item key={category} value={idx.toString()}>
{item(category)} <Accordion.Control>{category}</Accordion.Control>
<Accordion.Panel>{getItems(category)}</Accordion.Panel>
</Accordion.Item> </Accordion.Item>
))} ))}
{/* Return the item for all services without category */} {/* Return the item for all services without category */}
{noCategory && noCategory.length > 0 ? ( {noCategory && noCategory.length > 0 ? (
<Accordion.Item key="Other" label="Other"> <Accordion.Item key="Other" value="Other">
{item()} <Accordion.Control>Other</Accordion.Control>
<Accordion.Panel>{getItems()}</Accordion.Panel>
</Accordion.Item> </Accordion.Item>
) : null} ) : null}
{downloadEnabled ? ( {downloadEnabled ? (
<Accordion.Item key="Downloads" label="Your downloads"> <Accordion.Item key="Downloads" value="Your downloads">
<Paper <Accordion.Control>Your downloads</Accordion.Control>
p="lg" <Accordion.Panel>
radius="lg" <Paper
style={{ p="lg"
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \ radius="lg"
style={{
background: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '255, 255, 255,'} \
${(config.settings.appOpacity || 100) / 100}`, ${(config.settings.appOpacity || 100) / 100}`,
borderColor: `rgba(${colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'} \ borderColor: `rgba(${
colorScheme === 'dark' ? '37, 38, 43,' : '233, 236, 239,'
} \
${(config.settings.appOpacity || 100) / 100}`, ${(config.settings.appOpacity || 100) / 100}`,
}} }}
> >
<ModuleMenu module={DownloadsModule} /> <ModuleMenu module={DownloadsModule} />
<DownloadComponent /> <DownloadComponent />
</Paper> </Paper>
</Accordion.Panel>
</Accordion.Item> </Accordion.Item>
) : null} ) : null}
</Accordion> </Accordion>
</Group> </Stack>
); );
} }
return ( return (
<Group grow direction="column"> <Stack>
{item()} {getItems()}
<ModuleWrapper mt="xl" module={DownloadsModule} /> <ModuleWrapper mt="xl" module={DownloadsModule} />
</Group> </Stack>
); );
}; };

View File

@@ -3,7 +3,6 @@ import {
Card, Card,
Anchor, Anchor,
AspectRatio, AspectRatio,
Image,
Center, Center,
createStyles, createStyles,
useMantineColorScheme, useMantineColorScheme,
@@ -12,8 +11,9 @@ import { motion } from 'framer-motion';
import { useState } from 'react'; import { useState } from 'react';
import { useSortable } from '@dnd-kit/sortable'; import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities'; import { CSS } from '@dnd-kit/utilities';
import Image from 'next/image';
import { serviceItem } from '../../tools/types'; import { serviceItem } from '../../tools/types';
import PingComponent from '../modules/ping/PingModule'; import PingComponent from '../../modules/ping/PingModule';
import AppShelfMenu from './AppShelfMenu'; import AppShelfMenu from './AppShelfMenu';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
@@ -120,18 +120,20 @@ export function AppShelfItem(props: any) {
scale: 1.1, scale: 1.1,
}} }}
> >
<Image <Anchor
styles={{ root: { cursor: 'pointer' } }} href={service.openedUrl ?? service.url}
width={80} target={service.newTab === false ? '_top' : '_blank'}
height={80} >
src={service.icon} <Image
fit="contain" style={{
onClick={() => { cursor: 'pointer',
if (service.openedUrl) { }}
window.open(service.openedUrl, service.newTab === false ? '_top' : '_blank'); width={80}
} else window.open(service.url, service.newTab === false ? '_top' : '_blank'); height={80}
}} src={service.icon}
/> objectFit="contain"
/>
</Anchor>
</motion.i> </motion.i>
</AspectRatio> </AspectRatio>
<PingComponent url={service.url} status={service.status} /> <PingComponent url={service.url} status={service.status} />

View File

@@ -1,14 +1,16 @@
import { Menu, Modal, Text, useMantineTheme } from '@mantine/core'; import { ActionIcon, Menu, Modal, Text, useMantineTheme } from '@mantine/core';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { useState } from 'react'; import { useState } from 'react';
import { IconCheck as Check, IconEdit as Edit, IconTrash as Trash } from '@tabler/icons'; import { IconCheck as Check, IconEdit as Edit, IconMenu, IconTrash as Trash } from '@tabler/icons';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { serviceItem } from '../../tools/types'; import { serviceItem } from '../../tools/types';
import { AddAppShelfItemForm } from './AddAppShelfItem'; import { AddAppShelfItemForm } from './AddAppShelfItem';
import { useColorTheme } from '../../tools/color';
export default function AppShelfMenu(props: any) { export default function AppShelfMenu(props: any) {
const { service }: { service: serviceItem } = props; const { service }: { service: serviceItem } = props;
const { config, setConfig } = useConfig(); const { config, setConfig } = useConfig();
const { secondaryColor } = useColorTheme();
const theme = useMantineTheme(); const theme = useMantineTheme();
const [opened, setOpened] = useState(false); const [opened, setOpened] = useState(false);
return ( return (
@@ -23,49 +25,54 @@ export default function AppShelfMenu(props: any) {
<AddAppShelfItemForm setOpened={setOpened} {...service} message="Save service" /> <AddAppShelfItemForm setOpened={setOpened} {...service} message="Save service" />
</Modal> </Modal>
<Menu <Menu
position="right" withinPortal
radius="md" width={150}
shadow="xl" shadow="xl"
withArrow
radius="md"
position="right"
styles={{ styles={{
body: { dropdown: {
// Add shadow and elevation to the body // Add shadow and elevation to the body
boxShadow: '0 0 14px 14px rgba(0, 0, 0, 0.05)', boxShadow: '0 0 14px 14px rgba(0, 0, 0, 0.05)',
}, },
}} }}
> >
<Menu.Label>Settings</Menu.Label> <Menu.Target>
<Menu.Item <ActionIcon style={{}}>
color="primary" <IconMenu />
icon={<Edit />} </ActionIcon>
// TODO: #2 Add the ability to edit the service. </Menu.Target>
onClick={() => setOpened(true)} <Menu.Dropdown>
> <Menu.Label>Settings</Menu.Label>
Edit <Menu.Item color={secondaryColor} icon={<Edit />} onClick={() => setOpened(true)}>
</Menu.Item> Edit
<Menu.Label>Danger zone</Menu.Label> </Menu.Item>
<Menu.Item <Menu.Label>Danger zone</Menu.Label>
color="red" <Menu.Item
onClick={(e: any) => { color="red"
setConfig({ onClick={(e: any) => {
...config, setConfig({
services: config.services.filter((s) => s.id !== service.id), ...config,
}); services: config.services.filter((s) => s.id !== service.id),
showNotification({ });
autoClose: 5000, showNotification({
title: ( autoClose: 5000,
<Text> title: (
Service <b>{service.name}</b> removed successfully! <Text>
</Text> Service <b>{service.name}</b> removed successfully!
), </Text>
color: 'green', ),
icon: <Check />, color: 'green',
message: undefined, icon: <Check />,
}); message: undefined,
}} });
icon={<Trash />} }}
> icon={<Trash />}
Delete >
</Menu.Item> Delete
</Menu.Item>
</Menu.Dropdown>
</Menu> </Menu>
</> </>
); );

View File

@@ -5,25 +5,27 @@ import { useConfig } from '../../tools/state';
export default function ConfigChanger() { export default function ConfigChanger() {
const { config, loadConfig, setConfig, getConfigs } = useConfig(); const { config, loadConfig, setConfig, getConfigs } = useConfig();
const [configList, setConfigList] = useState([] as string[]); const [configList, setConfigList] = useState<string[]>([]);
const [value, setValue] = useState(config.name);
useEffect(() => { useEffect(() => {
getConfigs().then((configs) => setConfigList(configs)); getConfigs().then((configs) => setConfigList(configs));
// setConfig(initialConfig);
}, [config]); }, [config]);
// If configlist is empty, return a loading indicator // If configlist is empty, return a loading indicator
if (configList.length === 0) { if (configList.length === 0) {
return ( return (
<Center> <Tooltip label={"Loading your configs. This doesn't load in vercel."}>
<Tooltip label={"Loading your configs. This doesn't load in vercel."}> <Center>
<Loader /> <Loader />
</Tooltip> </Center>
</Center> </Tooltip>
); );
} }
// return <Select data={[{ value: '1', label: '1' },]} onChange={(e) => console.log(e)} value="1" />;
return ( return (
<Select <Select
defaultValue={config.name}
label="Config loader" label="Config loader"
value={value}
defaultValue={config.name}
onChange={(e) => { onChange={(e) => {
loadConfig(e ?? 'default'); loadConfig(e ?? 'default');
setCookie('config-name', e ?? 'default', { setCookie('config-name', e ?? 'default', {

View File

@@ -1,68 +1,18 @@
import { Group, Text, useMantineTheme, MantineTheme } from '@mantine/core'; import { Group, Text, useMantineTheme } from '@mantine/core';
import { import { IconX as X, IconCheck as Check, IconX, IconPhoto, IconUpload } from '@tabler/icons';
IconUpload as Upload,
IconPhoto as Photo,
IconX as X,
IconCheck as Check,
TablerIcon,
} from '@tabler/icons';
import { DropzoneStatus, FullScreenDropzone } from '@mantine/dropzone';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { useRef } from 'react';
import { useRouter } from 'next/router';
import { setCookie } from 'cookies-next'; import { setCookie } from 'cookies-next';
import { Dropzone } from '@mantine/dropzone';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { Config } from '../../tools/types'; import { Config } from '../../tools/types';
import { migrateToIdConfig } from '../../tools/migrate'; import { migrateToIdConfig } from '../../tools/migrate';
function getIconColor(status: DropzoneStatus, theme: MantineTheme) {
return status.accepted
? theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6]
: status.rejected
? theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6]
: theme.colorScheme === 'dark'
? theme.colors.dark[0]
: theme.colors.gray[7];
}
function ImageUploadIcon({
status,
...props
}: React.ComponentProps<TablerIcon> & { status: DropzoneStatus }) {
if (status.accepted) {
return <Upload {...props} />;
}
if (status.rejected) {
return <X {...props} />;
}
return <Photo {...props} />;
}
export const dropzoneChildren = (status: DropzoneStatus, theme: MantineTheme) => (
<Group position="center" spacing="xl" style={{ minHeight: 220, pointerEvents: 'none' }}>
<ImageUploadIcon status={status} style={{ color: getIconColor(status, theme) }} size={80} />
<div>
<Text size="xl" inline>
Drag images here or click to select files
</Text>
<Text size="sm" color="dimmed" inline mt={7}>
Attach as many files as you like, each file should not exceed 5mb
</Text>
</div>
</Group>
);
export default function LoadConfigComponent(props: any) { export default function LoadConfigComponent(props: any) {
const { setConfig } = useConfig(); const { setConfig } = useConfig();
const theme = useMantineTheme(); const theme = useMantineTheme();
const router = useRouter();
const openRef = useRef<() => void>();
return ( return (
<FullScreenDropzone <Dropzone.FullScreen
onDrop={(files) => { onDrop={(files) => {
files[0].text().then((e) => { files[0].text().then((e) => {
try { try {
@@ -100,7 +50,31 @@ export default function LoadConfigComponent(props: any) {
}} }}
accept={['application/json']} accept={['application/json']}
> >
{(status) => dropzoneChildren(status, theme)} <Group position="center" spacing="xl" style={{ minHeight: 220, pointerEvents: 'none' }}>
</FullScreenDropzone> <Dropzone.Accept>
<Text size="xl" inline>
<IconUpload
size={50}
stroke={1.5}
color={theme.colors[theme.primaryColor][theme.colorScheme === 'dark' ? 4 : 6]}
/>
Drag files here to upload a config. Support for JSON only.
</Text>
</Dropzone.Accept>
<Dropzone.Reject>
<Text size="xl" inline>
<IconX
size={50}
stroke={1.5}
color={theme.colors.red[theme.colorScheme === 'dark' ? 4 : 6]}
/>
This file format is not supported. Please only upload JSON.
</Text>
</Dropzone.Reject>
<Dropzone.Idle>
<IconPhoto size={50} stroke={1.5} />
</Dropzone.Idle>
</Group>
</Dropzone.FullScreen>
); );
} }

View File

@@ -1,4 +1,4 @@
import { TextInput, Group, Button } from '@mantine/core'; import { TextInput, Button, Stack } from '@mantine/core';
import { useForm } from '@mantine/form'; import { useForm } from '@mantine/form';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { ColorSelector } from './ColorSelector'; import { ColorSelector } from './ColorSelector';
@@ -37,14 +37,14 @@ export default function TitleChanger() {
}; };
return ( return (
<Group direction="column" grow mb="lg"> <Stack mb="md" mr="sm" mt="xs">
<form onSubmit={form.onSubmit((values) => saveChanges(values))}> <form onSubmit={form.onSubmit((values) => saveChanges(values))}>
<Group grow direction="column"> <Stack>
<TextInput label="Page title" placeholder="Homarr 🦞" {...form.getInputProps('title')} /> <TextInput label="Page title" placeholder="Homarr 🦞" {...form.getInputProps('title')} />
<TextInput label="Logo" placeholder="/img/logo.png" {...form.getInputProps('logo')} /> <TextInput label="Logo" placeholder="/img/logo.png" {...form.getInputProps('logo')} />
<TextInput <TextInput
label="Favicon" label="Favicon"
placeholder="/favicon.svg" placeholder="/favicon.png"
{...form.getInputProps('favicon')} {...form.getInputProps('favicon')}
/> />
<TextInput <TextInput
@@ -53,13 +53,13 @@ export default function TitleChanger() {
{...form.getInputProps('background')} {...form.getInputProps('background')}
/> />
<Button type="submit">Save</Button> <Button type="submit">Save</Button>
</Group> </Stack>
</form> </form>
<ColorSelector type="primary" /> <ColorSelector type="primary" />
<ColorSelector type="secondary" /> <ColorSelector type="secondary" />
<ShadeSelector /> <ShadeSelector />
<OpacitySelector /> <OpacitySelector />
<AppCardWidthSelector /> <AppCardWidthSelector />
</Group> </Stack>
); );
} }

View File

@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Group, Text, Slider } from '@mantine/core'; import { Text, Slider, Stack } from '@mantine/core';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
export function AppCardWidthSelector() { export function AppCardWidthSelector() {
@@ -16,7 +16,7 @@ export function AppCardWidthSelector() {
}; };
return ( return (
<Group direction="column" spacing="xs" grow> <Stack spacing="xs">
<Text>App Width</Text> <Text>App Width</Text>
<Slider <Slider
label={null} label={null}
@@ -27,6 +27,6 @@ export function AppCardWidthSelector() {
styles={{ markLabel: { fontSize: 'xx-small' } }} styles={{ markLabel: { fontSize: 'xx-small' } }}
onChange={(value) => setappCardWidth(value)} onChange={(value) => setappCardWidth(value)}
/> />
</Group> </Stack>
); );
} }

View File

@@ -1,5 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { ColorSwatch, Group, Popover, Text, useMantineTheme } from '@mantine/core'; import { ColorSwatch, Grid, Group, Popover, Text, useMantineTheme } from '@mantine/core';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { useColorTheme } from '../../tools/color'; import { useColorTheme } from '../../tools/color';
@@ -44,51 +44,43 @@ export function ColorSelector({ type }: ColorControlProps) {
}; };
const swatches = colors.map(({ color, swatch }) => ( const swatches = colors.map(({ color, swatch }) => (
<ColorSwatch <Grid.Col span={2} key={color}>
component="button" <ColorSwatch
type="button" component="button"
onClick={() => setConfigColor(color)} type="button"
key={color} onClick={() => setConfigColor(color)}
color={swatch} color={swatch}
size={22} size={22}
style={{ color: theme.white, cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
</Grid.Col>
)); ));
return ( return (
<Group direction="row" spacing={3}> <Group>
<Popover <Popover
width={250}
withinPortal
opened={opened} opened={opened}
onClose={() => setOpened(false)} onClose={() => setOpened(false)}
transitionDuration={0} position="left"
target={ withArrow
>
<Popover.Target>
<ColorSwatch <ColorSwatch
component="button" component="button"
type="button" type="button"
color={theme.colors[configColor][6]} color={theme.colors[configColor][6]}
onClick={() => setOpened((o) => !o)} onClick={() => setOpened((o) => !o)}
size={22} size={22}
style={{ display: 'block', cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
} </Popover.Target>
styles={{ <Popover.Dropdown>
root: { <Grid gutter="lg" columns={14}>
marginRight: theme.spacing.xs, {swatches}
}, </Grid>
body: { </Popover.Dropdown>
width: 152,
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white,
},
arrow: {
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white,
},
}}
position="bottom"
placement="end"
withArrow
arrowSize={3}
>
<Group spacing="xs">{swatches}</Group>
</Popover> </Popover>
<Text>{type[0].toUpperCase() + type.slice(1)} color</Text> <Text>{type[0].toUpperCase() + type.slice(1)} color</Text>
</Group> </Group>

View File

@@ -1,4 +1,4 @@
import { Group, Text, SegmentedControl, TextInput } from '@mantine/core'; import { Text, SegmentedControl, TextInput, Stack } from '@mantine/core';
import { useState } from 'react'; import { useState } from 'react';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { ColorSchemeSwitch } from '../ColorSchemeToggle/ColorSchemeSwitch'; import { ColorSchemeSwitch } from '../ColorSchemeToggle/ColorSchemeSwitch';
@@ -24,8 +24,8 @@ export default function CommonSettings(args: any) {
); );
return ( return (
<Group direction="column" grow mb="lg"> <Stack mb="md" mr="sm">
<Group grow direction="column" spacing={0}> <Stack spacing={0} mt="xs">
<Text>Search engine</Text> <Text>Search engine</Text>
<Tip> <Tip>
Use the prefixes <b>!yt</b> and <b>!t</b> in front of your query to search on YouTube or Use the prefixes <b>!yt</b> and <b>!t</b> in front of your query to search on YouTube or
@@ -74,13 +74,13 @@ export default function CommonSettings(args: any) {
/> />
</> </>
)} )}
</Group> </Stack>
<ColorSchemeSwitch /> <ColorSchemeSwitch />
<WidgetsPositionSwitch /> <WidgetsPositionSwitch />
<ModuleEnabler /> <ModuleEnabler />
<ConfigChanger /> <ConfigChanger />
<SaveConfigComponent /> <SaveConfigComponent />
<Tip>Upload your config file by dragging and dropping it onto the page!</Tip> <Tip>Upload your config file by dragging and dropping it onto the page!</Tip>
</Group> </Stack>
); );
} }

View File

@@ -4,7 +4,7 @@ import { CURRENT_VERSION } from '../../../data/constants';
export default function Credits(props: any) { export default function Credits(props: any) {
return ( return (
<Group position="center" direction="row" mr="xs"> <Group position="center" mt="xs">
<Group spacing={0}> <Group spacing={0}>
<ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg"> <ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg">
<IconBrandGithub size={18} /> <IconBrandGithub size={18} />

View File

@@ -1,14 +1,14 @@
import { Checkbox, Group, SimpleGrid, Title } from '@mantine/core'; import { Checkbox, SimpleGrid, Stack, Title } from '@mantine/core';
import * as Modules from '../modules'; import * as Modules from '../../modules';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
export default function ModuleEnabler(props: any) { export default function ModuleEnabler(props: any) {
const { config, setConfig } = useConfig(); const { config, setConfig } = useConfig();
const modules = Object.values(Modules).map((module) => module); const modules = Object.values(Modules).map((module) => module);
return ( return (
<Group direction="column"> <Stack>
<Title order={4}>Module enabler</Title> <Title order={4}>Module enabler</Title>
<SimpleGrid cols={2} spacing="md"> <SimpleGrid cols={3} spacing="xs">
{modules.map((module) => ( {modules.map((module) => (
<Checkbox <Checkbox
key={module.title} key={module.title}
@@ -30,6 +30,6 @@ export default function ModuleEnabler(props: any) {
/> />
))} ))}
</SimpleGrid> </SimpleGrid>
</Group> </Stack>
); );
} }

View File

@@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Group, Text, Slider } from '@mantine/core'; import { Text, Slider, Stack } from '@mantine/core';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
export function OpacitySelector() { export function OpacitySelector() {
@@ -29,7 +29,7 @@ export function OpacitySelector() {
}; };
return ( return (
<Group direction="column" spacing="xs" grow> <Stack spacing="xs">
<Text>App Opacity</Text> <Text>App Opacity</Text>
<Slider <Slider
defaultValue={config.settings.appOpacity || 100} defaultValue={config.settings.appOpacity || 100}
@@ -39,6 +39,6 @@ export function OpacitySelector() {
styles={{ markLabel: { fontSize: 'xx-small' } }} styles={{ markLabel: { fontSize: 'xx-small' } }}
onChange={(value) => setConfigOpacity(value)} onChange={(value) => setConfigOpacity(value)}
/> />
</Group> </Stack>
); );
} }

View File

@@ -8,17 +8,21 @@ import Credits from './Credits';
function SettingsMenu(props: any) { function SettingsMenu(props: any) {
return ( return (
<Tabs grow> <Tabs defaultValue="Common">
<Tabs.Tab data-autofocus label="Common"> <Tabs.List grow>
<Tabs.Tab value="Common">Common</Tabs.Tab>
<Tabs.Tab value="Customizations">Customizations</Tabs.Tab>
</Tabs.List>
<Tabs.Panel data-autofocus value="Common">
<ScrollArea style={{ height: '78vh' }} offsetScrollbars> <ScrollArea style={{ height: '78vh' }} offsetScrollbars>
<CommonSettings /> <CommonSettings />
</ScrollArea> </ScrollArea>
</Tabs.Tab> </Tabs.Panel>
<Tabs.Tab label="Customizations"> <Tabs.Panel value="Customizations">
<ScrollArea style={{ height: '78vh' }} offsetScrollbars> <ScrollArea style={{ height: '78vh' }} offsetScrollbars>
<AdvancedSettings /> <AdvancedSettings />
</ScrollArea> </ScrollArea>
</Tabs.Tab> </Tabs.Panel>
</Tabs> </Tabs>
); );
} }
@@ -40,18 +44,18 @@ export function SettingsMenuButton(props: any) {
<SettingsMenu /> <SettingsMenu />
<Credits /> <Credits />
</Drawer> </Drawer>
<ActionIcon <Tooltip label="Settings">
variant="default" <ActionIcon
radius="md" variant="default"
size="xl" radius="md"
color="blue" size="xl"
style={props.style} color="blue"
onClick={() => setOpened(true)} style={props.style}
> onClick={() => setOpened(true)}
<Tooltip label="Settings"> >
<IconSettings /> <IconSettings />
</Tooltip> </ActionIcon>
</ActionIcon> </Tooltip>
</> </>
); );
} }

View File

@@ -1,5 +1,14 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { ColorSwatch, Group, Popover, Text, useMantineTheme, MantineTheme } from '@mantine/core'; import {
ColorSwatch,
Group,
Popover,
Text,
useMantineTheme,
MantineTheme,
Stack,
Grid,
} from '@mantine/core';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
import { useColorTheme } from '../../tools/color'; import { useColorTheme } from '../../tools/color';
@@ -31,36 +40,42 @@ export function ShadeSelector() {
}; };
const primarySwatches = primaryShades.map(({ swatch, shade }) => ( const primarySwatches = primaryShades.map(({ swatch, shade }) => (
<ColorSwatch <Grid.Col span={1} key={Number(shade)}>
component="button" <ColorSwatch
type="button" component="button"
onClick={() => setConfigShade(shade)} type="button"
key={Number(shade)} onClick={() => setConfigShade(shade)}
color={swatch} color={swatch}
size={22} size={22}
style={{ color: theme.white, cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
</Grid.Col>
)); ));
const secondarySwatches = secondaryShades.map(({ swatch, shade }) => ( const secondarySwatches = secondaryShades.map(({ swatch, shade }) => (
<ColorSwatch <Grid.Col span={1} key={Number(shade)}>
component="button" <ColorSwatch
type="button" component="button"
onClick={() => setConfigShade(shade)} type="button"
key={Number(shade)} onClick={() => setConfigShade(shade)}
color={swatch} color={swatch}
size={22} size={22}
style={{ color: theme.white, cursor: 'pointer' }} style={{ cursor: 'pointer' }}
/> />
</Grid.Col>
)); ));
return ( return (
<Group direction="row" spacing={3}> <Group>
<Popover <Popover
width={350}
withinPortal
opened={opened} opened={opened}
onClose={() => setOpened(false)} onClose={() => setOpened(false)}
transitionDuration={0} position="left"
target={ withArrow
>
<Popover.Target>
<ColorSwatch <ColorSwatch
component="button" component="button"
type="button" type="button"
@@ -69,27 +84,15 @@ export function ShadeSelector() {
size={22} size={22}
style={{ display: 'block', cursor: 'pointer' }} style={{ display: 'block', cursor: 'pointer' }}
/> />
} </Popover.Target>
styles={{ <Popover.Dropdown>
root: { <Stack spacing="xs">
marginRight: theme.spacing.xs, <Grid gutter="lg" columns={10}>
}, {primarySwatches}
body: { {secondarySwatches}
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, </Grid>
}, </Stack>
arrow: { </Popover.Dropdown>
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white,
},
}}
position="bottom"
placement="end"
withArrow
arrowSize={3}
>
<Group direction="column" spacing="xs">
<Group spacing="xs">{primarySwatches}</Group>
<Group spacing="xs">{secondarySwatches}</Group>
</Group>
</Popover> </Popover>
<Text>Shade</Text> <Text>Shade</Text>
</Group> </Group>

View File

@@ -1,9 +1,8 @@
import { Box, createStyles, Group, Header as Head } from '@mantine/core'; import { Box, createStyles, Group, Header as Head } from '@mantine/core';
import { useBooleanToggle } from '@mantine/hooks';
import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem'; import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem';
import DockerMenuButton from '../modules/docker/DockerModule'; import DockerMenuButton from '../../modules/docker/DockerModule';
import SearchBar from '../modules/search/SearchModule'; import SearchBar from '../../modules/search/SearchModule';
import { SettingsMenuButton } from '../Settings/SettingsMenu'; import { SettingsMenuButton } from '../Settings/SettingsMenu';
import { Logo } from './Logo'; import { Logo } from './Logo';
@@ -23,9 +22,7 @@ const useStyles = createStyles((theme) => ({
})); }));
export function Header(props: any) { export function Header(props: any) {
const [opened, toggleOpened] = useBooleanToggle(false);
const { classes, cx } = useStyles(); const { classes, cx } = useStyles();
const [hidden, toggleHidden] = useBooleanToggle(true);
return ( return (
<Head height="auto"> <Head height="auto">

View File

@@ -18,6 +18,7 @@ export default function Layout({ children, style }: any) {
return ( return (
<AppShell <AppShell
fixed={false}
header={<Header />} header={<Header />}
navbar={widgetPosition ? <Navbar /> : undefined} navbar={widgetPosition ? <Navbar /> : undefined}
aside={widgetPosition ? undefined : <Aside />} aside={widgetPosition ? undefined : <Aside />}

View File

@@ -1,16 +1,16 @@
import { Group } from '@mantine/core'; import { Stack } from '@mantine/core';
import { CalendarModule, DateModule, TotalDownloadsModule, WeatherModule } from '../modules'; import { CalendarModule, DateModule, TotalDownloadsModule, WeatherModule } from '../../modules';
import { DashdotModule } from '../modules/dash.'; import { DashdotModule } from '../../modules/dashdot';
import { ModuleWrapper } from '../modules/moduleWrapper'; import { ModuleWrapper } from '../../modules/moduleWrapper';
export default function Widgets(props: any) { export default function Widgets(props: any) {
return ( return (
<Group my="sm" grow direction="column" style={{ width: 300 }}> <Stack my="sm" style={{ width: 300 }}>
<ModuleWrapper module={CalendarModule} /> <ModuleWrapper module={CalendarModule} />
<ModuleWrapper module={TotalDownloadsModule} /> <ModuleWrapper module={TotalDownloadsModule} />
<ModuleWrapper module={WeatherModule} /> <ModuleWrapper module={WeatherModule} />
<ModuleWrapper module={DateModule} /> <ModuleWrapper module={DateModule} />
<ModuleWrapper module={DashdotModule} /> <ModuleWrapper module={DashdotModule} />
</Group> </Stack>
); );
} }

View File

@@ -1,193 +0,0 @@
import {
Image,
Group,
Title,
Badge,
Text,
ActionIcon,
Anchor,
ScrollArea,
createStyles,
} from '@mantine/core';
import { useMediaQuery } from '@mantine/hooks';
import { IconLink as Link } from '@tabler/icons';
import { useConfig } from '../../../tools/state';
import { serviceItem } from '../../../tools/types';
export interface IMedia {
overview: string;
imdbId?: any;
artist?: string;
title: string;
poster?: string;
genres: string[];
seasonNumber?: number;
episodeNumber?: number;
}
const useStyles = createStyles((theme) => ({
overview: {
[theme.fn.largerThan('sm')]: {
width: 400,
},
},
}));
export function MediaDisplay(props: { media: IMedia }) {
const { media }: { media: IMedia } = props;
const { classes, cx } = useStyles();
const phone = useMediaQuery('(min-width: 800px)');
return (
<Group position="apart">
<Text>
{media.poster && (
<Image
width={phone ? 250 : 100}
height={phone ? 400 : 160}
style={{
float: 'right',
}}
radius="md"
fit="cover"
src={media.poster}
alt={media.title}
/>
)}
<Group direction="column" style={{ minWidth: phone ? 450 : '65vw' }}>
<Group noWrap mr="sm" className={classes.overview}>
<Title order={3}>{media.title}</Title>
{media.imdbId && (
<Anchor href={`https://www.imdb.com/title/${media.imdbId}`} target="_blank">
<ActionIcon>
<Link />
</ActionIcon>
</Anchor>
)}
</Group>
{media.artist && (
<Text
style={{
textAlign: 'center',
color: 'gray',
}}
>
New release from {media.artist}
</Text>
)}
{media.episodeNumber && media.seasonNumber && (
<Text
style={{
textAlign: 'center',
color: 'gray',
}}
>
Season {media.seasonNumber} episode {media.episodeNumber}
</Text>
)}
</Group>
<Group direction="column" position="apart">
<ScrollArea style={{ height: 280, maxWidth: 700 }}>{media.overview}</ScrollArea>
<Group align="center" position="center" spacing="xs">
{media.genres.slice(-5).map((genre: string, i: number) => (
<Badge size="sm" key={i}>
{genre}
</Badge>
))}
</Group>
</Group>
</Text>
</Group>
);
}
export function ReadarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
const { config } = useConfig();
// Find lidarr in services
const readarr = config.services.find((service: serviceItem) => service.type === 'Readarr');
// Find a poster CoverType
const poster = media.images.find((image: any) => image.coverType === 'cover');
if (!readarr) {
return null;
}
const baseUrl = new URL(readarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = `${baseUrl}${poster.url}`;
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
title: media.title,
poster: fullLink,
artist: media.author.authorName,
overview: media.overview,
genres: media.genres,
}}
/>
);
}
export function LidarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
const { config } = useConfig();
// Find lidarr in services
const lidarr = config.services.find((service: serviceItem) => service.type === 'Lidarr');
// Find a poster CoverType
const poster = media.images.find((image: any) => image.coverType === 'cover');
if (!lidarr) {
return null;
}
const baseUrl = new URL(lidarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = poster ? `${baseUrl}${poster.url}` : undefined;
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
title: media.title,
poster: fullLink,
artist: media.artist.artistName,
overview: media.overview,
genres: media.genres,
}}
/>
);
}
export function RadarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
// Find a poster CoverType
const poster = media.images.find((image: any) => image.coverType === 'poster');
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
imdbId: media.imdbId,
title: media.title,
overview: media.overview,
poster: poster.url,
genres: media.genres,
}}
/>
);
}
export function SonarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
// Find a poster CoverType
const poster = media.series.images.find((image: any) => image.coverType === 'poster');
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
imdbId: media.series.imdbId,
title: media.series.title,
overview: media.series.overview,
poster: poster.url,
genres: media.series.genres,
seasonNumber: media.seasonNumber,
episodeNumber: media.episodeNumber,
}}
/>
);
}

View File

@@ -1,127 +0,0 @@
import { Kbd, createStyles, Autocomplete } from '@mantine/core';
import { useDebouncedValue, useForm, useHotkeys } from '@mantine/hooks';
import { useEffect, useRef, useState } from 'react';
import {
IconSearch as Search,
IconBrandYoutube as BrandYoutube,
IconDownload as Download,
} from '@tabler/icons';
import axios from 'axios';
import { useConfig } from '../../../tools/state';
import { IModule } from '../modules';
const useStyles = createStyles((theme) => ({
hide: {
[theme.fn.smallerThan('sm')]: {
display: 'none',
},
display: 'flex',
alignItems: 'center',
},
}));
export const SearchModule: IModule = {
title: 'Search Bar',
description: 'Show the current time and date in a card',
icon: Search,
component: SearchBar,
};
export default function SearchBar(props: any) {
const { config, setConfig } = useConfig();
const [opened, setOpened] = useState(false);
const [icon, setIcon] = useState(<Search />);
const queryUrl = config.settings.searchUrl ?? 'https://www.google.com/search?q=';
const textInput = useRef<HTMLInputElement>();
// Find a service with the type of 'Overseerr'
const form = useForm({
initialValues: {
query: '',
},
});
const [debounced, cancel] = useDebouncedValue(form.values.query, 250);
const [results, setResults] = useState<any[]>([]);
useEffect(() => {
if (form.values.query !== debounced || form.values.query === '') return;
axios
.get(`/api/modules/search?q=${form.values.query}`)
.then((res) => setResults(res.data ?? []));
}, [debounced]);
useHotkeys([['ctrl+K', () => textInput.current && textInput.current.focus()]]);
const { classes, cx } = useStyles();
const rightSection = (
<div className={classes.hide}>
<Kbd>Ctrl</Kbd>
<span style={{ margin: '0 5px' }}>+</span>
<Kbd>K</Kbd>
</div>
);
// If enabled modules doesn't contain the module, return null
// If module in enabled
const exists = config.modules?.[SearchModule.title]?.enabled ?? false;
if (!exists) {
return null;
}
const autocompleteData = results.map((result) => ({
label: result.phrase,
value: result.phrase,
}));
return (
<form
onChange={() => {
// If query contains !yt or !t add "Searching on YouTube" or "Searching torrent"
const query = form.values.query.trim();
const isYoutube = query.startsWith('!yt');
const isTorrent = query.startsWith('!t');
if (isYoutube) {
setIcon(<BrandYoutube size={22} />);
} else if (isTorrent) {
setIcon(<Download size={22} />);
} else {
setIcon(<Search size={22} />);
}
}}
onSubmit={form.onSubmit((values) => {
const query = values.query.trim();
const isYoutube = query.startsWith('!yt');
const isTorrent = query.startsWith('!t');
form.setValues({ query: '' });
setTimeout(() => {
if (isYoutube) {
window.open(`https://www.youtube.com/results?search_query=${query.substring(3)}`);
} else if (isTorrent) {
window.open(`https://bitsearch.to/search?q=${query.substring(3)}`);
} else {
window.open(
`${
queryUrl.includes('%s')
? queryUrl.replace('%s', values.query)
: queryUrl + values.query
}`
);
}
}, 20);
})}
>
<Autocomplete
autoFocus
variant="filled"
data={autocompleteData}
icon={icon}
ref={textInput}
rightSectionWidth={90}
rightSection={rightSection}
radius="md"
size="md"
styles={{ rightSection: { pointerEvents: 'none' } }}
placeholder="Search the web..."
{...props}
{...form.getInputProps('query')}
/>
</form>
);
}

View File

@@ -1,59 +0,0 @@
import { Center, Group, RingProgress, Title, useMantineTheme } from '@mantine/core';
import { IconCpu } from '@tabler/icons';
import { useEffect, useState } from 'react';
import axios from 'axios';
import si from 'systeminformation';
import { useListState } from '@mantine/hooks';
import { IModule } from '../modules';
import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval';
export const SystemModule: IModule = {
title: 'System info',
description: 'Show the current CPU usage and memory usage',
icon: IconCpu,
component: SystemInfo,
};
interface ApiResponse {
cpu: si.Systeminformation.CpuData;
os: si.Systeminformation.OsData;
memory: si.Systeminformation.MemData;
load: si.Systeminformation.CurrentLoadData;
}
export default function SystemInfo(args: any) {
const [data, setData] = useState<ApiResponse>();
const setSafeInterval = useSetSafeInterval();
// Refresh data every second
useEffect(() => {
setSafeInterval(() => {
axios.get('/api/modules/systeminfo').then((res) => setData(res.data));
}, 1000);
}, []);
// Update data every time data changes
const [cpuLoadHistory, cpuLoadHistoryHandlers] =
useListState<si.Systeminformation.CurrentLoadData>([]);
// useEffect(() => {
// }, [data]);
const theme = useMantineTheme();
const currentLoad = data?.load?.currentLoad ?? 0;
return (
<Center>
<Group p="sm" direction="column" align="center">
<Title order={3}>Current CPU load</Title>
<RingProgress
size={150}
label={<Center>{`${currentLoad.toFixed(2)}%`}</Center>}
thickness={15}
roundCaps
sections={[{ value: currentLoad ?? 0, color: 'cyan' }]}
/>
</Group>
</Center>
);
}

View File

@@ -1 +0,0 @@
export { SystemModule } from './SystemModule';

View File

@@ -1,15 +0,0 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
// eslint-disable-next-line consistent-return
export function middleware(request: NextRequest) {
const cookie = request.cookies.get('password');
const isPasswordCorrect = cookie === process.env.PASSWORD;
if (
!isPasswordCorrect &&
request.nextUrl.pathname !== '/login' &&
request.nextUrl.pathname !== '/api/configs/trylogin'
) {
return NextResponse.rewrite(new URL('/login', request.url));
}
}

View File

@@ -12,16 +12,17 @@ import React, { useEffect, useState } from 'react';
import { Calendar } from '@mantine/dates'; import { Calendar } from '@mantine/dates';
import { IconCalendar as CalendarIcon } from '@tabler/icons'; import { IconCalendar as CalendarIcon } from '@tabler/icons';
import axios from 'axios'; import axios from 'axios';
import { useConfig } from '../../../tools/state'; import { useDisclosure } from '@mantine/hooks';
import { IModule } from '../modules'; import { useConfig } from '../../tools/state';
import { IModule } from '../ModuleTypes';
import { import {
SonarrMediaDisplay, SonarrMediaDisplay,
RadarrMediaDisplay, RadarrMediaDisplay,
LidarrMediaDisplay, LidarrMediaDisplay,
ReadarrMediaDisplay, ReadarrMediaDisplay,
} from '../common'; } from '../common';
import { serviceItem } from '../../../tools/types'; import { serviceItem } from '../../tools/types';
import { useColorTheme } from '../../../tools/color'; import { useColorTheme } from '../../tools/color';
export const CalendarModule: IModule = { export const CalendarModule: IModule = {
title: 'Calendar', title: 'Calendar',
@@ -170,7 +171,7 @@ function DayComponent(props: any) {
readarrmedias, readarrmedias,
}: { renderdate: Date; sonarrmedias: []; radarrmedias: []; lidarrmedias: []; readarrmedias: [] } = }: { renderdate: Date; sonarrmedias: []; radarrmedias: []; lidarrmedias: []; readarrmedias: [] } =
props; props;
const [opened, setOpened] = useState(false); const [opened, { close, open }] = useDisclosure(false);
const day = renderdate.getDate(); const day = renderdate.getDate();
@@ -191,124 +192,129 @@ function DayComponent(props: any) {
const date = new Date(media.inCinemas); const date = new Date(media.inCinemas);
return date.toDateString() === renderdate.toDateString(); return date.toDateString() === renderdate.toDateString();
}); });
if ( const totalFiltered = [
sonarrFiltered.length === 0 && ...readarrFiltered,
radarrFiltered.length === 0 && ...lidarrFiltered,
lidarrFiltered.length === 0 && ...sonarrFiltered,
readarrFiltered.length === 0 ...radarrFiltered,
) { ];
if (totalFiltered.length === 0) {
return <div>{day}</div>; return <div>{day}</div>;
} }
return ( return (
<Box <Popover
onClick={() => { position="bottom"
setOpened(true); withArrow
}} withinPortal
radius="lg"
shadow="sm"
transition="pop"
onClose={close}
opened={opened}
> >
{readarrFiltered.length > 0 && ( <Popover.Target>
<Indicator <Box onClick={open}>
size={10} {readarrFiltered.length > 0 && (
withBorder <Indicator
size={10}
withBorder
style={{
position: 'absolute',
bottom: 8,
left: 8,
}}
color="red"
children={null}
/>
)}
{radarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
top: 8,
left: 8,
}}
color="yellow"
children={null}
/>
)}
{sonarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
top: 8,
right: 8,
}}
color="blue"
children={null}
/>
)}
{lidarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
bottom: 8,
right: 8,
}}
color="green"
children={undefined}
/>
)}
<div>{day}</div>
</Box>
</Popover.Target>
<Popover.Dropdown>
<ScrollArea
offsetScrollbars
scrollbarSize={5}
style={{ style={{
position: 'absolute', height:
bottom: 8, totalFiltered.slice(0, 2).length > 1 ? totalFiltered.slice(0, 2).length * 150 : 200,
left: 8, width: 400,
}} }}
color="red" >
children={null}
/>
)}
{radarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
top: 8,
left: 8,
}}
color="yellow"
children={null}
/>
)}
{sonarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
top: 8,
right: 8,
}}
color="blue"
children={null}
/>
)}
{lidarrFiltered.length > 0 && (
<Indicator
size={10}
withBorder
style={{
position: 'absolute',
bottom: 8,
right: 8,
}}
color="green"
children={undefined}
/>
)}
<Popover
position="bottom"
radius="lg"
shadow="xl"
transition="pop"
styles={{
body: {
boxShadow: '0 0 14px 14px rgba(0, 0, 0, 0.1), 0 14px 11px rgba(0, 0, 0, 0.1)',
},
}}
width="auto"
onClose={() => setOpened(false)}
opened={opened}
target={day}
>
<ScrollArea style={{ height: 400 }}>
{sonarrFiltered.map((media: any, index: number) => ( {sonarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}> <React.Fragment key={index}>
<SonarrMediaDisplay media={media} /> <SonarrMediaDisplay media={media} />
{index < sonarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />} {index < sonarrFiltered.length - 1 && <Divider variant="dashed" size="sm" my="xl" />}
</React.Fragment> </React.Fragment>
))} ))}
{radarrFiltered.length > 0 && sonarrFiltered.length > 0 && ( {radarrFiltered.length > 0 && sonarrFiltered.length > 0 && (
<Divider variant="dashed" my="xl" /> <Divider variant="dashed" size="sm" my="xl" />
)} )}
{radarrFiltered.map((media: any, index: number) => ( {radarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}> <React.Fragment key={index}>
<RadarrMediaDisplay media={media} /> <RadarrMediaDisplay media={media} />
{index < radarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />} {index < radarrFiltered.length - 1 && <Divider variant="dashed" size="sm" my="xl" />}
</React.Fragment> </React.Fragment>
))} ))}
{sonarrFiltered.length > 0 && lidarrFiltered.length > 0 && ( {sonarrFiltered.length > 0 && lidarrFiltered.length > 0 && (
<Divider variant="dashed" my="xl" /> <Divider variant="dashed" size="sm" my="xl" />
)} )}
{lidarrFiltered.map((media: any, index: number) => ( {lidarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}> <React.Fragment key={index}>
<LidarrMediaDisplay media={media} /> <LidarrMediaDisplay media={media} />
{index < lidarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />} {index < lidarrFiltered.length - 1 && <Divider variant="dashed" size="sm" my="xl" />}
</React.Fragment> </React.Fragment>
))} ))}
{lidarrFiltered.length > 0 && readarrFiltered.length > 0 && ( {lidarrFiltered.length > 0 && readarrFiltered.length > 0 && (
<Divider variant="dashed" my="xl" /> <Divider variant="dashed" size="sm" my="xl" />
)} )}
{readarrFiltered.map((media: any, index: number) => ( {readarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}> <React.Fragment key={index}>
<ReadarrMediaDisplay media={media} /> <ReadarrMediaDisplay media={media} />
{index < readarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />} {index < readarrFiltered.length - 1 && <Divider variant="dashed" size="sm" my="xl" />}
</React.Fragment> </React.Fragment>
))} ))}
</ScrollArea> </ScrollArea>
</Popover> </Popover.Dropdown>
</Box> </Popover>
); );
} }

View File

@@ -0,0 +1,260 @@
import { Badge, Button, Group, Image, Stack, Text, Title } from '@mantine/core';
import { IconDownload, IconExternalLink, IconPlayerPlay } from '@tabler/icons';
import { useState } from 'react';
import { useColorTheme } from '../../tools/color';
import { useConfig } from '../../tools/state';
import { serviceItem } from '../../tools/types';
import { RequestModal } from '../overseerr/RequestModal';
import { Result } from '../overseerr/SearchResult';
export interface IMedia {
overview: string;
imdbId?: any;
tmdbId?: any;
artist?: string;
title?: string;
type: 'movie' | 'tvshow' | 'book' | 'music' | 'overseer';
episodetitle?: string;
voteAverage?: string;
poster?: string;
genres: string[];
seasonNumber?: number;
plexUrl?: string;
episodeNumber?: number;
[key: string]: any;
}
export function OverseerrMediaDisplay(props: any) {
const { media }: { media: Result } = props;
const { config } = useConfig();
const service = config.services.find(
(service) => service.type === 'Overseerr' || service.type === 'Jellyseerr'
);
return (
<MediaDisplay
media={{
...media,
genres: [],
overview: media.overview ?? '',
title: media.title ?? media.name ?? media.originalName,
poster: `https://image.tmdb.org/t/p/w600_and_h900_bestv2/${media.posterPath}`,
seasonNumber: media.mediaInfo?.seasons.length,
episodetitle: media.title,
plexUrl: media.mediaInfo?.plexUrl ?? media.mediaInfo?.mediaUrl,
voteAverage: media.voteAverage?.toString(),
overseerrResult: media,
overseerrId: `${service?.openedUrl ? service?.openedUrl : service?.url}/${
media.mediaType
}/${media.id}`,
type: 'overseer',
}}
/>
);
}
export function ReadarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
const { config } = useConfig();
// Find lidarr in services
const readarr = config.services.find((service: serviceItem) => service.type === 'Readarr');
// Find a poster CoverType
const poster = media.images.find((image: any) => image.coverType === 'cover');
if (!readarr) {
return null;
}
const baseUrl = readarr.openedUrl
? new URL(readarr.openedUrl).origin
: new URL(readarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = poster ? `${baseUrl}${poster.url}` : undefined;
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
...media,
title: media.title,
poster: fullLink,
artist: media.authorTitle,
overview: `new book release by ${media.authorTitle}`,
genres: media.genres ?? [],
voteAverage: media.ratings.value.toString(),
type: 'book',
}}
/>
);
}
export function LidarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
const { config } = useConfig();
// Find lidarr in services
const lidarr = config.services.find((service: serviceItem) => service.type === 'Lidarr');
// Find a poster CoverType
const poster = media.images.find((image: any) => image.coverType === 'cover');
if (!lidarr) {
return null;
}
const baseUrl = lidarr.openedUrl ? new URL(lidarr.openedUrl).origin : new URL(lidarr.url).origin;
// Remove '/' from the end of the lidarr url
const fullLink = poster ? `${baseUrl}${poster.url}` : undefined;
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
type: 'music',
title: media.title,
poster: fullLink,
artist: media.artist.artistName,
overview: media.overview,
genres: media.genres,
}}
/>
);
}
export function RadarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
// Find a poster CoverType
return (
<MediaDisplay
media={{
...media,
title: media.title ?? media.originalTitle,
overview: media.overview ?? '',
genres: media.genres ?? [],
poster: media.images.find((image: any) => image.coverType === 'poster')?.url,
voteAverage: media.ratings.tmdb.value.toString(),
imdbId: media.imdbId,
type: 'movie',
}}
/>
);
}
export function SonarrMediaDisplay(props: any) {
const { media }: { media: any } = props;
// Find a poster CoverType
const poster = media.series.images.find((image: any) => image.coverType === 'poster');
// Return a movie poster containting the title and the description
return (
<MediaDisplay
media={{
...media,
genres: media.series.genres ?? [],
overview: media.overview ?? media.series.overview ?? '',
title: media.series.title,
poster: poster ? poster.url : undefined,
episodeNumber: media.episodeNumber,
seasonNumber: media.seasonNumber,
episodetitle: media.title,
imdbId: media.series.imdbId,
voteAverage: media.series.ratings.value.toString(),
type: 'tvshow',
}}
/>
);
}
export function MediaDisplay({ media }: { media: IMedia }) {
const [opened, setOpened] = useState(false);
const { secondaryColor } = useColorTheme();
return (
<Group mr="xs" align="stretch" noWrap style={{ maxHeight: 200 }}>
<Image src={media.poster} height={200} width={150} radius="md" fit="cover" />
<Stack justify="space-around">
<Stack spacing="sm">
<Text lineClamp={2}>
<Title order={5}>{media.title}</Title>
</Text>
<Group spacing="xs">
{media.type === 'tvshow' && (
<Badge variant="dot" size="xs" radius="md" color="blue">
s{media.seasonNumber}e{media.episodeNumber} - {media.episodetitle}
</Badge>
)}
{media.type === 'music' && (
<Badge variant="dot" size="xs" radius="md" color="green">
{media.artist}
</Badge>
)}
{media.type === 'movie' && (
<Badge variant="dot" size="xs" radius="md" color="orange">
Radarr
</Badge>
)}
{media.type === 'book' && (
<Badge variant="dot" size="xs" radius="md" color="red">
Readarr
</Badge>
)}
{media.genres.slice(0, 2).map((genre) => (
<Badge size="xs" radius="md" key={genre}>
{genre}
</Badge>
))}
</Group>
<Text color="dimmed" size="xs" lineClamp={4}>
{media.overview}
</Text>
</Stack>
<Group noWrap>
{media.plexUrl && (
<Button
component="a"
target="_blank"
variant="outline"
href={media.plexUrl}
size="sm"
rightIcon={<IconPlayerPlay size={15} />}
>
Play
</Button>
)}
{media.imdbId && (
<Button
component="a"
target="_blank"
href={`https://www.imdb.com/title/${media.imdbId}`}
variant="outline"
size="sm"
rightIcon={<IconExternalLink size={15} />}
>
IMDb
</Button>
)}
{media.overseerrId && (
<Button
component="a"
target="_blank"
href={media.overseerrId}
variant="outline"
size="sm"
rightIcon={<IconExternalLink size={15} />}
>
TMDb
</Button>
)}
{media.type === 'overseer' && !media.overseerrResult?.mediaInfo?.mediaAddedAt && (
<>
<RequestModal
base={media.overseerrResult as Result}
opened={opened}
setOpened={setOpened}
/>
<Button
onClick={() => setOpened(true)}
color={secondaryColor}
size="sm"
rightIcon={<IconDownload size={15} />}
>
Request
</Button>
</>
)}
</Group>
</Stack>
</Group>
);
}

View File

@@ -0,0 +1,57 @@
{
"title": "Mika in Real Life",
"authorTitle": "jean, emiko Mika in Real Life",
"seriesTitle": "",
"disambiguation": "",
"authorId": 1,
"foreignBookId": "93584169",
"titleSlug": "93584169",
"monitored": true,
"anyEditionOk": false,
"ratings": {
"votes": 149,
"value": 4.15,
"popularity": 618.35
},
"releaseDate": "2022-08-09T00:00:00Z",
"pageCount": 384,
"genres": [
"fiction",
"romance",
"contemporary",
"adult",
"adult-fiction",
"chick-lit",
"womens-fiction",
"asian-literature",
"family",
"lgbt"
],
"images": [
{
"url": "/MediaCover/Books/1/cover.jpg?lastWrite=637899714580000000",
"coverType": "cover",
"extension": ".jpg"
}
],
"links": [
{
"url": "https://www.goodreads.com/work/editions/93584169",
"name": "Goodreads Editions"
},
{
"url": "https://www.goodreads.com/book/show/59430548-mika-in-real-life",
"name": "Goodreads Book"
}
],
"statistics": {
"bookFileCount": 0,
"bookCount": 0,
"totalBookCount": 1,
"sizeOnDisk": 0,
"percentOfBooks": 0
},
"added": "2022-08-07T20:48:09Z",
"grabbed": false,
"id": 1
}

View File

@@ -0,0 +1,70 @@
{
"title": "The Tunnel to Summer, the Exit of Goodbyes",
"originalTitle": "夏へのトンネル、さよならの出口",
"originalLanguage": {
"id": 8,
"name": "Japanese"
},
"alternateTitles": [
{
"sourceType": "tmdb",
"movieId": 1,
"title": "Natsu e no Tunnel, Sayonara no Deguchi",
"sourceId": 0,
"votes": 0,
"voteCount": 0,
"language": {
"id": 1,
"name": "English"
},
"id": 1
}
],
"secondaryYearSourceId": 0,
"sortTitle": "tunnel to summer exit goodbyes",
"sizeOnDisk": 0,
"status": "announced",
"overview": "Tono Kaoru heard a rumor: The laws of space and time mean nothing to the Urashima Tunnel. If you find it, walk through and you'll find your heart's desire on the other side...in exchange for years of your own life. On the night Kaoru just so happens to find himself standing in front of a tunnel that looks suspiciously like the one the rumor describes, he finds himself thinking of Karen, the sister he lost in an accident five years ago. To Kaoru's surprise, he's been followed by the new transfer student Anzu Hanaki, who promises to help him experiment with the mysterious tunnel--but what does she want from Kaoru in exchange? And what will he have left to give, after the tunnel's done with him?",
"inCinemas": "2022-09-09T00:00:00Z",
"images": [
{
"coverType": "poster",
"url": "https://image.tmdb.org/t/p/original/3x5gc6dHsfNqZryipu159IALEPH.jpg"
},
{
"coverType": "fanart",
"url": "https://image.tmdb.org/t/p/original/zO3QSYs858SqiapafD7iJp17KVD.jpg"
}
],
"website": "https://natsuton.com/",
"year": 2022,
"hasFile": false,
"youTubeTrailerId": "",
"studio": "Pony Canyon",
"path": "/data/Library/Movies/The Tunnel to Summer, the Exit of Goodbyes (2022)",
"qualityProfileId": 4,
"monitored": true,
"minimumAvailability": "announced",
"isAvailable": true,
"folderName": "/data/Library/Movies/The Tunnel to Summer, the Exit of Goodbyes (2022)",
"runtime": 0,
"cleanTitle": "thetunneltosummerexitgoodbyes",
"imdbId": "tt17382524",
"tmdbId": 916192,
"titleSlug": "916192",
"genres": [
"Animation",
"Drama",
"Mystery"
],
"tags": [],
"added": "2022-07-05T07:50:42Z",
"ratings": {
"tmdb": {
"votes": 0,
"value": 0,
"type": "user"
}
},
"id": 1
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,409 @@
{
"page": 1,
"totalPages": 2,
"totalResults": 21,
"results": [
{
"id": 66025,
"firstAirDate": "2016-06-14",
"genreIds": [
80,
18
],
"mediaType": "tv",
"name": "Animal Kingdom",
"originCountry": [
"US"
],
"originalLanguage": "en",
"originalName": "Animal Kingdom",
"overview": "Un jeune homme de dix-sept ans emménage avec la famille Cody après le décès de sa mère, une fratrie baignant dans la criminalité gouvernée d'une main de maître par la matriarche, Smurf.",
"popularity": 75.653,
"voteAverage": 7.7,
"voteCount": 318,
"backdropPath": "/eQJwfyMqSra10ck8HOoiCrbQR32.jpg",
"posterPath": "/rzvdKrnSRKPFI0pgqMQknDPpRC9.jpg",
"mediaInfo": {
"downloadStatus": [],
"downloadStatus4k": [],
"id": 217,
"mediaType": "tv",
"tmdbId": 66025,
"tvdbId": 304262,
"imdbId": null,
"status": 3,
"status4k": 1,
"createdAt": "2022-08-08T11:06:20.000Z",
"updatedAt": "2022-08-08T11:06:23.000Z",
"lastSeasonChange": "2022-08-08T11:06:20.000Z",
"mediaAddedAt": null,
"serviceId": 0,
"serviceId4k": null,
"externalServiceId": 56,
"externalServiceId4k": null,
"externalServiceSlug": "animal-kingdom-2016",
"externalServiceSlug4k": null,
"ratingKey": null,
"ratingKey4k": null,
"seasons": [],
"serviceUrl": "http://sonarr:8989/series/animal-kingdom-2016"
}
},
{
"id": 44629,
"mediaType": "movie",
"adult": false,
"genreIds": [
18,
53,
80,
9648
],
"originalLanguage": "en",
"originalTitle": "Animal Kingdom",
"overview": "Une rue anonyme dans la banlieue de Melbourne. Cest là que vit la famille Cody. Profession: criminels. Lirruption parmi eux de Joshua, un neveu éloigné, offre à la police le moyen de les infiltrer. Il ne reste plus à Joshua quà choisir son camp...",
"popularity": 11.839,
"releaseDate": "2010-06-03",
"title": "Animal Kingdom",
"video": false,
"voteAverage": 6.8,
"voteCount": 643,
"backdropPath": "/dxOv6K3LNbZfQaGDyx7Tp94Koy.jpg",
"posterPath": "/qrVjc5JcaujL58SMMW9lqrp3bBX.jpg"
},
{
"id": 95731,
"firstAirDate": "2020-09-25",
"genreIds": [
99
],
"mediaType": "tv",
"name": "Au cœur de Disney's Animal Kingdom",
"originCountry": [],
"originalLanguage": "en",
"originalName": "Magic of Disney's Animal Kingdom",
"overview": "Au cœur dAnimal Kingdom narrée par Josh Gad, une célébrité parmi les fans de Disney, nous emmène en coulisses découvrir la magie de deux des animations animalières les plus visitées au monde : le parc à thème de Disney, Animal Kingdom, et The Seas with Nemo & Friends à Epcot. Les spectateurs sapprochent au plus près de créatures parmi les plus rares et les plus belles de la planète et rencontrent les experts en soins animaliers qui ont tissé des liens stupéfiants avec les 5 000 et plus animaux du parc. Chacun des huit épisodes plonge au cœur de lendroit le plus magique sur Terre, dévoilant les multiples facettes de sa conception et de sa gestion.",
"popularity": 3.367,
"voteAverage": 8,
"voteCount": 4,
"backdropPath": "/gMTMnd54VVAbGiodBqMTGCjM3b2.jpg",
"posterPath": "/gvNTeRAfu4KN3dD5HUO4Nbnri07.jpg"
},
{
"id": 120862,
"mediaType": "movie",
"adult": false,
"genreIds": [
35,
18,
10749
],
"originalLanguage": "en",
"originalTitle": "The Animal Kingdom",
"overview": "Tom Collier, jeune éditeur, a entretenu une liaison passionnée et intellectuelle avec une dessinatrice, Daisy Sage. Celle-ci ayant mis un terme à leur relation, il a fait la connaissance de Cecilia, qu'il a rapidement décidé d'épouser. Alors que les fiançailles sont annoncées, Daisy, toujours amoureuse, fait son retour, mais trop tard. Le mariage a lieu. Sous l'influence de Cecilia, Tom Collier, qui était un éditeur intègre et exigeant, fait de plus en plus de concessions commerciales. Daisy, elle demeure fidèle à elle-même. Tom Collier, se retrouve a évoluer, par amour pour sa femme, dans un milieu de conventions bourgeoises qui ne l'intéressent pas.",
"popularity": 2.102,
"releaseDate": "1932-12-28",
"title": "The Animal Kingdom",
"video": false,
"voteAverage": 6.3,
"voteCount": 13,
"backdropPath": "/5P1Hx46wvCVx9D9yT8M5rdUIHZB.jpg",
"posterPath": "/3sLWwNvS77xynAGLkbiHVXlO3UH.jpg"
},
{
"id": 311015,
"mediaType": "movie",
"adult": false,
"genreIds": [
99
],
"originalLanguage": "en",
"originalTitle": "Disney Parks: Disney's Animal Kingdom",
"overview": "",
"popularity": 1.208,
"releaseDate": "2010-01-01",
"title": "Disney Parks: Disney's Animal Kingdom",
"video": true,
"voteAverage": 9,
"voteCount": 2,
"backdropPath": null,
"posterPath": "/93OEKY5vnKqGFbOyHtUAdcEz8NV.jpg"
},
{
"id": 291774,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Kenya 3D: Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "2013-03-08",
"title": "Kenya 3D: Animal Kingdom",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": null
},
{
"id": 640253,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "it",
"originalTitle": "Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "2016-11-12",
"title": "Animal Kingdom",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": "/vJFK5cCcIh4X4op0oeK5iY2ibPv.jpg"
},
{
"id": 507434,
"mediaType": "movie",
"adult": false,
"genreIds": [
27
],
"originalLanguage": "en",
"originalTitle": "Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "2017-02-25",
"title": "Animal Kingdom",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": "/8QxSJRLLw2m8ymrFsC2xJ26yd1n.jpg",
"posterPath": "/s77Q92boNGgkT2J5se3gwq5N8Xp.jpg"
},
{
"id": 775877,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Disney's Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "2004-05-12",
"title": "Disney's Animal Kingdom",
"video": true,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": null
},
{
"id": 318575,
"mediaType": "movie",
"adult": false,
"genreIds": [
99
],
"originalLanguage": "en",
"originalTitle": "Nature: Love in the Animal Kingdom",
"overview": "",
"popularity": 0.655,
"releaseDate": "2013-11-06",
"title": "Nature: Love in the Animal Kingdom",
"video": true,
"voteAverage": 9.5,
"voteCount": 2,
"backdropPath": "/vx2dfrXPTn0dKoyIqCEgrGvzwkd.jpg",
"posterPath": "/1fd53UCxtLAItNI5jMtVetFuw6v.jpg"
},
{
"id": 743266,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Animal Kingdom: Great Are Thy Works",
"overview": "",
"popularity": 0.6,
"releaseDate": "1993-01-01",
"title": "Animal Kingdom: Great Are Thy Works",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": "/vjnsGLvymjG7dAIbjwzgFCdbhl6.jpg"
},
{
"id": 828152,
"mediaType": "movie",
"adult": false,
"genreIds": [
99
],
"originalLanguage": "en",
"originalTitle": "Disney's Animal Kingdom: Alive with Magic",
"overview": "",
"popularity": 0.6,
"releaseDate": "2017-06-27",
"title": "Disney's Animal Kingdom: Alive with Magic",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": "/amzVT8T9Ju3KLCDnBq4Rhf3LO8j.jpg"
},
{
"id": 280391,
"mediaType": "movie",
"adult": false,
"genreIds": [
12,
35,
16
],
"originalLanguage": "fr",
"originalTitle": "Pourquoi j'ai pas mangé mon père",
"overview": "Lhistoire trépidante dÉdouard, fils aîné du roi des simiens, qui, considéré à sa naissance comme trop malingre, est rejeté par sa tribu. Il grandit loin deux, auprès de son ami Ian, et, incroyablement ingénieux, il découvre le feu, la chasse, lhabitat moderne, lamour et même… lespoir. Généreux, il veut tout partager, révolutionne lordre établi, et mène son peuple avec éclat et humour vers la véritable humanité… celle où on ne mange pas son père.",
"popularity": 12.971,
"releaseDate": "2015-04-08",
"title": "Pourquoi j'ai pas mangé mon père",
"video": false,
"voteAverage": 5.3,
"voteCount": 303,
"backdropPath": "/msDLrSt7Ozpe6oOg4XJrsQJd2IE.jpg",
"posterPath": "/efpzs2g1uRNcP8wPbIKSRPPH0aC.jpg"
},
{
"id": 775559,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "A New species of Theme Park: Disneys Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "1998-04-14",
"title": "A New species of Theme Park: Disneys Animal Kingdom",
"video": true,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": null
},
{
"id": 775831,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "en",
"originalTitle": "Disney Animal Kingdom Villas: A Village Comes to Life",
"overview": "",
"popularity": 0.6,
"releaseDate": "2007-06-14",
"title": "Disney Animal Kingdom Villas: A Village Comes to Life",
"video": true,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": null
},
{
"id": 432906,
"mediaType": "movie",
"adult": false,
"genreIds": [
99
],
"originalLanguage": "en",
"originalTitle": "Out in Nature: Homosexual Behaviour in the Animal Kingdom",
"overview": "",
"popularity": 0.6,
"releaseDate": "2001-09-07",
"title": "Out in Nature: Homosexual Behaviour in the Animal Kingdom",
"video": false,
"voteAverage": 6.8,
"voteCount": 4,
"backdropPath": null,
"posterPath": "/jjxhR9ZxZ3vhauK8IDR6wIBlCLI.jpg"
},
{
"id": 128887,
"mediaType": "movie",
"adult": false,
"genreIds": [
16,
35
],
"originalLanguage": "ja",
"originalTitle": "クレヨンしんちゃん オタケべ!カスカベ野生王国",
"overview": "",
"popularity": 5.365,
"releaseDate": "2009-04-18",
"title": "クレヨンしんちゃん オタケべ!カスカベ野生王国",
"video": false,
"voteAverage": 8.5,
"voteCount": 10,
"backdropPath": "/azvwXB25Wvbx2Cou3Th7lbnjrqP.jpg",
"posterPath": "/h7LipCtdCyBOKR1By5wSP2Ufy3c.jpg"
},
{
"id": 579733,
"mediaType": "movie",
"adult": false,
"genreIds": [],
"originalLanguage": "no",
"originalTitle": "Dyreriket",
"overview": "",
"popularity": 0.6,
"releaseDate": "2018-05-01",
"title": "Dyreriket",
"video": false,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": null,
"posterPath": null
},
{
"id": 111612,
"firstAirDate": "2018-10-12",
"genreIds": [
10764
],
"mediaType": "tv",
"name": "坂上どうぶつ王国",
"originCountry": [
"JP"
],
"originalLanguage": "ja",
"originalName": "坂上どうぶつ王国",
"overview": "",
"popularity": 1.186,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": "/op8bK5R76L9QpwcVTnYG7nKXKsU.jpg",
"posterPath": "/2VPq9RYaDohOT8YqTibKZMMT2Ue.jpg"
},
{
"id": 156216,
"firstAirDate": "2022-01-17",
"genreIds": [
16
],
"mediaType": "tv",
"name": "动物王国的故事",
"originCountry": [
"CN"
],
"originalLanguage": "zh",
"originalName": "动物王国的故事",
"overview": "",
"popularity": 0.6,
"voteAverage": 0,
"voteCount": 0,
"backdropPath": "/uxIJQnjzIQn2MGHk17nNhoIEkxU.jpg",
"posterPath": "/v90bqYZRUT30n22DdwahmW18LFn.jpg"
}
]
}

View File

@@ -0,0 +1,832 @@
{
"title": "Celebrate",
"disambiguation": "",
"overview": "",
"artistId": 9,
"foreignAlbumId": "bfedab35-92b7-449b-adf0-875439ec9a85",
"monitored": true,
"anyReleaseOk": true,
"profileId": 1,
"duration": 1818062,
"albumType": "Album",
"secondaryTypes": [],
"mediumCount": 1,
"ratings": {
"votes": 1,
"value": 10
},
"releaseDate": "2022-07-27T00:00:00Z",
"releases": [
{
"id": 202,
"albumId": 32,
"foreignReleaseId": "22bd49a1-f858-427d-94ee-1788b54fb508",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "ONCE JAPAN限定盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 203,
"albumId": 32,
"foreignReleaseId": "52c73f5f-4f91-451b-96d1-3ac3ef9371ee",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "初回限定盤B",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 204,
"albumId": 32,
"foreignReleaseId": "5745040b-a5fa-4dae-ad31-0bce9d501e23",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "JEONGYEON盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 205,
"albumId": 32,
"foreignReleaseId": "006f9135-454b-4182-a057-47d1b002a282",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "NAYEON盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 206,
"albumId": 32,
"foreignReleaseId": "eeacd54b-a2bd-48f8-8d7c-3ab55b68f17c",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 81,
"media": [
{
"mediumNumber": 1,
"mediumName": "NAYEON盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 2,
"mediumName": "JEONGYEON盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 3,
"mediumName": "MOMO盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 4,
"mediumName": "SANA盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 5,
"mediumName": "JIHYO盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 6,
"mediumName": "MINA盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 7,
"mediumName": "DAHYUN盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 8,
"mediumName": "CHAEYOUNG盤",
"mediumFormat": "CD"
},
{
"mediumNumber": 9,
"mediumName": "TZUYU盤",
"mediumFormat": "CD"
}
],
"mediumCount": 9,
"disambiguation": "5th Anniversary Collection BOX",
"country": [
"Japan"
],
"label": [
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan",
"Warner Music Japan"
],
"format": "9xCD",
"monitored": false
},
{
"id": 207,
"albumId": 32,
"foreignReleaseId": "8ddd43f0-859e-4cff-be7c-daf6806cc035",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "JIHYO盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 208,
"albumId": 32,
"foreignReleaseId": "ad8e0553-97de-499b-8010-85bd02c62859",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "TZUYU盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 209,
"albumId": 32,
"foreignReleaseId": "276bf831-8cae-49a0-bc50-479869d401ac",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "MOMO盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 210,
"albumId": 32,
"foreignReleaseId": "3d201058-deb0-4159-a82f-d9076a608036",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "MINA盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 211,
"albumId": 32,
"foreignReleaseId": "e1fbf96d-f83e-478c-be7d-f0f6dd5305d1",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "DAHYUN盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 212,
"albumId": 32,
"foreignReleaseId": "769a7006-763b-4cd8-8d1f-d389d52ec002",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "CHAEYOUNG盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 213,
"albumId": 32,
"foreignReleaseId": "42e74581-0ef3-4db9-8a20-ba8a3daa1cf0",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "初回限定盤A",
"country": [
"Japan"
],
"label": [
"Warner Music Japan",
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 214,
"albumId": 32,
"foreignReleaseId": "81bdf07f-61ad-4436-bfae-63cd1d9e700c",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "通常盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 215,
"albumId": 32,
"foreignReleaseId": "273b3ba1-88e8-4653-a542-c8b0489c1772",
"title": "Celebrate",
"status": "Official",
"duration": 0,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "CD"
}
],
"mediumCount": 1,
"disambiguation": "SANA盤",
"country": [
"Japan"
],
"label": [
"Warner Music Japan"
],
"format": "CD",
"monitored": false
},
{
"id": 216,
"albumId": 32,
"foreignReleaseId": "2442df5f-4090-452c-be7f-5885dffee8e2",
"title": "Celebrate",
"status": "Official",
"duration": 1818062,
"trackCount": 9,
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "Digital Media"
}
],
"mediumCount": 1,
"disambiguation": "",
"country": [
"Algeria",
"Angola",
"Anguilla",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Australia",
"Austria",
"Azerbaijan",
"Bahamas",
"Bahrain",
"Barbados",
"Belgium",
"Belize",
"Benin",
"Bermuda",
"Bhutan",
"Bolivia",
"Bosnia and Herzegovina",
"Botswana",
"Brazil",
"Brunei",
"Bulgaria",
"Burkina Faso",
"Cambodia",
"Cameroon",
"Canada",
"Cape Verde",
"Cayman Islands",
"Chad",
"Chile",
"China",
"Colombia",
"Congo",
"Costa Rica",
"Côte d'Ivoire",
"Croatia",
"Cyprus",
"Czech Republic",
"Denmark",
"Dominica",
"Dominican Republic",
"Ecuador",
"Egypt",
"El Salvador",
"Estonia",
"Fiji",
"Finland",
"France",
"Gabon",
"Gambia",
"Georgia",
"Germany",
"Ghana",
"Greece",
"Grenada",
"Guatemala",
"Guinea-Bissau",
"Guyana",
"Honduras",
"Hong Kong",
"Hungary",
"Iceland",
"India",
"Indonesia",
"Iraq",
"Ireland",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Jordan",
"Kazakhstan",
"Kenya",
"Kuwait",
"Kyrgyzstan",
"Laos",
"Latvia",
"Lebanon",
"Liberia",
"Libya",
"Lithuania",
"Luxembourg",
"Macao",
"North Macedonia",
"Madagascar",
"Malawi",
"Malaysia",
"Maldives",
"Mali",
"Malta",
"Mauritania",
"Mauritius",
"Mexico",
"Federated States of Micronesia",
"Moldova",
"Mongolia",
"Montserrat",
"Morocco",
"Mozambique",
"Myanmar",
"Namibia",
"Nepal",
"Netherlands",
"New Zealand",
"Nicaragua",
"Niger",
"Nigeria",
"Norway",
"Oman",
"Panama",
"Papua New Guinea",
"Paraguay",
"Peru",
"Philippines",
"Poland",
"Portugal",
"Qatar",
"Romania",
"Rwanda",
"Saint Kitts and Nevis",
"Saint Lucia",
"Saint Vincent and The Grenadines",
"Saudi Arabia",
"Senegal",
"Seychelles",
"Sierra Leone",
"Singapore",
"Slovakia",
"Slovenia",
"Solomon Islands",
"South Africa",
"Spain",
"Sri Lanka",
"Suriname",
"Eswatini",
"Sweden",
"Switzerland",
"Taiwan",
"Tajikistan",
"Tanzania",
"Thailand",
"Tonga",
"Trinidad and Tobago",
"Tunisia",
"Turkey",
"Turkmenistan",
"Turks and Caicos Islands",
"Uganda",
"Ukraine",
"United Arab Emirates",
"United Kingdom",
"United States",
"Uruguay",
"Uzbekistan",
"Vanuatu",
"Venezuela",
"Vietnam",
"British Virgin Islands",
"Yemen",
"Democratic Republic of the Congo",
"Zambia",
"Zimbabwe",
"Montenegro",
"Serbia",
"Kosovo"
],
"label": [
"Warner Music Japan"
],
"format": "Digital Media",
"monitored": true
}
],
"genres": [],
"media": [
{
"mediumNumber": 1,
"mediumName": "",
"mediumFormat": "Digital Media"
}
],
"artist": {
"artistMetadataId": 14,
"status": "continuing",
"ended": false,
"artistName": "TWICE",
"foreignArtistId": "8da127cc-c432-418f-b356-ef36210d82ac",
"tadbId": 0,
"discogsId": 0,
"overview": "Twice (Korean: 트와이스; RR: Teuwaiseu; Japanese: トゥワイス, Hepburn: To~uwaisu; commonly stylized in all caps as TWICE) is a South Korean girl group formed by JYP Entertainment. The group is composed of nine members: Nayeon, Jeongyeon, Momo, Sana, Jihyo, Mina, Dahyun, Chaeyoung, and Tzuyu. Twice was formed under the television program Sixteen (2015) and debuted on October 20, 2015, with the extended play (EP) The Story Begins.\nTwice rose to domestic fame in 2016 with their single \"Cheer Up\", which charted at number one on the Gaon Digital Chart, became the best-performing single of the year, and won \"Song of the Year\" at the Melon Music Awards and Mnet Asian Music Awards. Their next single, \"TT\", from their third EP Twicecoaster: Lane 1, topped the Gaon charts for four consecutive weeks. The EP was the highest selling Korean girl group album of 2016. Within 19 months after debut, Twice had already sold over 1.2 million units of their four EPs and special album. As of December 2020, the group has sold over 10 million albums cumulatively in South Korea and Japan, becoming the highest-selling K-Pop girl group of all time.The group debuted in Japan on June 28, 2017, under Warner Music Japan, with the release of a compilation album titled #Twice. The album charted at number 2 on the Oricon Albums Chart with the highest first-week album sales by a K-pop artist in Japan in two years. It was followed by the release of Twice's first original Japanese maxi single titled \"One More Time\" in October. Twice became the first Korean girl group to earn a platinum certification from the Recording Industry Association of Japan (RIAJ) for both an album and CD single in the same year. Twice ranked third in the Top Artist category of Billboard Japan's 2017 Year-end Rankings, and in 2019, they became the first Korean girl group to embark on a Japanese dome tour.\nTwice is the first female Korean act to simultaneously top both Billboard's World Albums and World Digital Song Sales charts with the release of their first studio album Twicetagram and its lead single \"Likey\" in 2017. With the release of their single \"Feel Special\" in 2019, Twice became the third female Korean act to chart into the Canadian Hot 100. After signing with Republic Records for American promotions as part of a partnership with JYP Entertainment, the group has charted into the US Billboard 200 with More & More and Eyes Wide Open in 2020 and Taste of Love and Formula of Love: O+T=<3 in 2021. Their first official English-language single, \"The Feels\", became their first song to enter the US Billboard Hot 100 and the UK Singles Chart, peaking at the 83rd and 80th positions of the charts, respectively. They have been dubbed the next \"Nation's Girl Group\", and their point choreography—including for \"Cheer Up\" (2016), \"TT\" (2016), \"Signal\" (2017), and \"What Is Love?\" (2018)—became dance crazes and viral memes imitated by many celebrities.",
"artistType": "Group",
"disambiguation": "South Korean girl group",
"links": [
{
"url": "https://www.generasia.com/wiki/Twice",
"name": "generasia"
},
{
"url": "http://twice.jype.com/",
"name": "jype"
},
{
"url": "https://twitter.com/JYPETWICE",
"name": "twitter"
},
{
"url": "https://www.facebook.com/JYPETWICE",
"name": "facebook"
},
{
"url": "https://www.instagram.com/twicetagram/",
"name": "instagram"
},
{
"url": "https://www.wikidata.org/wiki/Q20645861",
"name": "wikidata"
},
{
"url": "http://fans.jype.com/twice",
"name": "jype"
},
{
"url": "https://commons.wikimedia.org/wiki/File:Twice_performing_at_SAC_2016_02_(cropped).jpg",
"name": "wikimedia"
},
{
"url": "https://www.discogs.com/artist/4786543",
"name": "discogs"
},
{
"url": "https://www.last.fm/music/%ED%8A%B8%EC%99%80%EC%9D%B4%EC%8A%A4",
"name": "last"
},
{
"url": "https://www.last.fm/music/TWICE",
"name": "last"
},
{
"url": "https://commons.wikimedia.org/wiki/File:160507_Twice_guerrilla_concert.jpg",
"name": "wikimedia"
},
{
"url": "https://open.spotify.com/artist/7n2Ycct7Beij7Dj7meI4X0",
"name": "spotify"
},
{
"url": "http://www.twicejapan.com/",
"name": "twicejapan"
},
{
"url": "https://www.instagram.com/jypetwice_japan/",
"name": "instagram"
},
{
"url": "https://twitter.com/JYPETWICE_JAPAN",
"name": "twitter"
},
{
"url": "https://itunes.apple.com/jp/artist/id1203816887",
"name": "apple"
},
{
"url": "https://commons.wikimedia.org/wiki/File:(TV10)_%EC%97%AC%EC%9E%90%EC%B9%9C%EA%B5%AC%C2%B7%ED%8A%B8%EC%99%80%EC%9D%B4%EC%8A%A4%C2%B7%EB%B8%94%EB%9E%99%ED%95%91%ED%81%AC,_%EB%A0%88%EB%93%9C%EC%B9%B4%ED%8E%AB_%EA%B0%81%EC%96%91%EA%B0%81%EC%83%89_%ED%8C%A8%EC%85%98_%EC%97%B4%EC%A0%84_(2017_%EA%B3%A8%EB%93%A0%EB%94%94%EC%8A%A4%ED%81%AC_%EB%A0%88%EB%93%9C%EC%B9%B4%ED%8E%AB)_2m19s.jpg",
"name": "wikimedia"
},
{
"url": "https://itunes.apple.com/us/artist/id1203816887",
"name": "apple"
},
{
"url": "http://viaf.org/viaf/178150468353504172529",
"name": "viaf"
},
{
"url": "https://www.deezer.com/artist/161553",
"name": "deezer"
},
{
"url": "https://imvdb.com/n/twice",
"name": "imvdb"
},
{
"url": "https://listen.tidal.com/artist/3577941",
"name": "tidal"
},
{
"url": "https://www.youtube.com/TWICE",
"name": "youtube"
},
{
"url": "https://www.youtube.com/twicejapan_official",
"name": "youtube"
},
{
"url": "https://music.apple.com/mx/artist/1203816887",
"name": "apple"
},
{
"url": "https://www.imdb.com/name/nm9652049/",
"name": "imdb"
},
{
"url": "https://www.tiktok.com/@twice_tiktok_officialjp",
"name": "tiktok"
},
{
"url": "https://music.youtube.com/channel/UCAq0pFGa2w9SjxOq0ZxKVIw",
"name": "youtube"
}
],
"images": [
{
"url": "http://assets.fanart.tv/fanart/music/8da127cc-c432-418f-b356-ef36210d82ac/musicbanner/twice-58fb678fb1219.jpg",
"coverType": "banner",
"extension": ".jpg"
},
{
"url": "http://assets.fanart.tv/fanart/music/8da127cc-c432-418f-b356-ef36210d82ac/artistbackground/twice-619421e3c57cc.jpg",
"coverType": "fanart",
"extension": ".jpg"
},
{
"url": "http://assets.fanart.tv/fanart/music/8da127cc-c432-418f-b356-ef36210d82ac/hdmusiclogo/twice-58d833d0a608a.png",
"coverType": "logo",
"extension": ".png"
},
{
"url": "http://assets.fanart.tv/fanart/music/8da127cc-c432-418f-b356-ef36210d82ac/artistthumb/twice-58fb69c0c2b00.jpg",
"coverType": "poster",
"extension": ".jpg"
}
],
"path": "/data/Library/Music/TWICE",
"qualityProfileId": 1,
"metadataProfileId": 1,
"monitored": true,
"monitorNewItems": "all",
"genres": [
"Dance",
"Electronica",
"K-Pop",
"Pop",
"R&B"
],
"cleanName": "twice",
"sortName": "twice",
"tags": [],
"added": "2022-07-30T19:32:06Z",
"ratings": {
"votes": 4,
"value": 9.5
},
"statistics": {
"albumCount": 0,
"trackFileCount": 0,
"trackCount": 0,
"totalTrackCount": 0,
"sizeOnDisk": 0,
"percentOfTracks": 0
},
"id": 9
},
"images": [
{
"url": "/MediaCover/Albums/32/cover.jpg?lastWrite=637927379160000000",
"coverType": "cover",
"extension": ".jpg",
"remoteUrl": "https://imagecache.lidarr.audio/v1/caa/22bd49a1-f858-427d-94ee-1788b54fb508/32961181216-1200.jpg"
}
],
"links": [],
"statistics": {
"trackFileCount": 9,
"trackCount": 9,
"totalTrackCount": 9,
"sizeOnDisk": 74968875,
"percentOfTracks": 100
},
"grabbed": false,
"id": 32
}

View File

@@ -0,0 +1,47 @@
{
"id": 634649,
"mediaType": "movie",
"adult": false,
"genreIds": [
28,
12,
878
],
"originalLanguage": "en",
"originalTitle": "Spider-Man: No Way Home",
"overview": "Après les événements liés à l'affrontement avec Mysterio, l'identité secrète de Spider-Man a été révélée. Il est poursuivi par le gouvernement américain, qui l'accuse du meurtre de Mysterio, et traqué par les médias. Cet événement a également des conséquences terribles sur la vie de sa petite-amie M.J. et de son meilleur ami Ned. Désemparé, Peter Parker demande alors de l'aide au docteur Strange. Ce dernier lance un sort pour que tout le monde oublie que Peter est Spider-Man. Mais les choses ne se passent pas comme prévu, et cette action altère la stabilité de l'espace-temps. Cela ouvre le « multivers », un concept terrifiant dont ils ne savent quasiment rien...",
"popularity": 1643.549,
"releaseDate": "2021-12-15",
"title": "Spider-Man: No Way Home",
"video": false,
"voteAverage": 8,
"voteCount": 14510,
"backdropPath": "/ocUp7DJBIc8VJgLEw1prcyK1dYv.jpg",
"posterPath": "/3SyG7dq2q0ollxJ4pSsrqcfRmVj.jpg",
"mediaInfo": {
"downloadStatus": [],
"downloadStatus4k": [],
"id": 91,
"mediaType": "movie",
"tmdbId": 634649,
"tvdbId": null,
"imdbId": null,
"status": 5,
"status4k": 1,
"createdAt": "2021-11-15T15:15:57.000Z",
"updatedAt": "2022-08-01T08:40:19.000Z",
"lastSeasonChange": "2021-11-15T15:15:57.000Z",
"mediaAddedAt": "2021-12-23T12:04:39.000Z",
"serviceId": 0,
"serviceId4k": null,
"externalServiceId": 89,
"externalServiceId4k": null,
"externalServiceSlug": "634649",
"externalServiceSlug4k": null,
"ratingKey": "823",
"ratingKey4k": null,
"seasons": [],
"plexUrl": "https://app.plex.tv/desktop#!/server/719240db84d0795f30baa1c7283588fea536bb21/details?key=%2Flibrary%2Fmetadata%2F823",
"serviceUrl": "http://radarr:7878/movie/634649"
}
}

View File

@@ -0,0 +1,490 @@
{
"page": 1,
"totalPages": 43,
"totalResults": 847,
"results": [
{
"id": 66732,
"firstAirDate": "2016-07-15",
"genreIds": [
18,
10765,
9648
],
"mediaType": "tv",
"name": "Stranger Things",
"originCountry": [
"US"
],
"originalLanguage": "en",
"originalName": "Stranger Things",
"overview": "Quand un jeune garçon disparaît, une petite ville découvre une affaire mystérieuse, des expériences secrètes, des forces surnaturelles terrifiantes... et une fillette.",
"popularity": 1750.831,
"voteAverage": 8.6,
"voteCount": 12763,
"backdropPath": "/56v2KjBlU4XaOv9rVYEQypROD7P.jpg",
"posterPath": "/r2w5UNf2mO2Mdl4q6HopuBms6XM.jpg",
"mediaInfo": {
"downloadStatus": [],
"downloadStatus4k": [],
"id": 202,
"mediaType": "tv",
"tmdbId": 66732,
"tvdbId": 305288,
"imdbId": null,
"status": 4,
"status4k": 1,
"createdAt": "2022-08-01T08:55:00.000Z",
"updatedAt": "2022-08-02T02:30:09.000Z",
"lastSeasonChange": "2022-08-01T08:55:00.000Z",
"mediaAddedAt": "2022-08-01T08:49:00.000Z",
"serviceId": 0,
"serviceId4k": null,
"externalServiceId": 42,
"externalServiceId4k": null,
"externalServiceSlug": "stranger-things",
"externalServiceSlug4k": null,
"ratingKey": "2012",
"ratingKey4k": null,
"seasons": [
{
"id": 166,
"seasonNumber": 1,
"status": 3,
"status4k": 1,
"createdAt": "2022-08-01T08:55:00.000Z",
"updatedAt": "2022-08-02T02:30:09.000Z"
},
{
"id": 167,
"seasonNumber": 2,
"status": 3,
"status4k": 1,
"createdAt": "2022-08-01T08:55:00.000Z",
"updatedAt": "2022-08-02T02:30:09.000Z"
},
{
"id": 168,
"seasonNumber": 3,
"status": 3,
"status4k": 1,
"createdAt": "2022-08-01T08:55:00.000Z",
"updatedAt": "2022-08-02T02:30:09.000Z"
},
{
"id": 169,
"seasonNumber": 4,
"status": 5,
"status4k": 1,
"createdAt": "2022-08-01T08:55:00.000Z",
"updatedAt": "2022-08-01T08:55:00.000Z"
}
],
"plexUrl": "https://app.plex.tv/desktop#!/server/719240db84d0795f30baa1c7283588fea536bb21/details?key=%2Flibrary%2Fmetadata%2F2012",
"serviceUrl": "http://sonarr:8989/series/stranger-things"
}
},
{
"id": 74851,
"firstAirDate": "2017-10-27",
"genreIds": [
10767
],
"mediaType": "tv",
"name": "Beyond Stranger Things",
"originCountry": [
"US"
],
"originalLanguage": "en",
"originalName": "Beyond Stranger Things",
"overview": "Les secrets de l'univers de \"Stranger Things 2\" sont révélés tandis que comédiens et artistes invités évoquent les derniers épisodes avec Jim Rash. Attention, spoilers !",
"popularity": 72.277,
"voteAverage": 7.5,
"voteCount": 74,
"backdropPath": "/qevaCqIekzc7Bp5f2kGAi92kO39.jpg",
"posterPath": "/rHCFO8RJ3Hg6a8KjWAsvAsa38hp.jpg"
},
{
"id": 182026,
"mediaType": "movie",
"adult": false,
"genreIds": [
18
],
"originalLanguage": "en",
"originalTitle": "Stranger Things",
"overview": "",
"popularity": 76.465,
"releaseDate": "2013-04-05",
"title": "Stranger Things",
"video": false,
"voteAverage": 8.6,
"voteCount": 51,
"backdropPath": null,
"posterPath": "/4TKdguyacjYrC1Hnbi3PjSP8r3M.jpg"
},
{
"id": 1865,
"mediaType": "movie",
"adult": false,
"genreIds": [
12,
28,
14
],
"originalLanguage": "en",
"originalTitle": "Pirates of the Caribbean: On Stranger Tides",
"overview": "Dans cette histoire pleine daction, où vérité, trahison, jeunesse éternelle et mort forment un cocktail explosif, le capitaine Jack Sparrow retrouve une femme quil a connu autrefois. Leurs liens sontils faits damour ou, cette femme nestelle quune aventurière sans scrupules qui cherche à lutiliser pour découvrir la légendaire Fontaine de Jouvence? Lorsquelle loblige à embarquer à bord du Queen Annes Revenge, le bateau du terrible pirate BarbeNoire, Jack ne sait plus ce quil doit craindre le plus : Le redoutable maître du bateau ou cette femme surgit de son passé…",
"popularity": 251.27,
"releaseDate": "2011-05-14",
"title": "Pirates des Caraïbes : La Fontaine de jouvence",
"video": false,
"voteAverage": 6.5,
"voteCount": 12180,
"backdropPath": "/uzIGtyS6bbnJzGsPL93WCF1FWm8.jpg",
"posterPath": "/5JjjjGg24IGRXIQtaZkPU59acjV.jpg"
},
{
"id": 96608,
"firstAirDate": "2020-01-30",
"genreIds": [
9648,
80
],
"mediaType": "tv",
"name": "Intimidation",
"originCountry": [
"GB"
],
"originalLanguage": "en",
"originalName": "The Stranger",
"overview": "Adam Price mène une vie idyllique : il a un bon travail, deux fils merveilleux et son mariage semble sans faille. Mais son bonheur va soudainement voler en éclats lorsque « The Stranger » dévoile un secret choquant au sujet de sa femme.",
"popularity": 15.11,
"voteAverage": 7.4,
"voteCount": 283,
"backdropPath": "/97pA0UjBqqgcZFbREQL3U1BQDgX.jpg",
"posterPath": "/y9mX3A3O4SxffDIAlK8Li8AL8BD.jpg"
},
{
"id": 7183,
"mediaType": "movie",
"adult": false,
"genreIds": [
53
],
"originalLanguage": "en",
"originalTitle": "Perfect Stranger",
"overview": "Rowena est une journaliste d'investigation. Lorsqu'elle découvre que Harrison Hill, le très puissant publicitaire, est peut-être lié au meurtre de son amie, elle décide de mener son enquête. Pour se faire et l'approcher, elle va endosser deux identités, celle de Katherine, une intérimaire employée de sa société et Veronica, une jeune femme avec laquelle Hill flirte sur internet.",
"popularity": 20.863,
"releaseDate": "2007-04-11",
"title": "Dangereuse séduction",
"video": false,
"voteAverage": 5.8,
"voteCount": 756,
"backdropPath": "/sG7flxRI3ujV5t2scYpbmREVQbv.jpg",
"posterPath": "/jpQoXiLjTN8uqU9Ym9TMaz2D9aS.jpg"
},
{
"id": 99282,
"firstAirDate": "2020-04-13",
"genreIds": [
18,
9648,
80
],
"mediaType": "tv",
"name": "The Stranger",
"originCountry": [
"US"
],
"originalLanguage": "en",
"originalName": "The Stranger",
"overview": "Un jeune conducteur sans scrupule prend un mystérieux passager d'Hollywood Hills. Sur 12 heures, les deux hommes naviguent dans les bas-fonds sordides de Los Angeles...",
"popularity": 7.158,
"voteAverage": 7.5,
"voteCount": 25,
"backdropPath": "/g8n6jB5Mkn6FUGQ5MbqEMIHrZba.jpg",
"posterPath": "/4KrCPwB6yNBR8Chg5quigrrUFCD.jpg"
},
{
"id": 10053,
"mediaType": "movie",
"adult": false,
"genreIds": [
27,
9648
],
"originalLanguage": "en",
"originalTitle": "When a Stranger Calls",
"overview": "Alors qu'elle garde des enfants, une étudiante est terrorisée par un homme qui la harcèle au téléphone en lui demandant si elle a bien vérifié que tout était normal avec les petits dont elle a la charge. Les policiers qu'elle a appelés finissent par localiser les appels et l'informent que ceux-ci proviennent de la maison où elle se trouve...",
"popularity": 18.475,
"releaseDate": "2006-02-03",
"title": "Terreur sur la Ligne",
"video": false,
"voteAverage": 5.7,
"voteCount": 873,
"backdropPath": "/lF3ojoSmCZgrh9nyy2lOxoWL7KD.jpg",
"posterPath": "/xva4IuEfaT6c8tZLpNK2LKCtNGf.jpg"
},
{
"id": 291151,
"mediaType": "movie",
"adult": false,
"genreIds": [
53,
27,
9648
],
"originalLanguage": "en",
"originalTitle": "The Stranger",
"overview": "Un homme mystérieux à la recherche de sa femme arrive dans une petite ville du Canada, sa présence va quelque peu bouleverser l'apparente tranquillité qui y règne.",
"popularity": 7.932,
"releaseDate": "2014-06-12",
"title": "The Stranger",
"video": false,
"voteAverage": 4.7,
"voteCount": 77,
"backdropPath": "/plTx6iHNbLxNXKL4swZxl4RVT2w.jpg",
"posterPath": "/8YjSy1vG4yuuatgdAU1NbitA52F.jpg"
},
{
"id": 1262,
"mediaType": "movie",
"adult": false,
"genreIds": [
35,
18,
14,
10749
],
"originalLanguage": "en",
"originalTitle": "Stranger Than Fiction",
"overview": "Un beau matin, Harold Crick, un obscur fonctionnaire du fisc, entend soudain une voix de femme qui se met à commenter tout ce qu'il vit, y compris ses pensées les plus intimes. Pour Harold, c'est un cauchemar qui dérègle sa vie parfaitement agencée, mais cela devient encore plus grave lorsque la voix annonce qu'il va bientôt mourir...Harold découvre que cette voix est celle d'une romancière, Karen Eiffel, qui s'efforce désespérément d'écrire la fin de ce qui pourrait être son meilleur livre. Il ne lui reste plus qu'à trouver comment tuer son personnage principal : Harold ! Elle ignore que celui-ci existe, qu'il entend ses mots et connaît le sort qu'elle lui réserve...Pour s'en sortir vivant, Harold doit changer son destin. Sa seule chance est de devenir un personnage de comédie, puisque ceux-ci ne sont jamais tués...",
"popularity": 12.475,
"releaseDate": "2006-09-09",
"title": "L'Incroyable Destin de Harold Crick",
"video": false,
"voteAverage": 7.3,
"voteCount": 1875,
"backdropPath": "/d9eONXYtCmQnPWw61w9pNMGlSzK.jpg",
"posterPath": "/hZpCDBXmKqDBBonBKGAcZ95Qmvi.jpg"
},
{
"id": 87692,
"firstAirDate": "2019-04-06",
"genreIds": [
16,
35,
10765
],
"mediaType": "tv",
"name": "Chou Kadou Girl",
"originCountry": [
"JP"
],
"originalLanguage": "ja",
"originalName": "超可動ガール⅙ AMAZING STRANGER",
"overview": "Haruto est un otaku qui ne s'intéresse pas aux (vraies) filles en 3D ! Un jour, sa dernière acquisition, une figurine de son héroïne préférée Nona, se met à bouger toute seule. Ainsi commence la drôle de vie conjugale entre un otaku et un robot...",
"popularity": 11.422,
"voteAverage": 6.4,
"voteCount": 5,
"backdropPath": "/yl4Ltag61cTv0XtwbwMpvzxt7ov.jpg",
"posterPath": "/pPxakEs1TP6JhclPceGxHBoE8Ey.jpg"
},
{
"id": 455108,
"mediaType": "movie",
"adult": false,
"genreIds": [
9648,
18,
27,
36
],
"originalLanguage": "en",
"originalTitle": "The Little Stranger",
"overview": "Fils dune modeste domestique, le docteur Faraday sest construit une existence tranquille et respectable en devenant médecin de campagne. En 1947, lors dun été particulièrement long et chaud, il est appelé au chevet dune patiente à Hundreds Hall, où sa mère fut employée autrefois. Le domaine, qui appartient depuis plus de deux siècles à la famille Ayres, est aujourdhui en piteux état, et ses habitants la mère, son fils et sa fille sont hantés par quelque chose de bien plus effrayant encore que le déclin de leurs finances. Faraday ne simagine pas à quel point le destin de cette famille et le sien sont liés, ni ce que cela a de terrifiant…",
"popularity": 12.538,
"releaseDate": "2018-08-30",
"title": "The Little Stranger",
"video": false,
"voteAverage": 5.7,
"voteCount": 216,
"backdropPath": "/eyrUZ6jvg1Qy3jUz5YH8U4UkFLP.jpg",
"posterPath": "/qm1KJU9coK2voDIFD6AUvSgVG56.jpg"
},
{
"id": 38166,
"mediaType": "movie",
"adult": false,
"genreIds": [
28,
18,
53,
9648
],
"originalLanguage": "en",
"originalTitle": "The Stranger",
"overview": "Un agent du F.B.I poursuit le témoin matériel d'une enquête classée secret défense.",
"popularity": 6.555,
"releaseDate": "2010-06-01",
"title": "The Stranger",
"video": false,
"voteAverage": 4.9,
"voteCount": 57,
"backdropPath": "/kjFC8S6y9wKiRXRpOPwQQu6e9cJ.jpg",
"posterPath": "/fXg4MXYruDKrssFmfzKlf2TINJb.jpg"
},
{
"id": 20246,
"mediaType": "movie",
"adult": false,
"genreIds": [
80,
18,
9648,
53
],
"originalLanguage": "en",
"originalTitle": "The Stranger",
"overview": "L'inspecteur Wilson, de la commission contre les crimes de guerre, décide de relâcher un ancien chef de camp d'extermination nazi, dans l'espoir qu'il le conduira jusqu'à son supérieur, Franz Kindler. L'Allemand, qui circule sous un nom d'emprunt, se rend dans la petite ville de Harper. L'inspecteur le suit. Se sachant surveillé, l'ex-détenu attire le policier dans le gymnase de l'école. Là, il l'assomme et se précipite dans la maison voisine, qui n'est autre que celle de Franz Kindler, aujourd'hui professeur dans ce collège, pour le prévenir de l'arrivée de la police…",
"popularity": 7.449,
"releaseDate": "1946-07-02",
"title": "Le Criminel",
"video": false,
"voteAverage": 7.3,
"voteCount": 449,
"backdropPath": "/eewSm2QKPMueCM3ix5r3aE5eIur.jpg",
"posterPath": "/ee3F8CvNMSJZvYiwW2DKSvU9rQj.jpg"
},
{
"id": 469,
"mediaType": "movie",
"adult": false,
"genreIds": [
35,
18
],
"originalLanguage": "en",
"originalTitle": "Stranger Than Paradise",
"overview": "Eva, 16 ans, quitte la Hongrie et retrouve son cousin Willie, installé depuis 10 ans aux États-Unis. Inadaptés à cette terre de désillusions, ils partent de Miami découvrir le paradis de la Floride, royaume du jeu et dernier espoir d'un exil douloureux.",
"popularity": 9.713,
"releaseDate": "1984-10-01",
"title": "Stranger Than Paradise",
"video": false,
"voteAverage": 7.2,
"voteCount": 394,
"backdropPath": "/tAEV7htL9Yi0hMHtxlv2VAm9Rbe.jpg",
"posterPath": "/fxlMexOi2D64ugS07Sv2hJZYM3R.jpg"
},
{
"id": 45964,
"mediaType": "movie",
"adult": false,
"genreIds": [
27,
53,
18,
80,
9648
],
"originalLanguage": "en",
"originalTitle": "When a Stranger Calls",
"overview": "Au cours dune nuit où elle garde les enfants dun couple marié, une baby-sitter se fait harceler au téléphone par un inconnu qui lui pose systématiquement la même question : « êtes-vous allée voir les enfants ? ». De plus en plus inquiète à mesure que les appels se succèdent, la jeune femme décide de contacter la police.",
"popularity": 9.731,
"releaseDate": "1979-10-26",
"title": "Terreur sur la ligne",
"video": false,
"voteAverage": 6.2,
"voteCount": 178,
"backdropPath": "/3dK12SaczU7Tf8btq7K2F5HQg6F.jpg",
"posterPath": "/x4d8XUXbWLjiro51iQ2qiFhT6t4.jpg"
},
{
"id": 105024,
"firstAirDate": "2020-06-24",
"genreIds": [
35,
18
],
"mediaType": "tv",
"name": "Hello, Stranger",
"originCountry": [
"PH"
],
"originalLanguage": "tl",
"originalName": "Hello, Stranger",
"overview": "",
"popularity": 3.554,
"voteAverage": 7.3,
"voteCount": 3,
"backdropPath": "/8uXYX9F92gc0RlVlTEYVrze83fo.jpg",
"posterPath": "/uu8yWT64FP0W39whxIcs2aMv1Wb.jpg"
},
{
"id": 618352,
"mediaType": "movie",
"adult": false,
"genreIds": [
16,
28,
27,
14
],
"originalLanguage": "en",
"originalTitle": "DC Showcase: The Phantom Stranger",
"overview": "L'histoire se situe dans les années 1970, quand une jeune femme du nom de Jess et ses amis se rendent à une soirée dans un vieux manoir qui appartient à un certain Seth, les choses tournent au vinaigre, le Phantom Stranger arrivera pour leur porter secours.",
"popularity": 8.072,
"releaseDate": "2020-02-25",
"title": "DC Showcase: The Phantom Stranger",
"video": false,
"voteAverage": 7.5,
"voteCount": 49,
"backdropPath": "/vQkGZ0u9E8PgBbjg8vo61KHxQDc.jpg",
"posterPath": "/tqcL1YEiGUKsW1Ofka59m4MIKr1.jpg"
},
{
"id": 413852,
"mediaType": "movie",
"adult": false,
"genreIds": [
18,
9648,
53,
878
],
"originalLanguage": "en",
"originalTitle": "Welcome the Stranger",
"overview": "Alice arrive inopinément chez son frère, Ethan, en espérant se réconcilier avec lui. D'étranges visions et le retour de la petite amie d'Ethan perturbent son projet...",
"popularity": 5.994,
"releaseDate": "2018-03-20",
"title": "Welcome the Stranger",
"video": false,
"voteAverage": 5,
"voteCount": 33,
"backdropPath": "/51aiE8fEXchmbLIyX7Smm3zJavV.jpg",
"posterPath": "/fZch4FhfexA18gUUQjHXKnLmkjh.jpg"
},
{
"id": 41670,
"mediaType": "movie",
"adult": false,
"genreIds": [
18,
10749,
80
],
"originalLanguage": "en",
"originalTitle": "A Stranger Among Us",
"overview": "Chargée d'enquêter sur un meurtre au sein de la communauté hassidique de la ville de New-York, la détective Emily Eden parvient à se faire accepter au sein de cette secte si hermétique.",
"popularity": 7.016,
"releaseDate": "1992-07-17",
"title": "Une étrangère parmi nous",
"video": false,
"voteAverage": 5.7,
"voteCount": 71,
"backdropPath": "/hL0hkMFGWgOvC0P4le6gzRzwa62.jpg",
"posterPath": "/rvk00cSV6cGWQQIppEPYLnDebQ1.jpg"
}
]
}

View File

@@ -0,0 +1,110 @@
{
"seriesId": 37,
"episodeFileId": 7387,
"seasonNumber": 1,
"episodeNumber": 4,
"title": "Part IV",
"airDate": "2022-06-08",
"airDateUtc": "2022-06-08T07:00:00Z",
"overview": "Obi-Wan Kenobi plots a daring mission into enemy territory.",
"episodeFile": {
"seriesId": 37,
"seasonNumber": 1,
"relativePath": "Season 1/Obi-Wan.Kenobi.S01E04.1080p.WEB.h264-KOGi[rartv].mkv",
"path": "/tv/Obi-Wan Kenobi/Season 1/Obi-Wan.Kenobi.S01E04.1080p.WEB.h264-KOGi[rartv].mkv",
"size": 1893191174,
"dateAdded": "2022-06-08T07:32:27.158296Z",
"sceneName": "Obi-Wan.Kenobi.S01E04.1080p.WEB.h264-KOGi[rartv]",
"quality": {
"quality": {
"id": 3,
"name": "WEBDL-1080p",
"source": "web",
"resolution": 1080
},
"revision": {
"version": 1,
"real": 0,
"isRepack": false
}
},
"language": {
"id": 1,
"name": "English"
},
"mediaInfo": {
"audioChannels": 5.1,
"audioCodec": "EAC3 Atmos",
"videoCodec": "h264"
},
"originalFilePath": "Obi-Wan.Kenobi.S01E04.1080p.WEB.h264-KOGi[rarbg]/Obi-Wan.Kenobi.S01E04.1080p.WEB.h264-KOGi.mkv",
"qualityCutoffNotMet": false,
"id": 7387
},
"hasFile": true,
"monitored": true,
"unverifiedSceneNumbering": false,
"series": {
"title": "Obi-Wan Kenobi",
"sortTitle": "obiwan kenobi",
"seasonCount": 1,
"status": "ended",
"overview": "During the reign of the Empire, Obi-Wan Kenobi embarks on a crucial mission.",
"network": "Disney+",
"airTime": "03:00",
"images": [
{
"coverType": "banner",
"url": "https://artworks.thetvdb.com/banners/v4/series/393199/banners/6290d38b8c283.jpg"
},
{
"coverType": "poster",
"url": "https://artworks.thetvdb.com/banners/v4/series/393199/posters/629668351aca3.jpg"
},
{
"coverType": "fanart",
"url": "https://artworks.thetvdb.com/banners/v4/series/393199/backgrounds/62912a0fe623d.jpg"
}
],
"seasons": [
{
"seasonNumber": 1,
"monitored": true
}
],
"year": 2022,
"path": "/tv/Obi-Wan Kenobi",
"profileId": 1,
"languageProfileId": 1,
"seasonFolder": true,
"monitored": true,
"useSceneNumbering": false,
"runtime": 39,
"tvdbId": 393199,
"tvRageId": 0,
"tvMazeId": 52260,
"firstAired": "2022-05-27T00:00:00Z",
"lastInfoSync": "2022-07-22T03:36:34.392414Z",
"seriesType": "standard",
"cleanTitle": "obiwankenobi",
"imdbId": "tt8466564",
"titleSlug": "obi-wan-kenobi",
"certification": "TV-14",
"genres": [
"Action",
"Adventure",
"Fantasy",
"Mini-Series",
"Science Fiction"
],
"tags": [],
"added": "2022-05-03T20:22:10.47688Z",
"ratings": {
"votes": 0,
"value": 0
},
"qualityProfileId": 1,
"id": 37
},
"id": 1407
}

View File

@@ -2,9 +2,9 @@ import { createStyles, useMantineColorScheme, useMantineTheme } from '@mantine/c
import { IconCalendar as CalendarIcon } from '@tabler/icons'; import { IconCalendar as CalendarIcon } from '@tabler/icons';
import axios from 'axios'; import axios from 'axios';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { serviceItem } from '../../../tools/types'; import { serviceItem } from '../../tools/types';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
const asModule = <T extends IModule>(t: T) => t; const asModule = <T extends IModule>(t: T) => t;
export const DashdotModule = asModule({ export const DashdotModule = asModule({
@@ -30,6 +30,10 @@ export const DashdotModule = asModule({
value: ['CPU', 'RAM', 'Storage', 'Network'], value: ['CPU', 'RAM', 'Storage', 'Network'],
options: ['CPU', 'RAM', 'Storage', 'Network', 'GPU'], options: ['CPU', 'RAM', 'Storage', 'Network', 'GPU'],
}, },
url: {
name: 'Dash. URL',
value: '',
},
}, },
}); });
@@ -88,12 +92,12 @@ const bytePrettyPrint = (byte: number): string =>
? `${(byte / 1024).toFixed(1)} KiB` ? `${(byte / 1024).toFixed(1)} KiB`
: `${byte.toFixed(1)} B`; : `${byte.toFixed(1)} B`;
const useJson = (service: serviceItem | undefined, url: string) => { const useJson = (targetUrl: string, url: string) => {
const [data, setData] = useState<any | undefined>(); const [data, setData] = useState<any | undefined>();
const doRequest = async () => { const doRequest = async () => {
try { try {
const resp = await axios.get(url, { baseURL: service?.url }); const resp = await axios.get(`/api/modules/dashdot?url=${url}&base=${targetUrl}`);
setData(resp.data); setData(resp.data);
// eslint-disable-next-line no-empty // eslint-disable-next-line no-empty
@@ -101,10 +105,10 @@ const useJson = (service: serviceItem | undefined, url: string) => {
}; };
useEffect(() => { useEffect(() => {
if (service?.url) { if (targetUrl) {
doRequest(); doRequest();
} }
}, [service?.url]); }, [targetUrl]);
return data; return data;
}; };
@@ -118,8 +122,10 @@ export function DashdotComponent() {
const dashConfig = config.modules?.[DashdotModule.title] const dashConfig = config.modules?.[DashdotModule.title]
.options as typeof DashdotModule['options']; .options as typeof DashdotModule['options'];
const isCompact = dashConfig?.useCompactView?.value ?? false; const isCompact = dashConfig?.useCompactView?.value ?? false;
const dashdotService = config.services.filter((service) => service.type === 'Dash.')[0]; const dashdotService: serviceItem | undefined = config.services.filter(
(service) => service.type === 'Dash.'
)[0];
const dashdotUrl = dashdotService?.url ?? dashConfig?.url?.value ?? '';
const enabledGraphs = dashConfig?.graphs?.value ?? ['CPU', 'RAM', 'Storage', 'Network']; const enabledGraphs = dashConfig?.graphs?.value ?? ['CPU', 'RAM', 'Storage', 'Network'];
const cpuEnabled = enabledGraphs.includes('CPU'); const cpuEnabled = enabledGraphs.includes('CPU');
const storageEnabled = enabledGraphs.includes('Storage'); const storageEnabled = enabledGraphs.includes('Storage');
@@ -127,8 +133,8 @@ export function DashdotComponent() {
const networkEnabled = enabledGraphs.includes('Network'); const networkEnabled = enabledGraphs.includes('Network');
const gpuEnabled = enabledGraphs.includes('GPU'); const gpuEnabled = enabledGraphs.includes('GPU');
const info = useJson(dashdotService, '/info'); const info = useJson(dashdotUrl, '/info');
const storageLoad = useJson(dashdotService, '/load/storage'); const storageLoad = useJson(dashdotUrl, '/load/storage');
const totalUsed = const totalUsed =
(storageLoad?.layout as any[])?.reduce((acc, curr) => (curr.load ?? 0) + acc, 0) ?? 0; (storageLoad?.layout as any[])?.reduce((acc, curr) => (curr.load ?? 0) + acc, 0) ?? 0;
@@ -166,13 +172,23 @@ export function DashdotComponent() {
}, },
].filter((g) => g.enabled); ].filter((g) => g.enabled);
if (dashdotUrl === '') {
return (
<div>
<h2 className={classes.heading}>Dash.</h2>
<p>
No dash. service found. Please add one to your Homarr dashboard or set a dashdot URL in
the module options
</p>
</div>
);
}
return ( return (
<div> <div>
<h2 className={classes.heading}>Dash.</h2> <h2 className={classes.heading}>Dash.</h2>
{!dashdotService ? ( {!info ? (
<p>No dash. service found. Please add one to your Homarr dashboard.</p>
) : !info ? (
<p>Cannot acquire information from dash. - are you running the latest version?</p> <p>Cannot acquire information from dash. - are you running the latest version?</p>
) : ( ) : (
<div className={classes.graphsContainer}> <div className={classes.graphsContainer}>
@@ -209,9 +225,7 @@ export function DashdotComponent() {
} }
key={graph.name} key={graph.name}
title={graph.name} title={graph.name}
src={`${ src={`${dashdotUrl}?singleGraphMode=true&graph=${graph.name.toLowerCase()}&theme=${colorScheme}&surface=${(colorScheme ===
dashdotService.url
}?singleGraphMode=true&graph=${graph.name.toLowerCase()}&theme=${colorScheme}&surface=${(colorScheme ===
'dark' 'dark'
? theme.colors.dark[7] ? theme.colors.dark[7]
: theme.colors.gray[0] : theme.colors.gray[0]
@@ -223,7 +237,6 @@ export function DashdotComponent() {
: '' : ''
}`} }`}
frameBorder="0" frameBorder="0"
allowTransparency
/> />
))} ))}
</div> </div>

View File

@@ -2,9 +2,9 @@ import { Group, Text, Title } from '@mantine/core';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { IconClock as Clock } from '@tabler/icons'; import { IconClock as Clock } from '@tabler/icons';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval'; import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
export const DateModule: IModule = { export const DateModule: IModule = {
title: 'Date', title: 'Date',
@@ -34,9 +34,9 @@ export default function DateComponent(props: any) {
}, []); }, []);
return ( return (
<Group p="sm" spacing="xs" direction="column"> <Group p="sm" spacing="xs">
<Title>{dayjs(date).format(formatString)}</Title> <Title>{dayjs(date).format(formatString)}</Title>
<Text size="xl">{dayjs(date).format('dddd, MMMM D')}</Text> <Text size="lg">{dayjs(date).format('dddd, MMMM D')}</Text>
</Group> </Group>
); );
} }

View File

@@ -1,5 +1,4 @@
import { Button, Group, Modal, Title } from '@mantine/core'; import { Button, Group, Modal, Title } from '@mantine/core';
import { useBooleanToggle } from '@mantine/hooks';
import { showNotification, updateNotification } from '@mantine/notifications'; import { showNotification, updateNotification } from '@mantine/notifications';
import { import {
IconCheck, IconCheck,
@@ -12,8 +11,9 @@ import {
} from '@tabler/icons'; } from '@tabler/icons';
import axios from 'axios'; import axios from 'axios';
import Dockerode from 'dockerode'; import Dockerode from 'dockerode';
import { tryMatchService } from '../../../tools/addToHomarr'; import { tryMatchService } from '../../tools/addToHomarr';
import { AddAppShelfItemForm } from '../../AppShelf/AddAppShelfItem'; import { AddAppShelfItemForm } from '../../components/AppShelf/AddAppShelfItem';
import { useState } from 'react';
function sendDockerCommand( function sendDockerCommand(
action: string, action: string,
@@ -60,7 +60,7 @@ export interface ContainerActionBarProps {
} }
export default function ContainerActionBar({ selected, reload }: ContainerActionBarProps) { export default function ContainerActionBar({ selected, reload }: ContainerActionBarProps) {
const [opened, setOpened] = useBooleanToggle(false); const [opened, setOpened] = useState<boolean>(false);
return ( return (
<Group> <Group>
<Modal <Modal

View File

@@ -1,4 +1,4 @@
import { ActionIcon, Drawer, Group, LoadingOverlay, Text } from '@mantine/core'; import { ActionIcon, Drawer, Group, LoadingOverlay, Text, Tooltip } from '@mantine/core';
import axios from 'axios'; import axios from 'axios';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import Docker from 'dockerode'; import Docker from 'dockerode';
@@ -6,8 +6,8 @@ import { IconBrandDocker, IconX } from '@tabler/icons';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import ContainerActionBar from './ContainerActionBar'; import ContainerActionBar from './ContainerActionBar';
import DockerTable from './DockerTable'; import DockerTable from './DockerTable';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
export const DockerModule: IModule = { export const DockerModule: IModule = {
title: 'Docker', title: 'Docker',
@@ -20,22 +20,23 @@ export default function DockerMenuButton(props: any) {
const [opened, setOpened] = useState(false); const [opened, setOpened] = useState(false);
const [containers, setContainers] = useState<Docker.ContainerInfo[]>([]); const [containers, setContainers] = useState<Docker.ContainerInfo[]>([]);
const [selection, setSelection] = useState<Docker.ContainerInfo[]>([]); const [selection, setSelection] = useState<Docker.ContainerInfo[]>([]);
const [visible, setVisible] = useState(false);
const { config } = useConfig(); const { config } = useConfig();
const moduleEnabled = config.modules?.[DockerModule.title]?.enabled ?? false;
useEffect(() => { useEffect(() => {
reload(); reload();
}, []); }, [config.modules]);
function reload() { function reload() {
setVisible(true); if (!moduleEnabled) {
return;
}
setTimeout(() => { setTimeout(() => {
axios axios
.get('/api/docker/containers') .get('/api/docker/containers')
.then((res) => { .then((res) => {
setContainers(res.data); setContainers(res.data);
setSelection([]); setSelection([]);
setVisible(false);
}) })
.catch(() => .catch(() =>
// Send an Error notification // Send an Error notification
@@ -57,14 +58,16 @@ export default function DockerMenuButton(props: any) {
if (containers.length < 1) return null; if (containers.length < 1) return null;
return ( return (
<> <>
<Drawer opened={opened} onClose={() => setOpened(false)} padding="xl" size="full"> <Drawer
<ContainerActionBar selected={selection} reload={reload} /> opened={opened}
<div style={{ position: 'relative' }}> onClose={() => setOpened(false)}
<LoadingOverlay transitionDuration={500} visible={visible} /> padding="xl"
<DockerTable containers={containers} selection={selection} setSelection={setSelection} /> size="full"
</div> title={<ContainerActionBar selected={selection} reload={reload} />}
>
<DockerTable containers={containers} selection={selection} setSelection={setSelection} />
</Drawer> </Drawer>
<Group position="center"> <Tooltip label="Docker">
<ActionIcon <ActionIcon
variant="default" variant="default"
radius="md" radius="md"
@@ -74,7 +77,7 @@ export default function DockerMenuButton(props: any) {
> >
<IconBrandDocker /> <IconBrandDocker />
</ActionIcon> </ActionIcon>
</Group> </Tooltip>
</> </>
); );
} }

View File

@@ -101,7 +101,6 @@ export default function DockerTable({
onChange={handleSearchChange} onChange={handleSearchChange}
/> />
<Table captionSide="bottom" highlightOnHover sx={{ minWidth: 800 }} verticalSpacing="sm"> <Table captionSide="bottom" highlightOnHover sx={{ minWidth: 800 }} verticalSpacing="sm">
<caption>your docker containers</caption>
<thead> <thead>
<tr> <tr>
<th style={{ width: 40 }}> <th style={{ width: 40 }}>

View File

@@ -8,7 +8,6 @@ import {
Skeleton, Skeleton,
ScrollArea, ScrollArea,
Center, Center,
Image,
} from '@mantine/core'; } from '@mantine/core';
import { IconDownload as Download } from '@tabler/icons'; import { IconDownload as Download } from '@tabler/icons';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
@@ -16,11 +15,11 @@ import axios from 'axios';
import { NormalizedTorrent } from '@ctrl/shared-torrent'; import { NormalizedTorrent } from '@ctrl/shared-torrent';
import { useViewportSize } from '@mantine/hooks'; import { useViewportSize } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem'; import { AddItemShelfButton } from '../../components/AppShelf/AddAppShelfItem';
import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval'; import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
import { humanFileSize } from '../../../tools/humanFileSize'; import { humanFileSize } from '../../tools/humanFileSize';
export const DownloadsModule: IModule = { export const DownloadsModule: IModule = {
title: 'Torrent', title: 'Torrent',
@@ -82,10 +81,10 @@ export default function DownloadComponent() {
if (downloadServices.length === 0) { if (downloadServices.length === 0) {
return ( return (
<Group direction="column"> <Group>
<Title order={3}>No supported download clients found!</Title> <Title order={3}>No supported download clients found!</Title>
<Group> <Group>
<Text>Add a download service to view your current downloads...</Text> <Text>Add a download service to view your current downloads</Text>
<AddItemShelfButton /> <AddItemShelfButton />
</Group> </Group>
</Group> </Group>
@@ -187,23 +186,18 @@ export default function DownloadComponent() {
); );
}); });
const easteregg = (
<Center style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Image fit="cover" height={300} src="https://danjohnvelasco.github.io/images/empty.png" />
</Center>
);
return ( return (
<Group noWrap grow direction="column" mt="xl"> <ScrollArea mt="xl" sx={{ height: 300, width: '100%' }}>
<ScrollArea sx={{ height: 300 }}> {rows.length > 0 ? (
{rows.length > 0 ? ( <Table highlightOnHover>
<Table highlightOnHover> <thead>{ths}</thead>
<thead>{ths}</thead> <tbody>{rows}</tbody>
<tbody>{rows}</tbody> </Table>
</Table> ) : (
) : ( <Center style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
easteregg <Title order={3}>No torrents found</Title>
)} </Center>
</ScrollArea> )}
</Group> </ScrollArea>
); );
} }

View File

@@ -1,4 +1,4 @@
import { Text, Title, Group, useMantineTheme, Box, Card, ColorSwatch } from '@mantine/core'; import { Text, Title, Group, useMantineTheme, Box, Card, ColorSwatch, Stack } from '@mantine/core';
import { IconDownload as Download } from '@tabler/icons'; import { IconDownload as Download } from '@tabler/icons';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import axios from 'axios'; import axios from 'axios';
@@ -7,11 +7,11 @@ import { linearGradientDef } from '@nivo/core';
import { Datum, ResponsiveLine } from '@nivo/line'; import { Datum, ResponsiveLine } from '@nivo/line';
import { useListState } from '@mantine/hooks'; import { useListState } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { AddItemShelfButton } from '../../AppShelf/AddAppShelfItem'; import { AddItemShelfButton } from '../../components/AppShelf/AddAppShelfItem';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { humanFileSize } from '../../../tools/humanFileSize'; import { humanFileSize } from '../../tools/humanFileSize';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
import { useSetSafeInterval } from '../../../tools/hooks/useSetSafeInterval'; import { useSetSafeInterval } from '../../tools/hooks/useSetSafeInterval';
export const TotalDownloadsModule: IModule = { export const TotalDownloadsModule: IModule = {
title: 'Download Speed', title: 'Download Speed',
@@ -43,6 +43,7 @@ export default function TotalDownloadsComponent() {
const totalDownloadSpeed = torrents.reduce((acc, torrent) => acc + torrent.downloadSpeed, 0); const totalDownloadSpeed = torrents.reduce((acc, torrent) => acc + torrent.downloadSpeed, 0);
const totalUploadSpeed = torrents.reduce((acc, torrent) => acc + torrent.uploadSpeed, 0); const totalUploadSpeed = torrents.reduce((acc, torrent) => acc + torrent.uploadSpeed, 0);
useEffect(() => { useEffect(() => {
if (downloadServices.length === 0) return;
const interval = setSafeInterval(() => { const interval = setSafeInterval(() => {
// Send one request with each download service inside // Send one request with each download service inside
axios axios
@@ -78,12 +79,16 @@ export default function TotalDownloadsComponent() {
if (downloadServices.length === 0) { if (downloadServices.length === 0) {
return ( return (
<Group direction="column"> <Group>
<Title order={4}>No supported download clients found!</Title> <Title order={4}>No supported download clients found!</Title>
<Group noWrap> <div>
<Text>Add a download service to view your current downloads...</Text> <AddItemShelfButton
<AddItemShelfButton /> style={{
</Group> float: 'inline-end',
}}
/>
Add a download service to view your current downloads
</div>
</Group> </Group>
); );
} }
@@ -101,9 +106,9 @@ export default function TotalDownloadsComponent() {
})) as Datum[]; })) as Datum[];
return ( return (
<Group noWrap direction="column" grow> <Stack>
<Title order={4}>Current download speed</Title> <Title order={4}>Current download speed</Title>
<Group direction="column"> <Stack>
<Group> <Group>
<ColorSwatch size={12} color={theme.colors.green[5]} /> <ColorSwatch size={12} color={theme.colors.green[5]} />
<Text>Download: {humanFileSize(totalDownloadSpeed)}/s</Text> <Text>Download: {humanFileSize(totalDownloadSpeed)}/s</Text>
@@ -112,7 +117,7 @@ export default function TotalDownloadsComponent() {
<ColorSwatch size={12} color={theme.colors.blue[5]} /> <ColorSwatch size={12} color={theme.colors.blue[5]} />
<Text>Upload: {humanFileSize(totalUploadSpeed)}/s</Text> <Text>Upload: {humanFileSize(totalUploadSpeed)}/s</Text>
</Group> </Group>
</Group> </Stack>
<Box <Box
style={{ style={{
height: 200, height: 200,
@@ -133,7 +138,7 @@ export default function TotalDownloadsComponent() {
<Card p="sm" radius="md" withBorder> <Card p="sm" radius="md" withBorder>
<Text size="md">{roundedSeconds} seconds ago</Text> <Text size="md">{roundedSeconds} seconds ago</Text>
<Card.Section p="sm"> <Card.Section p="sm">
<Group direction="column"> <Stack>
<Group> <Group>
<ColorSwatch size={10} color={theme.colors.green[5]} /> <ColorSwatch size={10} color={theme.colors.green[5]} />
<Text size="md">Download: {humanFileSize(Download)}</Text> <Text size="md">Download: {humanFileSize(Download)}</Text>
@@ -142,7 +147,7 @@ export default function TotalDownloadsComponent() {
<ColorSwatch size={10} color={theme.colors.blue[5]} /> <ColorSwatch size={10} color={theme.colors.blue[5]} />
<Text size="md">Upload: {humanFileSize(Upload)}</Text> <Text size="md">Upload: {humanFileSize(Upload)}</Text>
</Group> </Group>
</Group> </Stack>
</Card.Section> </Card.Section>
</Card> </Card>
); );
@@ -181,6 +186,6 @@ export default function TotalDownloadsComponent() {
]} ]}
/> />
</Box> </Box>
</Group> </Stack>
); );
} }

View File

@@ -1,8 +1,9 @@
export * from './calendar'; export * from './calendar';
export * from './dash.'; export * from './dashdot';
export * from './date'; export * from './date';
export * from './downloads'; export * from './downloads';
export * from './ping'; export * from './ping';
export * from './search'; export * from './search';
export * from './weather'; export * from './weather';
export * from './docker'; export * from './docker';
export * from './overseerr';

View File

@@ -1,4 +1,5 @@
import { import {
ActionIcon,
Button, Button,
Card, Card,
Group, Group,
@@ -8,8 +9,11 @@ import {
TextInput, TextInput,
useMantineColorScheme, useMantineColorScheme,
} from '@mantine/core'; } from '@mantine/core';
import { useConfig } from '../../tools/state'; import { IconAdjustments } from '@tabler/icons';
import { IModule } from './modules'; import { motion } from 'framer-motion';
import { useState } from 'react';
import { useConfig } from '../tools/state';
import { IModule } from './ModuleTypes';
function getItems(module: IModule) { function getItems(module: IModule) {
const { config, setConfig } = useConfig(); const { config, setConfig } = useConfig();
@@ -78,7 +82,7 @@ function getItems(module: IModule) {
}); });
}} }}
> >
<Group noWrap align="end" position="center" mt={0}> <Group noWrap align="end">
<TextInput <TextInput
key={optionName} key={optionName}
id={optionName} id={optionName}
@@ -142,6 +146,8 @@ export function ModuleWrapper(props: any) {
const enabledModules = config.modules ?? {}; const enabledModules = config.modules ?? {};
// Remove 'Module' from enabled modules titles // Remove 'Module' from enabled modules titles
const isShown = enabledModules[module.title]?.enabled ?? false; const isShown = enabledModules[module.title]?.enabled ?? false;
//TODO: fix the hover problem
const [hovering, setHovering] = useState(false);
if (!isShown) { if (!isShown) {
return null; return null;
@@ -150,6 +156,7 @@ export function ModuleWrapper(props: any) {
return ( return (
<Card <Card
{...props} {...props}
key={module.title}
hidden={!isShown} hidden={!isShown}
withBorder withBorder
radius="lg" radius="lg"
@@ -161,47 +168,60 @@ export function ModuleWrapper(props: any) {
${(config.settings.appOpacity || 100) / 100}`, ${(config.settings.appOpacity || 100) / 100}`,
}} }}
> >
<ModuleMenu <motion.div
module={module} onHoverStart={() => {
styles={{ setHovering(true);
root: {
position: 'absolute',
top: 12,
right: 12,
},
}} }}
/> onHoverEnd={() => {
<module.component /> setHovering(false);
}}
>
<ModuleMenu module={module} hovered={hovering} />
<module.component />
</motion.div>
</Card> </Card>
); );
} }
export function ModuleMenu(props: any) { export function ModuleMenu(props: any) {
const { module, styles } = props; const { module, styles, hovered } = props;
const items: JSX.Element[] = getItems(module); const items: JSX.Element[] = getItems(module);
return ( return (
<> <>
{module.options && ( {module.options && (
<Menu <Menu
size="lg" key={module.title}
withinPortal
width="lg"
shadow="xl" shadow="xl"
withArrow
closeOnItemClick={false} closeOnItemClick={false}
radius="md" radius="md"
position="left" position="left"
styles={{
root: {
...props?.styles?.root,
},
body: {
// Add shadow and elevation to the body
boxShadow: '0 0 14px 14px rgba(0, 0, 0, 0.05)',
},
}}
> >
<Menu.Label>Settings</Menu.Label> <Menu.Target>
{items.map((item) => ( <motion.div
<Menu.Item key={item.key}>{item}</Menu.Item> style={{
))} position: 'absolute',
top: 15,
right: 15,
alignSelf: 'flex-end',
}}
animate={{
opacity: hovered === true ? 1 : 0,
}}
>
<ActionIcon>
<IconAdjustments />
</ActionIcon>
</motion.div>
</Menu.Target>
<Menu.Dropdown>
<Menu.Label>Settings</Menu.Label>
{items.map((item) => (
<Menu.Item key={item.key}>{item}</Menu.Item>
))}
</Menu.Dropdown>
</Menu> </Menu>
)} )}
</> </>

248
src/modules/overseerr/Movie.d.ts vendored Normal file
View File

@@ -0,0 +1,248 @@
export interface MovieResult {
id: number;
adult: boolean;
budget: number;
genres: Genre[];
relatedVideos: RelatedVideo[];
originalLanguage: string;
originalTitle: string;
popularity: number;
productionCompanies: ProductionCompany[];
productionCountries: ProductionCountry[];
releaseDate: Date;
releases: Releases;
revenue: number;
spokenLanguages: SpokenLanguage[];
status: string;
title: string;
video: boolean;
voteAverage: number;
voteCount: number;
backdropPath: string;
homepage: string;
imdbId: string;
overview: string;
posterPath: string;
runtime: number;
tagline: string;
credits: Credits;
collection: Collection;
externalIds: ExternalIDS;
mediaInfo: Media;
watchProviders: WatchProvider[];
}
export interface Collection {
id: number;
name: string;
posterPath: string;
backdropPath: string;
}
export interface Credits {
cast: Cast[];
crew: Crew[];
}
export interface Cast {
castId: number;
character: string;
creditId: string;
id: number;
name: string;
order: number;
gender: number;
profilePath: null | string;
}
export interface Crew {
creditId: string;
department: Department;
id: number;
job: string;
name: string;
gender: number;
profilePath: null | string;
}
export enum Department {
Art = 'Art',
Camera = 'Camera',
CostumeMakeUp = 'Costume & Make-Up',
Crew = 'Crew',
Directing = 'Directing',
Editing = 'Editing',
Production = 'Production',
Sound = 'Sound',
VisualEffects = 'Visual Effects',
Writing = 'Writing',
}
export interface ExternalIDS {
facebookId: string;
imdbId: string;
instagramId: string;
twitterId: string;
}
export interface Genre {
id: number;
name: string;
}
export interface Request {
id: number;
status: number;
createdAt: Date;
updatedAt: Date;
type: string;
is4k: boolean;
serverId: number;
profileId: number;
rootFolder: string;
languageProfileId: null;
tags: any[];
media: Media;
requestedBy: EdBy;
modifiedBy: EdBy;
seasons: any[];
seasonCount: number;
}
export interface Media {
downloadStatus: any[];
downloadStatus4k: any[];
id: number;
mediaType: string;
tmdbId: number;
tvdbId: null;
imdbId: null;
status: number;
status4k: number;
createdAt: Date;
updatedAt: Date;
lastSeasonChange: Date;
mediaAddedAt: Date;
serviceId: number;
serviceId4k: null;
externalServiceId: number;
externalServiceId4k: null;
externalServiceSlug: string;
externalServiceSlug4k: null;
ratingKey: string;
ratingKey4k: null;
requests?: Request[];
issues?: any[];
seasons: any[];
plexUrl: string;
serviceUrl: string;
}
export interface EdBy {
permissions: number;
id: number;
email: string;
plexUsername: string;
username: string;
recoveryLinkExpirationDate: null;
userType: number;
avatar: string;
movieQuotaLimit: null;
movieQuotaDays: null;
tvQuotaLimit: null;
tvQuotaDays: null;
createdAt: Date;
updatedAt: Date;
settings: Settings;
requestCount: number;
displayName: string;
}
export interface Settings {
id: number;
locale: string;
region: string;
originalLanguage: null;
pgpKey: null;
discordId: string;
pushbulletAccessToken: null;
pushoverApplicationToken: null;
pushoverUserKey: null;
telegramChatId: null;
telegramSendSilently: null;
notificationTypes: NotificationTypes;
}
export interface NotificationTypes {
discord: number;
email: number;
webpush: number;
}
export interface ProductionCompany {
id: number;
name: string;
originCountry?: string;
logoPath: string;
displayPriority?: number;
}
export interface ProductionCountry {
iso_3166_1: string;
name: string;
}
export interface RelatedVideo {
site: string;
key: string;
name: string;
size: number;
type: string;
url: string;
}
export interface Releases {
results: Result[];
}
export interface Result {
iso_3166_1: string;
release_dates: ReleaseDate[];
}
export interface ReleaseDate {
certification: string;
iso_639_1: ISO639_1 | null;
note: Note;
release_date: Date;
type: number;
}
export enum ISO639_1 {
CS = 'cs',
Empty = '',
}
export enum Note {
Empty = '',
HBOMax = 'HBO Max',
LosAngelesCalifornia = 'Los Angeles, California',
Starz = 'STARZ',
The4KUHDBluRayDVD = '4K UHD, Blu-ray & DVD',
TheMoreFunStuffVersion = 'The More Fun Stuff Version',
Tvod = 'TVOD',
VOD = 'VOD',
}
export interface SpokenLanguage {
english_name: string;
iso_639_1: string;
name: string;
}
export interface WatchProvider {
iso_3166_1: string;
link: string;
buy: ProductionCompany[];
flatrate: ProductionCompany[];
}

View File

@@ -0,0 +1,14 @@
import { IconEyeglass } from '@tabler/icons';
import { OverseerrMediaDisplay } from '../common';
import { IModule } from '../ModuleTypes';
export const OverseerrModule: IModule = {
title: 'Overseerr',
description: 'Allows you to search and add media from Overseerr/Jellyseerr',
icon: IconEyeglass,
component: OverseerrMediaDisplay,
};
export interface OverseerSearchProps {
query: string;
}

View File

@@ -0,0 +1,240 @@
import { Alert, Button, Checkbox, createStyles, Group, Modal, Stack, Table } from '@mantine/core';
import { showNotification, updateNotification } from '@mantine/notifications';
import { IconAlertCircle, IconCheck, IconDownload } from '@tabler/icons';
import axios from 'axios';
import Consola from 'consola';
import { useState } from 'react';
import { useColorTheme } from '../../tools/color';
import { MovieResult } from './Movie.d';
import { MediaType, Result } from './SearchResult.d';
import { TvShowResult, TvShowResultSeason } from './TvShow.d';
interface RequestModalProps {
base: Result;
opened: boolean;
setOpened: (opened: boolean) => void;
}
const useStyles = createStyles((theme) => ({
rowSelected: {
backgroundColor:
theme.colorScheme === 'dark'
? theme.fn.rgba(theme.colors[theme.primaryColor][7], 0.2)
: theme.colors[theme.primaryColor][0],
},
}));
export function RequestModal({ base, opened, setOpened }: RequestModalProps) {
const [result, setResult] = useState<MovieResult | TvShowResult>();
const { secondaryColor } = useColorTheme();
function getResults(base: Result) {
axios.get(`/api/modules/overseerr/${base.id}?type=${base.mediaType}`).then((res) => {
setResult(res.data);
});
}
if (opened && !result) {
getResults(base);
}
if (!result || !opened) {
return null;
}
return base.mediaType === 'movie' ? (
<MovieRequestModal result={result as MovieResult} opened={opened} setOpened={setOpened} />
) : (
<TvRequestModal result={result as TvShowResult} opened={opened} setOpened={setOpened} />
);
}
export function MovieRequestModal({
result,
opened,
setOpened,
}: {
result: MovieResult;
opened: boolean;
setOpened: (opened: boolean) => void;
}) {
const { secondaryColor } = useColorTheme();
return (
<Modal
onClose={() => setOpened(false)}
radius="lg"
size="lg"
trapFocus
zIndex={150}
withinPortal
opened={opened}
title={
<Group>
<IconDownload />
Ask for {result.title}
</Group>
}
>
<Stack>
<Alert
icon={<IconAlertCircle size={16} />}
title="Using API key"
color={secondaryColor}
radius="md"
variant="filled"
>
This request will be automatically approved
</Alert>
<Group>
<Button variant="outline" color="gray" onClick={() => setOpened(false)}>
Cancel
</Button>
<Button
variant="outline"
onClick={() => {
askForMedia(MediaType.Movie, result.id, result.title, []);
}}
>
Request
</Button>
</Group>
</Stack>
</Modal>
);
}
export function TvRequestModal({
result,
opened,
setOpened,
}: {
result: TvShowResult;
opened: boolean;
setOpened: (opened: boolean) => void;
}) {
const [selection, setSelection] = useState<TvShowResultSeason[]>(result.seasons);
const { classes, cx } = useStyles();
const toggleRow = (container: TvShowResultSeason) =>
setSelection((current: TvShowResultSeason[]) =>
current.includes(container) ? current.filter((c) => c !== container) : [...current, container]
);
const toggleAll = () =>
setSelection((current: any) =>
current.length === result.seasons.length ? [] : result.seasons.map((c) => c)
);
const rows = result.seasons.map((element) => {
const selected = selection.includes(element);
return (
<tr key={element.id} className={cx({ [classes.rowSelected]: selected })}>
<td>
<Checkbox
key={element.id}
checked={selection.includes(element)}
onChange={() => toggleRow(element)}
transitionDuration={0}
/>
</td>
<td>{element.name}</td>
<td>{element.episodeCount}</td>
</tr>
);
});
const { secondaryColor } = useColorTheme();
return (
<Modal
onClose={() => setOpened(false)}
radius="lg"
size="lg"
opened={opened}
title={
<Group>
<IconDownload />
Ask for {result.name ?? result.originalName ?? 'a TV show'}
</Group>
}
>
<Stack>
<Alert
icon={<IconAlertCircle size={16} />}
title="Using API key"
color={secondaryColor}
radius="md"
variant="filled"
>
This request will be automatically approved
</Alert>
<Table captionSide="bottom" highlightOnHover>
<caption>Tick the seasons that you want to be downloaded</caption>
<thead>
<tr>
<th>
<Checkbox
onChange={toggleAll}
checked={selection.length === result.seasons.length}
indeterminate={selection.length > 0 && selection.length !== result.seasons.length}
transitionDuration={0}
/>
</th>
<th>Season</th>
<th>Number of episodes</th>
</tr>
</thead>
<tbody>{rows}</tbody>
</Table>
<Group>
<Button variant="outline" color="gray" onClick={() => setOpened(false)}>
Cancel
</Button>
<Button
variant="outline"
disabled={selection.length === 0}
onClick={() => {
askForMedia(
MediaType.Tv,
result.id,
result.name,
selection.map((s) => s.seasonNumber)
);
}}
>
Request
</Button>
</Group>
</Stack>
</Modal>
);
}
function askForMedia(type: MediaType, id: number, name: string, seasons?: number[]) {
Consola.info(`Requesting ${type} ${id} ${name}`);
showNotification({
title: 'Request',
id: id.toString(),
message: `Requesting media ${name}`,
color: 'orange',
loading: true,
autoClose: false,
disallowClose: true,
icon: <IconAlertCircle />,
});
axios
.post(`/api/modules/overseerr/${id}`, { type, seasons })
.then(() => {
updateNotification({
id: id.toString(),
title: '',
color: 'green',
message: ` ${name} requested`,
icon: <IconCheck />,
autoClose: 2000,
});
})
.catch((err) => {
updateNotification({
id: id.toString(),
color: 'red',
title: 'There was an error',
message: err.message,
autoClose: 2000,
});
});
}

66
src/modules/overseerr/SearchResult.d.ts vendored Normal file
View File

@@ -0,0 +1,66 @@
export interface SearchResult {
page: number;
totalPages: number;
totalResults: number;
results: Result[];
}
export interface Result {
id: number;
mediaType: MediaType;
adult?: boolean;
genreIds: number[];
originalLanguage: OriginalLanguage;
originalTitle?: string;
overview: string;
popularity: number;
releaseDate?: Date;
title?: string;
video?: boolean;
voteAverage: number;
voteCount: number;
backdropPath: null | string;
posterPath: string;
mediaInfo?: MediaInfo;
firstAirDate?: Date;
name?: string;
originCountry?: string[];
originalName?: string;
}
export interface MediaInfo {
downloadStatus: any[];
downloadStatus4k: any[];
id: number;
mediaType: MediaType;
tmdbId: number;
tvdbId: null;
imdbId: null;
status: number;
status4k: number;
createdAt: Date;
updatedAt: Date;
lastSeasonChange: Date;
mediaAddedAt: Date;
serviceId: number;
serviceId4k: null;
externalServiceId: number;
externalServiceId4k: null;
externalServiceSlug: string;
externalServiceSlug4k: null;
ratingKey: string;
ratingKey4k: null;
seasons: any[];
plexUrl: string;
serviceUrl: string;
mediaUrl?: string;
}
export enum MediaType {
Movie = 'movie',
Tv = 'tv',
}
export enum OriginalLanguage {
En = 'en',
}

295
src/modules/overseerr/TvShow.d.ts vendored Normal file
View File

@@ -0,0 +1,295 @@
export interface TvShowResult {
createdBy: CreatedBy[];
episodeRunTime: number[];
firstAirDate: Date;
genres: Genre[];
relatedVideos: RelatedVideo[];
homepage: string;
id: number;
inProduction: boolean;
languages: string[];
lastAirDate: Date;
name: string;
networks: Network[];
numberOfEpisodes: number;
numberOfSeasons: number;
originCountry: string[];
originalLanguage: string;
originalName: string;
tagline: string;
overview: string;
popularity: number;
productionCompanies: Network[];
productionCountries: ProductionCountry[];
contentRatings: ContentRatings;
spokenLanguages: SpokenLanguage[];
seasons: TvShowResultSeason[];
status: string;
type: string;
voteAverage: number;
voteCount: number;
backdropPath: string;
lastEpisodeToAir: LastEpisodeToAir;
posterPath: string;
credits: Credits;
externalIds: ExternalIDS;
keywords: Genre[];
mediaInfo: Media;
watchProviders: WatchProvider[];
}
export interface ContentRatings {
results: Result[];
}
export interface Result {
iso_3166_1: string;
rating: string;
}
export interface CreatedBy {
id: number;
credit_id: string;
name: string;
gender: number;
profile_path: string;
}
export interface Credits {
cast: Cast[];
crew: Crew[];
}
export interface Cast {
character: string;
creditId: string;
id: number;
name: string;
order: number;
gender: number;
profilePath: null | string;
}
export interface Crew {
creditId: string;
department: string;
id: number;
job: string;
name: string;
gender: number;
profilePath: string;
}
export interface ExternalIDS {
facebookId: string;
freebaseId: null;
freebaseMid: string;
imdbId: string;
instagramId: string;
tvdbId: number;
tvrageId: number;
twitterId: string;
}
export interface Genre {
id: number;
name: string;
}
export interface LastEpisodeToAir {
id: number;
airDate: Date;
episodeNumber: number;
name: string;
overview: string;
productionCode: string;
seasonNumber: number;
showId: number;
voteAverage: number;
stillPath: string;
}
export interface Request {
id: number;
status: number;
createdAt: Date;
updatedAt: Date;
type: Type;
is4k: boolean;
serverId: null;
profileId: null;
rootFolder: null;
languageProfileId: null;
tags: null;
media: Media;
requestedBy: EdBy;
modifiedBy: EdBy;
seasons: MediaInfoSeason[];
seasonCount: number;
}
export interface Media {
downloadStatus: DownloadStatus[];
downloadStatus4k: any[];
id: number;
mediaType: Type;
tmdbId: number;
tvdbId: number;
imdbId: null;
status: number;
status4k: number;
createdAt: Date;
updatedAt: Date;
lastSeasonChange: Date;
mediaAddedAt: Date;
serviceId: number;
serviceId4k: null;
externalServiceId: number;
externalServiceId4k: null;
externalServiceSlug: string;
externalServiceSlug4k: null;
ratingKey: string;
ratingKey4k: null;
requests?: Request[];
issues?: any[];
seasons: MediaInfoSeason[];
plexUrl: string;
serviceUrl: string;
}
export interface EdBy {
permissions: number;
id: number;
email: string;
plexUsername: string;
username: string;
recoveryLinkExpirationDate: null;
userType: number;
avatar: string;
movieQuotaLimit: null;
movieQuotaDays: null;
tvQuotaLimit: null;
tvQuotaDays: null;
createdAt: Date;
updatedAt: Date;
settings: Settings;
requestCount: number;
displayName: string;
}
export interface Settings {
id: number;
locale: string;
region: string;
originalLanguage: null;
pgpKey: null;
discordId: string;
pushbulletAccessToken: null;
pushoverApplicationToken: null;
pushoverUserKey: null;
telegramChatId: null;
telegramSendSilently: null;
notificationTypes: NotificationTypes;
}
export interface NotificationTypes {
discord: number;
email: number;
webpush: number;
}
export interface MediaInfoSeason {
id: number;
seasonNumber: number;
status: number;
status4k?: number;
createdAt: Date;
updatedAt: Date;
}
export enum Type {
Tv = 'tv',
}
export interface DownloadStatus {
externalId: number;
estimatedCompletionTime: Date;
mediaType: Type;
size: number;
sizeLeft: number;
status: Status;
timeLeft: string;
title: string;
}
export enum Status {
Completed = 'completed',
Downloading = 'downloading',
}
export interface Network {
id: number;
name: Name;
originCountry?: string;
logoPath: LogoPath | null;
displayPriority?: number;
}
export enum LogoPath {
HbifXPpM55B1FL5WPo7T72VzN78PNG = '/hbifXPpM55B1fL5wPo7t72vzN78.png',
KhiCshsZBdtUUYOr4VLoCtuqCEqPNG = '/khiCshsZBdtUUYOr4VLoCtuqCEq.png',
O9ExgOSLF3OTwR6T3DJOuwOKJgqJpg = '/o9ExgOSLF3OTwR6T3DJOuwOKJgq.jpg',
PEURlLlr8JggOwK53FJ5WdQl05YJpg = '/peURlLlr8jggOwK53fJ5wdQl05y.jpg',
T2YyOv40HZeVlLjYsCSPHnWLk4WJpg = '/t2yyOv40HZeVlLjYsCsPHnWLk4W.jpg',
TBEdFQDwx5LEVr8WpSEXQSIirVqJpg = '/tbEdFQDwx5LEVr8WpSeXQSIirVq.jpg',
The5NyLm42TmCqCMOZFvH4FcoSNKEWJpg = '/5NyLm42TmCqCMOZFvH4fcoSNKEW.jpg',
WwemzKWzjKYJFfCeiB57Q3R4BcmPNG = '/wwemzKWzjKYJFfCeiB57q3r4Bcm.png',
}
export enum Name {
AmazonVideo = 'Amazon Video',
AppleITunes = 'Apple iTunes',
Channel4 = 'Channel 4',
GooglePlayMovies = 'Google Play Movies',
HouseOfTomorrow = 'House of Tomorrow',
Ivi = 'Ivi',
Netflix = 'Netflix',
Zeppotron = 'Zeppotron',
}
export interface ProductionCountry {
iso_3166_1: string;
name: string;
}
export interface RelatedVideo {
site: string;
key: string;
name: string;
size: number;
type: string;
url: string;
}
export interface TvShowResultSeason {
airDate: Date;
episodeCount: number;
id: number;
name: string;
overview: string;
seasonNumber: number;
posterPath: string;
}
export interface SpokenLanguage {
englishName: string;
iso_639_1: string;
name: string;
}
export interface WatchProvider {
iso_3166_1: string;
link: string;
buy: Network[];
flatrate: Network[];
}

View File

@@ -0,0 +1,72 @@
{
"id": 86831,
"firstAirDate": "2019-03-15",
"genreIds": [
16,
10765
],
"mediaType": "tv",
"name": "Love, Death & Robots",
"originCountry": [
"US"
],
"originalLanguage": "en",
"originalName": "Love, Death & Robots",
"overview": "Terrifying creatures, wicked surprises and dark comedy converge in this NSFW anthology of animated stories presented by Tim Miller and David Fincher.",
"popularity": 623.833,
"voteAverage": 8.2,
"voteCount": 1720,
"backdropPath": "/78NtUwwo3lhH7QGh4vG3U1qK1mc.jpg",
"posterPath": "/cRiDlzzZC5lL7fvImuSjs04SUIJ.jpg",
"mediaInfo": {
"downloadStatus": [],
"downloadStatus4k": [],
"id": 79,
"mediaType": "tv",
"tmdbId": 86831,
"tvdbId": 357888,
"imdbId": null,
"status": 4,
"status4k": 1,
"createdAt": "2022-02-05T04:30:01.000Z",
"updatedAt": "2022-02-05T09:25:22.000Z",
"lastSeasonChange": "2022-02-05T04:30:01.000Z",
"mediaAddedAt": "2022-02-04T01:16:35.000Z",
"serviceId": 0,
"serviceId4k": null,
"externalServiceId": 7,
"externalServiceId4k": null,
"externalServiceSlug": "love-death-and-robots",
"externalServiceSlug4k": null,
"ratingKey": "182",
"ratingKey4k": null,
"seasons": [
{
"id": 11,
"seasonNumber": 1,
"status": 1,
"status4k": 1,
"createdAt": "2022-02-05T04:30:01.000Z",
"updatedAt": "2022-02-05T04:30:01.000Z"
},
{
"id": 24,
"seasonNumber": 2,
"status": 5,
"status4k": 1,
"createdAt": "2022-02-05T04:30:01.000Z",
"updatedAt": "2022-02-05T04:30:01.000Z"
},
{
"id": 85,
"seasonNumber": 3,
"status": 3,
"status4k": 1,
"createdAt": "2022-04-26T04:30:02.000Z",
"updatedAt": "2022-04-26T04:30:02.000Z"
}
],
"plexUrl": "https://app.plex.tv/desktop#!/server/5b88b3c20d2d092c0ee848f9044f3f3bee033d91/details?key=%2Flibrary%2Fmetadata%2F182",
"serviceUrl": "http://server:8989/series/love-death-and-robots"
}
}

View File

@@ -0,0 +1 @@
export { OverseerrModule } from './OverseerrModule';

View File

@@ -3,8 +3,8 @@ import axios, { AxiosResponse } from 'axios';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { IconPlug as Plug } from '@tabler/icons'; import { IconPlug as Plug } from '@tabler/icons';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
export const PingModule: IModule = { export const PingModule: IModule = {
title: 'Ping Services', title: 'Ping Services',
@@ -56,22 +56,23 @@ export default function PingComponent(props: any) {
return null; return null;
} }
return ( return (
<Tooltip <motion.div
radius="lg"
style={{ position: 'absolute', bottom: 20, right: 20 }} style={{ position: 'absolute', bottom: 20, right: 20 }}
label={ animate={{
isOnline === 'loading' scale: isOnline === 'online' ? [1, 0.8, 1] : 1,
? 'Loading...' }}
: isOnline === 'online' transition={{ repeat: Infinity, duration: 2.5, ease: 'easeInOut' }}
? `Online - ${response}`
: `Offline - ${response}`
}
> >
<motion.div <Tooltip
animate={{ withinPortal
scale: isOnline === 'online' ? [1, 0.8, 1] : 1, radius="lg"
}} label={
transition={{ repeat: Infinity, duration: 2.5, ease: 'easeInOut' }} isOnline === 'loading'
? 'Loading...'
: isOnline === 'online'
? `Online - ${response}`
: `Offline - ${response}`
}
> >
<Indicator <Indicator
size={13} size={13}
@@ -79,7 +80,7 @@ export default function PingComponent(props: any) {
> >
{null} {null}
</Indicator> </Indicator>
</motion.div> </Tooltip>
</Tooltip> </motion.div>
); );
} }

View File

@@ -0,0 +1,199 @@
import { Kbd, createStyles, Autocomplete, Popover, ScrollArea, Divider } from '@mantine/core';
import { useClickOutside, useDebouncedValue, useHotkeys } from '@mantine/hooks';
import { useForm } from '@mantine/form';
import React, { useEffect, useRef, useState } from 'react';
import {
IconSearch as Search,
IconBrandYoutube as BrandYoutube,
IconDownload as Download,
IconMovie,
} from '@tabler/icons';
import axios from 'axios';
import { showNotification } from '@mantine/notifications';
import { useConfig } from '../../tools/state';
import { IModule } from '../ModuleTypes';
import { OverseerrModule } from '../overseerr';
import { OverseerrMediaDisplay } from '../common';
const useStyles = createStyles((theme) => ({
hide: {
[theme.fn.smallerThan('sm')]: {
display: 'none',
},
display: 'flex',
alignItems: 'center',
},
}));
export const SearchModule: IModule = {
title: 'Search Bar',
description: 'Search bar to search the web, youtube, torrents or overseerr',
icon: Search,
component: SearchBar,
};
export default function SearchBar(props: any) {
const { classes, cx } = useStyles();
// Config
const { config } = useConfig();
const isModuleEnabled = config.modules?.[SearchModule.title]?.enabled ?? false;
const isOverseerrEnabled = config.modules?.[OverseerrModule.title]?.enabled ?? false;
const OverseerrService = config.services.find(
(service) => service.type === 'Overseerr' || service.type === 'Jellyseerr'
);
const queryUrl = config.settings.searchUrl ?? 'https://www.google.com/search?q=';
const [OverseerrResults, setOverseerrResults] = useState<any[]>([]);
const [loading, setLoading] = useState<boolean>(false);
const [icon, setIcon] = useState(<Search />);
const [results, setResults] = useState<any[]>([]);
const [opened, setOpened] = useState(false);
const ref = useClickOutside(() => setOpened(false));
const textInput = useRef<HTMLInputElement>();
useHotkeys([['ctrl+K', () => textInput.current && textInput.current.focus()]]);
const form = useForm({
initialValues: {
query: '',
},
});
const [debounced, cancel] = useDebouncedValue(form.values.query, 250);
useEffect(() => {
if (OverseerrService === undefined && isOverseerrEnabled) {
showNotification({
title: 'Overseerr integration',
message:
'Module enabled but no service is configured with the type "Overseerr" / "Jellyseerr"',
color: 'red',
});
}
}, [OverseerrService, isOverseerrEnabled]);
useEffect(() => {
if (
form.values.query !== debounced ||
form.values.query === '' ||
(form.values.query.startsWith('!') && !form.values.query.startsWith('!os'))
) {
return;
}
if (form.values.query.startsWith('!os')) {
axios
.get(`/api/modules/overseerr?query=${form.values.query.replace('!os', '').trim()}`)
.then((res) => {
setOverseerrResults(res.data.results ?? []);
setLoading(false);
});
setLoading(true);
} else {
setOverseerrResults([]);
axios
.get(`/api/modules/search?q=${form.values.query}`)
.then((res) => setResults(res.data ?? []));
}
}, [debounced]);
if (!isModuleEnabled) {
return null;
}
const autocompleteData = results.map((result) => ({
label: result.phrase,
value: result.phrase,
}));
return (
<form
onChange={() => {
// If query contains !yt or !t add "Searching on YouTube" or "Searching torrent"
const query = form.values.query.trim();
switch (query.substring(0, 3)) {
case '!yt':
setIcon(<BrandYoutube />);
break;
case '!t ':
setIcon(<Download />);
break;
case '!os':
setIcon(<IconMovie />);
break;
default:
setIcon(<Search />);
break;
}
}}
onSubmit={form.onSubmit((values) => {
const query = values.query.trim();
setTimeout(() => {
form.setValues({ query: '' });
switch (query.substring(0, 3)) {
case '!yt':
window.open(`https://www.youtube.com/results?search_query=${query.substring(3)}`);
break;
case '!t ':
window.open(`https://www.torrentdownloads.me/search/?search=${query.substring(3)}`);
break;
case '!os':
break;
default:
window.open(
`${queryUrl.includes('%s') ? queryUrl.replace('%s', query) : `${queryUrl}${query}`}`
);
break;
}
}, 500);
})}
>
<Popover
opened={OverseerrResults.length > 0 && opened}
position="bottom"
withArrow
withinPortal
shadow="md"
radius="md"
zIndex={100}
trapFocus
transition="pop-top-right"
>
<Popover.Target>
<Autocomplete
onFocusCapture={() => setOpened(true)}
autoFocus
variant="filled"
data={autocompleteData}
icon={icon}
ref={textInput}
rightSectionWidth={90}
rightSection={
<div className={classes.hide}>
<Kbd>Ctrl</Kbd>
<span style={{ margin: '0 5px' }}>+</span>
<Kbd>K</Kbd>
</div>
}
radius="md"
size="md"
styles={{ rightSection: { pointerEvents: 'none' } }}
placeholder="Search the web..."
{...props}
{...form.getInputProps('query')}
/>
</Popover.Target>
<Popover.Dropdown>
<div ref={ref}>
<ScrollArea style={{ height: 400, width: 400 }} offsetScrollbars>
{OverseerrResults.slice(0, 5).map((result, index) => (
<React.Fragment key={index}>
<OverseerrMediaDisplay key={result.id} media={result} />
{index < OverseerrResults.length - 1 && <Divider variant="dashed" my="xl" />}
</React.Fragment>
))}
</ScrollArea>
</div>
</Popover.Dropdown>
</Popover>
</form>
);
}

View File

@@ -1,4 +1,4 @@
import { Group, Space, Title, Tooltip, Skeleton } from '@mantine/core'; import { Group, Space, Title, Tooltip, Skeleton, Stack, Box } from '@mantine/core';
import axios from 'axios'; import axios from 'axios';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { import {
@@ -13,8 +13,8 @@ import {
IconSnowflake as Snowflake, IconSnowflake as Snowflake,
IconSun as Sun, IconSun as Sun,
} from '@tabler/icons'; } from '@tabler/icons';
import { useConfig } from '../../../tools/state'; import { useConfig } from '../../tools/state';
import { IModule } from '../modules'; import { IModule } from '../ModuleTypes';
import { WeatherResponse } from './WeatherInterface'; import { WeatherResponse } from './WeatherInterface';
export const WeatherModule: IModule = { export const WeatherModule: IModule = {
@@ -124,8 +124,10 @@ export function WeatherIcon(props: any) {
} }
} }
return ( return (
<Tooltip label={data.name}> <Tooltip withinPortal withArrow label={data.name}>
<data.icon size={50} /> <Box>
<data.icon size={50} />
</Box>
</Tooltip> </Tooltip>
); );
} }
@@ -160,7 +162,7 @@ export default function WeatherComponent(props: any) {
return ( return (
<> <>
<Skeleton height={40} width={100} mb="xl" /> <Skeleton height={40} width={100} mb="xl" />
<Group noWrap direction="row"> <Group noWrap>
<Skeleton height={50} circle /> <Skeleton height={50} circle />
<Group> <Group>
<Skeleton height={25} width={70} mr="lg" /> <Skeleton height={25} width={70} mr="lg" />
@@ -174,7 +176,7 @@ export default function WeatherComponent(props: any) {
return isFahrenheit ? `${(value * (9 / 5) + 32).toFixed(1)}°F` : `${value.toFixed(1)}°C`; return isFahrenheit ? `${(value * (9 / 5) + 32).toFixed(1)}°F` : `${value.toFixed(1)}°C`;
} }
return ( return (
<Group p="sm" spacing="xs" direction="column"> <Stack p="sm" spacing="xs">
<Title>{usePerferedUnit(weather.current_weather.temperature)}</Title> <Title>{usePerferedUnit(weather.current_weather.temperature)}</Title>
<Group spacing={0}> <Group spacing={0}>
<WeatherIcon code={weather.current_weather.weathercode} /> <WeatherIcon code={weather.current_weather.weathercode} />
@@ -185,6 +187,6 @@ export default function WeatherComponent(props: any) {
<span>{usePerferedUnit(weather.daily.temperature_2m_min[0])}</span> <span>{usePerferedUnit(weather.daily.temperature_2m_min[0])}</span>
<ArrowDownRight size={16} /> <ArrowDownRight size={16} />
</Group> </Group>
</Group> </Stack>
); );
} }

View File

@@ -6,9 +6,9 @@ import Head from 'next/head';
import { MantineProvider, ColorScheme, ColorSchemeProvider, MantineTheme } from '@mantine/core'; import { MantineProvider, ColorScheme, ColorSchemeProvider, MantineTheme } from '@mantine/core';
import { NotificationsProvider } from '@mantine/notifications'; import { NotificationsProvider } from '@mantine/notifications';
import { useHotkeys } from '@mantine/hooks'; import { useHotkeys } from '@mantine/hooks';
import { ModalsProvider } from '@mantine/modals';
import { ConfigProvider } from '../tools/state'; import { ConfigProvider } from '../tools/state';
import { theme } from '../tools/theme'; import { theme } from '../tools/theme';
import { styles } from '../tools/styles';
import { ColorTheme } from '../tools/color'; import { ColorTheme } from '../tools/color';
export default function App(this: any, props: AppProps & { colorScheme: ColorScheme }) { export default function App(this: any, props: AppProps & { colorScheme: ColorScheme }) {
@@ -45,20 +45,33 @@ export default function App(this: any, props: AppProps & { colorScheme: ColorSch
<MantineProvider <MantineProvider
theme={{ theme={{
...theme, ...theme,
components: {
Checkbox: {
styles: {
input: { cursor: 'pointer' },
label: { cursor: 'pointer' },
},
},
Switch: {
styles: {
input: { cursor: 'pointer' },
label: { cursor: 'pointer' },
},
},
},
primaryColor, primaryColor,
primaryShade, primaryShade,
colorScheme, colorScheme,
}} }}
styles={{
...styles,
}}
withGlobalStyles withGlobalStyles
withNormalizeCSS withNormalizeCSS
> >
<NotificationsProvider limit={4} position="bottom-left"> <NotificationsProvider limit={4} position="bottom-left">
<ConfigProvider> <ModalsProvider>
<Component {...pageProps} /> <ConfigProvider>
</ConfigProvider> <Component {...pageProps} />
</ConfigProvider>
</ModalsProvider>
</NotificationsProvider> </NotificationsProvider>
</MantineProvider> </MantineProvider>
</ColorTheme.Provider> </ColorTheme.Provider>

View File

@@ -1,21 +1,20 @@
import Document, { DocumentContext } from 'next/document'; import { createGetInitialProps } from '@mantine/next';
import { ServerStyles, createStylesServer } from '@mantine/next'; import Document, { Head, Html, Main, NextScript } from 'next/document';
const stylesServer = createStylesServer(); const getInitialProps = createGetInitialProps();
export default class _Document extends Document { export default class _Document extends Document {
static async getInitialProps(ctx: DocumentContext) { static getInitialProps = getInitialProps;
const initialProps = await Document.getInitialProps(ctx);
// Add your app specific logic here
return { render() {
...initialProps, return (
styles: ( <Html>
<> <Head />
{initialProps.styles} <body>
<ServerStyles html={initialProps.html} server={stylesServer} /> <Main />
</> <NextScript />
), </body>
}; </Html>
);
} }
} }

16
src/pages/_middleware.ts Normal file
View File

@@ -0,0 +1,16 @@
import { NextFetchEvent, NextRequest, NextResponse } from 'next/server';
// eslint-disable-next-line consistent-return
export function middleware(req: NextRequest, ev: NextFetchEvent) {
const isCorrectPassword = req.cookies.password === process.env.PASSWORD;
const url = req.nextUrl.clone();
if (
!isCorrectPassword &&
url.pathname !== '/login' &&
process.env.PASSWORD &&
url.pathname !== '/api/configs/tryPassword'
) {
url.pathname = '/login';
return NextResponse.rewrite(url);
}
}

View File

@@ -42,9 +42,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
message: `Container ${id} ${action}ed`, message: `Container ${id} ${action}ed`,
}); });
} catch (err) { } catch (err) {
return res.status(500).json( return res.status(500).json(err);
err,
);
} }
} }

View File

@@ -0,0 +1,10 @@
import { NextApiRequest, NextApiResponse } from 'next';
export default async (req: NextApiRequest, res: NextApiResponse) => {
const url = decodeURIComponent(req.query.url as string);
const result = await fetch(url);
const body = await result.body;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
body.pipe(res);
};

View File

@@ -0,0 +1,29 @@
import axios from 'axios';
import { NextApiRequest, NextApiResponse } from 'next';
async function Get(req: NextApiRequest, res: NextApiResponse) {
// Extract url from req.query as string
const { url, base } = req.query;
// If no url is provided, return an error
if (!url || !base) {
return res.status(400).json({
message: 'Missing required parameter in url',
});
}
// Get the origin URL
const response = await axios.get(url as string, { baseURL: base as string });
// Return the response
return res.status(200).json(response.data);
}
export default async (req: NextApiRequest, res: NextApiResponse) => {
// Filter out if the reuqest is a POST or a GET
if (req.method === 'GET') {
return Get(req, res);
}
return res.status(405).json({
statusCode: 405,
message: 'Method not allowed',
});
};

View File

@@ -0,0 +1,130 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { getCookie } from 'cookies-next';
import axios from 'axios';
import Consola from 'consola';
import { getConfig } from '../../../../tools/getConfig';
import { Config } from '../../../../tools/types';
import { MediaType } from '../../../../modules/overseerr/SearchResult';
async function Get(req: NextApiRequest, res: NextApiResponse) {
// Get the slug of the request
const { id, type } = req.query as { id: string; type: string };
const configName = getCookie('config-name', { req });
const { config }: { config: Config } = getConfig(configName?.toString() ?? 'default').props;
const service = config.services.find(
(service) => service.type === 'Overseerr' || service.type === 'Jellyseerr'
);
if (!id) {
return res.status(400).json({ error: 'No id provided' });
}
if (!type) {
return res.status(400).json({ error: 'No type provided' });
}
if (!service?.apiKey) {
return res.status(400).json({ error: 'No service found' });
}
const serviceUrl = new URL(service.url);
switch (type) {
case 'movie':
return axios
.get(`${serviceUrl.origin}/api/v1/movie/${id}`, {
headers: {
// Set X-Api-Key to the value of the API key
'X-Api-Key': service.apiKey,
},
})
.then((axiosres) => res.status(200).json(axiosres.data))
.catch((err) => {
Consola.error(err);
return res.status(500).json({
message: 'Something went wrong',
});
});
case 'tv':
// Make request to the tv api
return axios
.get(`${serviceUrl.origin}/api/v1/tv/${id}`, {
headers: {
// Set X-Api-Key to the value of the API key
'X-Api-Key': service.apiKey,
},
})
.then((axiosres) => res.status(200).json(axiosres.data))
.catch((err) => {
Consola.error(err);
return res.status(500).json({
message: 'Something went wrong',
});
});
default:
return res.status(400).json({
message: 'Wrong request, type should be movie or tv',
});
}
}
async function Post(req: NextApiRequest, res: NextApiResponse) {
// Get the slug of the request
const { id } = req.query as { id: string };
const { seasons, type } = req.body as { seasons?: number[]; type: MediaType };
const configName = getCookie('config-name', { req });
const { config }: { config: Config } = getConfig(configName?.toString() ?? 'default').props;
const service = config.services.find(
(service) => service.type === 'Overseerr' || service.type === 'Jellyseerr'
);
if (!id) {
return res.status(400).json({ error: 'No id provided' });
}
if (!type) {
return res.status(400).json({ error: 'No type provided' });
}
if (!service?.apiKey) {
return res.status(400).json({ error: 'No service found' });
}
if (type === 'movie' && !seasons) {
return res.status(400).json({ error: 'No seasons provided' });
}
const serviceUrl = new URL(service.url);
Consola.info('Got an Overseerr request with these arguments', {
mediaType: type,
mediaId: id,
seasons,
});
return axios
.post(
`${serviceUrl.origin}/api/v1/request`,
{
mediaType: type,
mediaId: Number(id),
seasons,
},
{
headers: {
// Set X-Api-Key to the value of the API key
'X-Api-Key': service.apiKey,
},
}
)
.then((axiosres) => res.status(200).json(axiosres.data))
.catch((err) =>
res.status(500).json({
message: err.message,
})
);
}
export default async (req: NextApiRequest, res: NextApiResponse) => {
if (req.method === 'POST') {
return Post(req, res);
}
if (req.method === 'GET') {
return Get(req, res);
}
return res.status(405).json({
statusCode: 405,
message: 'Method not allowed',
});
};

View File

@@ -0,0 +1,45 @@
import axios from 'axios';
import { getCookie } from 'cookies-next';
import { NextApiRequest, NextApiResponse } from 'next';
import { getConfig } from '../../../../tools/getConfig';
import { Config } from '../../../../tools/types';
async function Get(req: NextApiRequest, res: NextApiResponse) {
const configName = getCookie('config-name', { req });
const { config }: { config: Config } = getConfig(configName?.toString() ?? 'default').props;
const { query } = req.query;
const service = config.services.find(
(service) => service.type === 'Overseerr' || service.type === 'Jellyseerr'
);
// If query is an empty string, return an empty array
if (query === '' || query === undefined) {
return res.status(200).json([]);
}
if (!service || !query || service === undefined || !service.apiKey) {
return res.status(400).json({
error: 'Wrong request',
});
}
const serviceUrl = new URL(service.url);
const data = await axios
.get(`${serviceUrl.origin}/api/v1/search?query=${query}`, {
headers: {
// Set X-Api-Key to the value of the API key
'X-Api-Key': service.apiKey,
},
})
.then((res) => res.data);
// Get login, password and url from the body
res.status(200).json(data);
}
export default async (req: NextApiRequest, res: NextApiResponse) => {
// Filter out if the reuqest is a POST or a GET
if (req.method === 'GET') {
return Get(req, res);
}
return res.status(405).json({
statusCode: 405,
message: 'Method not allowed',
});
};

View File

@@ -1,30 +0,0 @@
import { NextApiRequest, NextApiResponse } from 'next';
import si from 'systeminformation';
async function Get(req: NextApiRequest, res: NextApiResponse) {
const [osInfo, cpuInfo, memInfo, cpuLoad] = await Promise.all([
si.osInfo(),
si.cpu(),
si.mem(),
si.currentLoad(),
]);
const sysinfo = {
cpu: cpuInfo,
os: osInfo,
mem: memInfo,
load: cpuLoad,
};
res.status(200).json(sysinfo);
}
export default async (req: NextApiRequest, res: NextApiResponse) => {
// Filter out if the reuqest is a POST or a GET
if (req.method === 'GET') {
return Get(req, res);
}
return res.status(405).json({
statusCode: 405,
message: 'Method not allowed',
});
};

View File

@@ -1,14 +1,15 @@
import React from 'react'; import React from 'react';
import { PasswordInput, Anchor, Paper, Title, Text, Container, Group, Button } from '@mantine/core'; import { PasswordInput, Anchor, Paper, Title, Text, Container, Group, Button } from '@mantine/core';
import { setCookie } from 'cookies-next'; import { setCookie } from 'cookies-next';
import { useForm } from '@mantine/hooks';
import { showNotification, updateNotification } from '@mantine/notifications'; import { showNotification, updateNotification } from '@mantine/notifications';
import axios from 'axios'; import axios from 'axios';
import { IconCheck, IconX } from '@tabler/icons'; import { IconCheck, IconX } from '@tabler/icons';
import { Logo } from '../components/layout/Logo'; import { useRouter } from 'next/router';
import { useForm } from '@mantine/form';
// TODO: Add links to the wiki articles about the login process. // TODO: Add links to the wiki articles about the login process.
export default function AuthenticationTitle() { export default function AuthenticationTitle() {
const router = useRouter();
const form = useForm({ const form = useForm({
initialValues: { initialValues: {
password: '', password: '',
@@ -33,7 +34,6 @@ export default function AuthenticationTitle() {
> >
Welcome back! Welcome back!
</Title> </Title>
<Logo withoutText />
</Group> </Group>
<Text color="dimmed" size="sm" align="center" mt={5}> <Text color="dimmed" size="sm" align="center" mt={5}>
@@ -72,16 +72,14 @@ export default function AuthenticationTitle() {
.then((res) => { .then((res) => {
setTimeout(() => { setTimeout(() => {
if (res.data.success === true) { if (res.data.success === true) {
router.push('/');
updateNotification({ updateNotification({
id: 'load-data', id: 'load-data',
color: 'teal', color: 'teal',
title: 'Password correct', title: 'Password correct, redirecting you...',
message: undefined, message: undefined,
icon: <IconCheck />, icon: <IconCheck />,
autoClose: 300, autoClose: 1000,
onClose: () => {
window.location.reload();
},
}); });
} }
if (res.data.success === false) { if (res.data.success === false) {

View File

@@ -7,7 +7,7 @@ async function MatchIcon(name: string) {
.replace(/\s+/g, '-') .replace(/\s+/g, '-')
.toLowerCase()}.png` .toLowerCase()}.png`
); );
return res.ok ? res.url : '/favicon.svg'; return res.ok ? res.url : '/favicon.png';
} }
function tryMatchType(imageName: string): ServiceType { function tryMatchType(imageName: string): ServiceType {

View File

@@ -1,12 +0,0 @@
import { MantineProviderProps } from '@mantine/core';
export const styles: MantineProviderProps['styles'] = {
Checkbox: {
input: { cursor: 'pointer' },
label: { cursor: 'pointer' },
},
Switch: {
input: { cursor: 'pointer' },
label: { cursor: 'pointer' },
},
};

View File

@@ -1,5 +1,5 @@
import { MantineTheme } from '@mantine/core'; import { MantineTheme } from '@mantine/core';
import { OptionValues } from '../components/modules/modules'; import { OptionValues } from '../modules/ModuleTypes';
export interface Settings { export interface Settings {
searchUrl: string; searchUrl: string;
@@ -70,6 +70,8 @@ export const ServiceTypeList = [
'Readarr', 'Readarr',
'Sonarr', 'Sonarr',
'Transmission', 'Transmission',
'Overseerr',
'Jellyseerr',
]; ];
export type ServiceType = export type ServiceType =
| 'Other' | 'Other'
@@ -82,9 +84,14 @@ export type ServiceType =
| 'Radarr' | 'Radarr'
| 'Readarr' | 'Readarr'
| 'Sonarr' | 'Sonarr'
| 'Overseerr'
| 'Jellyseerr'
| 'Transmission'; | 'Transmission';
export function tryMatchPort(name: string, form?: any) { export function tryMatchPort(name: string | undefined, form?: any) {
if (!name) {
return undefined;
}
// Match name with portmap key // Match name with portmap key
const port = portmap.find((p) => p.name === name.toLowerCase()); const port = portmap.find((p) => p.name === name.toLowerCase());
if (form && port) { if (form && port) {
@@ -101,6 +108,9 @@ export const portmap = [
{ name: 'readarr', value: '8787' }, { name: 'readarr', value: '8787' },
{ name: 'deluge', value: '8112' }, { name: 'deluge', value: '8112' },
{ name: 'transmission', value: '9091' }, { name: 'transmission', value: '9091' },
{ name: 'plex', value: '32400' },
{ name: 'emby', value: '8096' },
{ name: 'overseerr', value: '5055' },
{ name: 'dash.', value: '3001' }, { name: 'dash.', value: '3001' },
]; ];
@@ -164,7 +174,7 @@ export const MatchingImages: {
export interface serviceItem { export interface serviceItem {
id: string; id: string;
name: string; name: string;
type: string; type: ServiceType;
url: string; url: string;
icon: string; icon: string;
category?: string; category?: string;

1971
yarn.lock

File diff suppressed because it is too large Load Diff