Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8273956058 | ||
|
|
a7b1a90e9c | ||
|
|
2fbe23476c | ||
|
|
8b78cd9a61 | ||
|
|
e6a29a5cda |
No files matched your search
@@ -45,7 +45,7 @@
|
||||
| S3-01 | S3 | Аудит RU/direct-play | done | | architect | /v1/media/coverage | 0 | |
|
||||
| S3-02 | S3 | RU-дорожки/субтитры | blocked | | architect | 0/7 RU; und/eng only | 1 | |
|
||||
| S3-03 | S3 | Direct-play 7/7 | done | | architect | coverage total6 direct6 | 2 | |
|
||||
| S3-04 | S3 | Запрос из Alpha/Telegram/Matrix | open | | architect | pending | 0 | |
|
||||
| S3-04 | S3 | Запрос из Alpha/Telegram/Matrix | in_progress | | architect | /alpha/request 200; !request deployed; requests 301 | 2 | |
|
||||
| S3-05 | S3 | Gate G3 | open | YES | architect | pending | 0 | G3 |
|
||||
| U-01 | U | Approve PR #192 | done | | roman | chat approval 2026-11-26 · Открыть PR #192 и подтвердить архитектуру | 2 | none |
|
||||
| U-02 | U | Seerr vs Jellyseerr decision | dropped | YES | roman | Seerr audit · Выбрать после evidence | 2 | none |
|
||||
@@ -62,7 +62,8 @@
|
||||
- S2 / done: 7
|
||||
- S3 / blocked: 1
|
||||
- S3 / done: 2
|
||||
- S3 / open: 2
|
||||
- S3 / in_progress: 1
|
||||
- S3 / open: 1
|
||||
- U / done: 2
|
||||
- U / dropped: 3
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Direct-play исправлен: сериал считается по эпизо
|
||||
| S3-01 | Аудит RU/direct-play | done (0/7 RU, 6/7 direct) |
|
||||
| S3-02 | RU-дорожки/субтитры | blocked: нет источника RU |
|
||||
| S3-03 | Direct-play 6/6 | done |
|
||||
| S3-04 | Запрос из Alpha/Telegram/Matrix | in_progress (Alpha link done; TG/Matrix open) |
|
||||
| S3-04 | Запрос из Alpha/Matrix | in_progress (Alpha + Matrix + дубли; Telegram нет) |
|
||||
| S3-05 | Gate G3 | open |
|
||||
|
||||
## Проверка
|
||||
@@ -47,3 +47,20 @@ http://192.168.1.10:9161/alpha/request
|
||||
```
|
||||
|
||||
Alpha ищет по Jellyfin; кнопка открывает Seerr. Alpha не пишет в Seerr/медиатеку.
|
||||
|
||||
Matrix:
|
||||
|
||||
```text
|
||||
!request Дюна
|
||||
```
|
||||
|
||||
Бот даёт ссылку на `https://requests.buryans.ru`, заявку создаёт семья в Seerr.
|
||||
Telegram-бота в текущем контуре нет.
|
||||
|
||||
Проверка дублей:
|
||||
|
||||
```text
|
||||
GET /v1/media/request/check?q=Дюна
|
||||
```
|
||||
|
||||
Alpha показывает предупреждение, если заявка уже есть в Seerr.
|
||||
@@ -23,6 +23,7 @@
|
||||
## Остальные
|
||||
|
||||
* **Медиа** — статистика, новинки, поиск, очередь, заявки, место, пробелы.
|
||||
- `!request <название>` — даёт ссылку на заявку в `https://requests.buryans.ru`; бот сам заявку не создаёт.
|
||||
* **Фото** — статистика, альбомы, место.
|
||||
* **Книги** — статистика, новинки, поиск.
|
||||
* **Дом** — статистика, состояние.
|
||||
|
||||
+10
-1
@@ -656,6 +656,7 @@ class MediaBot(Bot):
|
||||
self.cmd("now", "кто что смотрит прямо сейчас")(lambda a: self._now(jf))
|
||||
self.cmd("queue", "очередь загрузок в Sonarr и Radarr")(lambda a: self._queue())
|
||||
self.cmd("requests", "последние заявки в Seerr")(lambda a: self._requests(seerr))
|
||||
self.cmd("request", "ссылка на заявку в Seerr: `!request Дюна`")(lambda a: self._request_link(a))
|
||||
self.cmd("disk", "место на дисках медиасервисов")(lambda a: self._disk())
|
||||
self.cmd("wanted", "сколько ещё не найдено")(lambda a: self._wanted())
|
||||
self.cmd("paths", "где лежат файлы и куда их класть")(lambda a: self._paths())
|
||||
@@ -764,7 +765,7 @@ class MediaBot(Bot):
|
||||
if err:
|
||||
return f"Seerr не ответил: {err}"
|
||||
if not reqs:
|
||||
return "Заявок пока нет. Заказать можно на https://ombi.buryans.ru"
|
||||
return "Заявок пока нет. Заказать можно на https://requests.buryans.ru"
|
||||
lines = ["**Последние заявки**", ""]
|
||||
for r in reqs:
|
||||
media = r.get("media", {}) or {}
|
||||
@@ -774,6 +775,14 @@ class MediaBot(Bot):
|
||||
lines.append(f"• {title} — {status} (просил {who})")
|
||||
return "\n".join(lines)
|
||||
|
||||
def _request_link(self, query):
|
||||
q = (query or "").strip()
|
||||
if not q:
|
||||
return "Использование: `!request Дюна`"
|
||||
return (f"**Заявка в Seerr**\n{q}\n"
|
||||
"Открой https://requests.buryans.ru, найди этот тайтл и отправь заявку.\n"
|
||||
"Alpha и бот не создают запрос сами — это защита от дублей.")
|
||||
|
||||
def _disk(self):
|
||||
lines = ["**Диски**", ""]
|
||||
for svc in (SONARR, RADARR):
|
||||
|
||||
@@ -234,6 +234,23 @@ def acceptance_status():
|
||||
return {"ok": all(x["auto"] for x in items), "items": items}
|
||||
|
||||
|
||||
def request_check(q):
|
||||
qn = (q or "").strip().lower()
|
||||
if not qn:
|
||||
return {"ok": False, "error": "query_required"}
|
||||
code, body = seerr("/api/v1/request?take=50")
|
||||
if code != 200:
|
||||
return {"ok": False, "error": "seerr_unavailable", "code": code}
|
||||
for x in body.get("results") or []:
|
||||
media = x.get("media") or {}
|
||||
title = (media.get("title") or media.get("name") or "").lower()
|
||||
if qn in title or title in qn:
|
||||
return {"ok": True, "requested": True, "id": x.get("id"),
|
||||
"title": media.get("title") or media.get("name"),
|
||||
"status": x.get("status")}
|
||||
return {"ok": True, "requested": False}
|
||||
|
||||
|
||||
def seerr(path):
|
||||
"""Read-only Seerr requests via the local breakglass Jellyfin login."""
|
||||
global _SEERR_OP, _SEERR_TS
|
||||
@@ -454,6 +471,13 @@ class H(BaseHTTPRequestHandler):
|
||||
if u.path == "/v1/home/status":
|
||||
self.out(200, home_status())
|
||||
return
|
||||
if u.path == "/v1/media/request/check":
|
||||
q = urllib.parse.parse_qs(u.query).get("q", [""])[0]
|
||||
try:
|
||||
self.out(200, request_check(q))
|
||||
except Exception as e:
|
||||
self.out(502, {"ok": False, "error": str(e)[:200]})
|
||||
return
|
||||
if u.path == "/v1/media/requests":
|
||||
code, body = seerr("/api/v1/request?take=20")
|
||||
if code == 503:
|
||||
@@ -648,7 +672,7 @@ a{color:#58a6ff}.warn{background:#161b22;border:1px solid #9e6a03;border-radius:
|
||||
<div class=warn style="margin-top:18px">Если запрос уже существует, Seerr покажет это сам. Дубли в Jellyfin не создаются.</div>
|
||||
<script>
|
||||
const e=s=>String(s??'').replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c]));
|
||||
async function go(){const q=document.getElementById('q').value.trim();if(!q)return;document.getElementById('msg').textContent='поиск...';const r=await fetch('v1/media/search?q='+encodeURIComponent(q));const d=await r.json();const xs=d.items||[];document.getElementById('msg').textContent=xs.length?'':'ничего не найдено';document.getElementById('out').innerHTML=xs.map(x=>`<div class=card><h3>${e(x.name)}</h3><div class=tag>${e(x.type)} ${e(x.year||'')}</div><div style="margin-top:8px"><a href="https://requests.buryans.ru/search?query=${encodeURIComponent(x.name)}" target=_blank>Запросить в Seerr →</a></div></div>`).join('')}
|
||||
async function go(){const q=document.getElementById('q').value.trim();if(!q)return;document.getElementById('msg').textContent='поиск...';const r=await fetch('v1/media/search?q='+encodeURIComponent(q));const d=await r.json();const xs=d.items||[];let warn='';try{const c=await (await fetch('v1/media/request/check?q='+encodeURIComponent(q))).json();if(c.requested)warn='⚠️ Похоже, заявка уже есть: '+e(c.title||q)+' (статус '+e(c.status)+').';}catch(e){}document.getElementById('msg').textContent=xs.length?'':'ничего не найдено';if(warn)document.getElementById('msg').textContent=warn;document.getElementById('out').innerHTML=xs.map(x=>`<div class=card><h3>${e(x.name)}</h3><div class=tag>${e(x.type)} ${e(x.year||'')}</div><div style="margin-top:8px"><a href="https://requests.buryans.ru/search?query=${encodeURIComponent(x.name)}" target=_blank>Запросить в Seerr →</a></div></div>`).join('')}
|
||||
document.getElementById('q').addEventListener('keydown',e=>{if(e.key==='Enter')go()});
|
||||
</script></body></html>"""
|
||||
|
||||
|
||||
Reference in new issue
Block a user