Compare commits

..
Author SHA1 Message Date
architect 8273956058 [STAGE3] Duplicate check before Seerr request
lint / hygiene (pull_request) Waiting to run
lint / hygiene (push) Waiting to run
standard / check (pull_request) Waiting to run
standard / check (push) Waiting to run
2026-11-27 11:34:55 +03:00
architect a7b1a90e9c [STAGE3] Tracker: Alpha/Matrix request paths
lint / hygiene (pull_request) Waiting to run
standard / check (pull_request) Waiting to run
lint / hygiene (push) Failing after 28s
2026-11-27 11:33:15 +03:00
architect 2fbe23476c [STAGE3] Matrix/Alpha request paths documented
lint / hygiene (push) Failing after 26s
lint / hygiene (pull_request) Failing after 35s
standard / check (pull_request) Successful in 18s
2026-11-27 11:32:56 +03:00
3 changed files with 44 additions and 3 deletions

No files matched your search

+1 -1
View File
@@ -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 | in_progress | | architect | /alpha/request 200; Seerr handoff link | 1 | |
| 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 |
+18 -1
View File
@@ -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.
+25 -1
View File
@@ -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=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[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>"""