import Link from "next/link"; import { IconPlayerPlay, IconPlus, IconTrash } from "@sakaniui/react/icons"; import { notFound } from "next/navigation"; import { autoRuleService } from "@/modules/albums/auto-rules"; import { db } from "@/db/client"; import { editorialAccounts } from "@/db/schema"; import { eq } from "drizzle-orm"; import { Button } from "@/components/ui/button"; import { EmptyState, Input } from "@/components/ui/sakani"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { PageHeader } from "@/components/ui/page-header"; import { requireAdminPage } from "../../../access"; import { applyAutoRulesAction, createAutoRuleAction, deleteAutoRuleAction } from "./actions"; type AutoRulesPageProps = Readonly<{ params: Promise<{ id: string }>; }>; export default async function AutoRulesPage({ params }: AutoRulesPageProps) { await requireAdminPage(); const { id } = await params; const [editorial] = await db .select() .from(editorialAccounts) .where(eq(editorialAccounts.id, id)); if (!editorial) { notFound(); } const rules = await autoRuleService.listRules(id); return (
Neue Regel hinzufügen Alben, deren Name eines der folgenden Schlüsselwörter enthält, werden dieser Redaktion automatisch zugewiesen, sobald sie von Immich synchronisiert werden.
Bestehende Regeln Alle derzeit aktiven automatischen Zuweisungen.
{rules.length === 0 ? ( ) : (
    {rules.map((rule) => (
  • {rule.keyword} Erstellt am {new Date(rule.createdAt).toLocaleDateString('de-DE')}
  • ))}
)}
); }