Aller au contenu
Skillpedia
Bases de données12k · #11481

database-operation

Ce qu’il fait

Cette compétence permet à l'IA d'interroger et de maintenir la base de données MoviePilot grâce à un outil d'aide fourni, sans mettre de mots de passe dans la discussion. Elle s'adresse aux administrateurs MoviePilot qui ont besoin de vérifications ou de nettoyages de données.

Quand l’utiliser

  • ✓Quand vous voulez des comptes ou des statistiques de la base de données MoviePilot.
  • ✓Quand un enregistrement bloqué doit être inspecté ou qu'un nettoyage précis doit être effectué.
  • ✓Quand vous voulez que l'IA vérifie le contenu des tables avant toute modification.

Lien du skill

https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Peux-tu compter le nombre d'enregistrements dans la base de données MoviePilot et lister les tables ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'IA lance un script d'aide fourni qui lit les réglages locaux de MoviePilot, se connecte à la base de données et renvoie les résultats.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Database Operation

All script paths are relative to this skill file.

Use scripts/mp-db.py for all database access. Do not extract database passwords, API tokens, or full PostgreSQL DSNs from the prompt. The script reads MoviePilot local settings and connects to SQLite or PostgreSQL internally.

Scope And Boundaries

This skill is the direct SQL boundary. It is implemented as a Python script and is appropriate when the agent must inspect records, run data statistics, repair stuck state, or perform an explicitly requested database update.

Run the bundled copy from the MoviePilot program directory with its project runtime, for example:

cd <MOVIEPILOT_ROOT>
python skills/database-operation/scripts/mp-db.py tables

The Agent command environment routes python to the project-specific moviepilot-python entry when available and falls back to the project or Docker VENV_PATH Python otherwise.

The runtime sets MOVIEPILOT_ROOT for copied skills. If you run a copied script directly from <CONFIG_PATH>/agent/skills/, set that variable to the program directory first; otherwise the helper reports how to relocate it. Use the project runtime instead of a system python3.

Prefer safer product surfaces first:

Request Preferred skill
Normal MoviePilot product operation moviepilot-api structured operations
Operation outside the structured API catalog A more specific Skill or explicit unsupported result
Slash commands or plugin/system command dispatch command-dispatch
Manual file organization organize-files
Retry failed transfer history records transfer-failed-retry

Use this skill as the final fallback for data access or mutation. It may run SELECT, INSERT, UPDATE, DELETE, and schema-changing statements through the bundled script, but broad or destructive writes still require explicit user authorization.

System settings have two managed sources and should not normally be edited here:

  • Runtime Settings variables are queried and updated by moviepilot-api operations config.system.get / config.system.update; updates perform type conversion and persist to app.env.
  • SystemConfigKey values are stored in the database systemconfig table, but the same API operations must be preferred because they enforce registered keys, plugin mutation admission, value normalization, secret redaction, and configuration-change events.

Use direct SQL against systemconfig only for an explicitly authorized repair when the managed API cannot complete the operation. The script blocks any statement that references systemconfig until you pass --show-secrets, so inspect the exact row first, avoid broad writes, and verify the managed API can read the repaired value.

Commands

List tables:

python scripts/mp-db.py tables

Show table schema:

python scripts/mp-db.py schema downloadhistory

Run a read query:

python scripts/mp-db.py query "SELECT COUNT(*) AS total FROM downloadhistory"

Read SQL from stdin or a file:

python scripts/mp-db.py query --file /path/to/query.sql

Run a write statement:

python scripts/mp-db.py write "UPDATE subscribe SET state = 'S' WHERE id = 123"

query --write is also supported for compatibility, but prefer the write subcommand for INSERT, UPDATE, DELETE, and schema changes.

SQLite also checks the actual table accesses while executing each statement, including single-quoted table names and reads through views. The temporary authorizer is removed when that statement finishes. PostgreSQL retains the identifier check described below.

Statements that reference systemconfig are rejected until you add --show-secrets, in read and write mode alike:

python scripts/mp-db.py query "SELECT key, value FROM systemconfig WHERE key = 'TMDB_API_KEY'" --show-secrets

The gate is per table, not per column, so even a count or key listing over systemconfig needs the flag. Read normal settings through moviepilot-api config.system.get instead, which redacts secrets for you, and pass the flag only for an explicitly authorized repair.

Workflow

  1. Prefer existing MoviePilot tools or APIs for normal product workflows.
  2. Use this skill for direct database inspection only when no existing tool covers the request.
  3. For unknown schema, run tables first, then schema <table>.
  4. For SELECT queries, execute directly with a narrow project
Questions fréquentes

A-t-elle besoin de mon mot de passe de base de données ?

Non. L'outil d'aide lit lui-même les réglages locaux de MoviePilot, donc les mots de passe n'ont pas besoin d'être dans la demande.

Quelles bases de données prend-elle en charge ?

Elle se connecte à SQLite ou PostgreSQL, selon la configuration de MoviePilot.

Faut-il l'utiliser pour les tâches courantes ?

Non. La compétence conseille d'utiliser d'abord les outils MoviePilot plus sûrs, et l'accès direct à la base seulement s'ils ne peuvent pas faire le travail.

Détails

Description originale de l’auteur

Use this skill when you need to inspect, query, maintain, or carefully modify the MoviePilot database. This skill uses the bundled scripts/mp-db.py helper, which reads MoviePilot local settings itself and never requires database passwords or full PostgreSQL DSNs in the agent prompt. Applicable scenarios include data statistics, counts, aggregations, inspecting or fixing records, cleanup requests, and questions like "how many downloads", "show site stats", "delete old records", or "why is this subscription stuck".

repo: jxxghp/MoviePilot

Popularité

Étoiles GitHub
12k
Position au classement
#11481
Licence
GPL-3.0
Mis à jour
01/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires