- Nouvelle table `torrent_downloads` pour suivre les téléchargements gérés - API : endpoint POST /torrent-downloads/notify (webhook optionnel) et GET /torrent-downloads - Poller background toutes les 30s qui interroge qBittorrent pour détecter les torrents terminés — aucune config "run external program" nécessaire - Import automatique : déplacement des fichiers vers la série cible, renommage selon le pattern existant (détection de la largeur des digits), support packs multi-volumes, scan job déclenché après import - Page /downloads dans le backoffice : filtres, auto-refresh, carte par download - Toggle auto-import intégré dans la card qBittorrent des settings - Erreurs de détection download affichées dans le détail des jobs - Volume /downloads monté dans docker-compose Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
807 B
TypeScript
39 lines
807 B
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
export function NavLink({
|
|
href,
|
|
title,
|
|
children,
|
|
}: {
|
|
href: string;
|
|
title?: string;
|
|
children: React.ReactNode;
|
|
}) {
|
|
const pathname = usePathname();
|
|
const isActive = pathname === href || (href !== "/" && pathname.startsWith(href));
|
|
|
|
return (
|
|
<Link
|
|
href={href as "/"}
|
|
title={title}
|
|
className={`
|
|
flex items-center
|
|
px-2 lg:px-3 py-2
|
|
rounded-lg
|
|
text-sm font-medium
|
|
transition-colors duration-200
|
|
active:scale-[0.98]
|
|
${isActive
|
|
? "text-primary bg-primary/10 hover:bg-primary/15"
|
|
: "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
}
|
|
`}
|
|
>
|
|
{children}
|
|
</Link>
|
|
);
|
|
}
|