database-operation
ما الذي تفعله
يتيح لوكيل الذكاء الاصطناعي الاستعلام عن قاعدة بيانات MoviePilot وصيانتها عبر أداة مساعدة مرفقة، دون وضع كلمات المرور في المحادثة. وهي مناسبة لمديري MoviePilot الذين يحتاجون إلى فحص البيانات أو تنظيفها.
متى تستخدمها
- ✓عندما تريد أعدادا أو إحصاءات من قاعدة بيانات MoviePilot.
- ✓عندما يحتاج سجل عالق إلى فحص أو تنظيف محدد.
- ✓عندما تريد أن يتحقق الوكيل من محتويات الجداول قبل إجراء أي تغيير.
رابط المهارة
https://github.com/jxxghp/MoviePilot/blob/v3/skills/database-operation/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل تستطيع عدّ السجلات في قاعدة بيانات MoviePilot وسرد الجداول؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يشغّل الوكيل سكربتا مساعدا مرفقا يقرأ إعدادات MoviePilot المحلية، ويتصل بقاعدة البيانات، ويعيد النتائج.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من 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
Settingsvariables are queried and updated bymoviepilot-apioperationsconfig.system.get/config.system.update; updates perform type conversion and persist toapp.env. SystemConfigKeyvalues are stored in the databasesystemconfigtable, 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
- Prefer existing MoviePilot tools or APIs for normal product workflows.
- Use this skill for direct database inspection only when no existing tool covers the request.
- For unknown schema, run
tablesfirst, thenschema <table>. - For
SELECTqueries, execute directly with a narrow project
الأسئلة الشائعة
هل أحتاج إلى كلمة مرور قاعدة البيانات؟
لا. تقرأ الأداة المساعدة إعدادات MoviePilot المحلية بنفسها، فلا حاجة لكتابة كلمات المرور في الطلب.
أي قواعد بيانات تدعم؟
تتصل بـ SQLite أو PostgreSQL، حسب إعداد MoviePilot.
هل أستخدمها للمهام العادية؟
لا. تنصح المهارة باستخدام أدوات MoviePilot الأكثر أمانا أولا، والوصول المباشر لقاعدة البيانات فقط عندما لا تكفي تلك الأدوات.
التفاصيل
الوصف الأصلي من المؤلف
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
الشعبية
- نجوم GitHub
- 12k
- الترتيب
- #11481
- الترخيص
- GPL-3.0
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
anysearch
12kيساعد وكيلك على البحث في الويب فوريا، والاستعلام من مصادر متخصصة مثل المالية والبيانات الأكاديمية، وقراءة صفحات الويب كاملة.
browser-use
12kيساعد وكيلك على فتح صفحات الويب وقراءتها والنقر على الأزرار وملء النماذج وأخذ لقطات شاشة للتحقق من النتائج.
command-dispatch
12kيساعد وكيلك على إيجاد أوامر MoviePilot النظامية أو الخاصة بالإضافات وتشغيلها من طلبك، بعد التحقق من وجودها.
create-moviepilot-plugin
12kيساعد وكيلك على إنشاء إضافة MoviePilot أو إصلاحها، باستخدام تخطيط الملفات والإعداد الصحيحين لإصدار MoviePilot.
مهارات مشابهة
discrawl
394kيتيح لوكيلك البحث في أرشيف محلي محفوظ لرسائل Discord وتلخيصه، والتحقق من مدى حداثته، وقراءة الرسائل المباشرة.
clickhouse-io
280kيساعد وكيلك على تحسين الاستعلامات والمخططات في ClickHouse وتطبيق أفضل ممارسات التحليل عالي الأداء، ويفيد عندما تكون الاستعلامات التحليلية بطيئة.
scientific-db-pubmed-database
280kيساعد وكيلك على البحث عن المقالات العلمية في المجال الطبي الحيوي. مفيد للبحوث التي تحتاج إلى معلومات طبية محددة.