Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
304db34ac2 | ||
|
|
6ab94962ac | ||
|
|
8940671aa3 | ||
|
|
f57684399c | ||
|
|
64e3c95667 | ||
|
|
5ff027fc42 | ||
|
|
e6fc2cb3aa | ||
|
|
2f0017a663 | ||
|
|
46761c0142 | ||
|
|
a221d71971 | ||
|
|
50c31091b2 | ||
|
|
9340263940 |
No files matched your search
@@ -39,9 +39,14 @@
|
||||
| S2-02 | S2 | Outbox schema + enqueue | done | | architect | ops/events/schema.sql; enqueue | 0 | |
|
||||
| S2-03 | S2 | Inbox + effects idempotency | done | | architect | repeat_test 100→1 | 0 | |
|
||||
| S2-04 | S2 | NATS JetStream relay | done | | architect | enqueue1 relayed1 processed1; inbox/effects 1 | 1 | |
|
||||
| S2-05 | S2 | Adapters + ownership matrix | open | | architect | pending | 0 | |
|
||||
| S2-06 | S2 | pgvector pilot | open | | architect | pending | 0 | |
|
||||
| S2-07 | S2 | Gate G2 proof | open | YES | architect | pending | 0 | G2 |
|
||||
| S2-05 | S2 | Adapters + ownership matrix | done | | architect | pipeline active; jellyfin 7 events; ownership.yaml | 3 | |
|
||||
| S2-06 | S2 | pgvector pilot | done | | architect | nearest pilot-a, top2 pilot-a/pilot-c | 1 | |
|
||||
| S2-07 | S2 | Gate G2 proof | done | YES | architect | 100→1; loss recovered | 1 | G2 |
|
||||
| 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 | in_progress | | architect | 6/7 direct | 1 | |
|
||||
| S3-04 | S3 | Запрос из Alpha/Telegram/Matrix | open | | architect | pending | 0 | |
|
||||
| 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 |
|
||||
| U-03 | U | RAM/GPU/disk data | dropped | YES | roman | resource baseline · Прислать/подтвердить параметры | 2 | none |
|
||||
@@ -54,14 +59,17 @@
|
||||
- M / done: 7
|
||||
- S0 / done: 10
|
||||
- S1 / done: 10
|
||||
- S2 / done: 4
|
||||
- S2 / open: 3
|
||||
- S2 / done: 7
|
||||
- S3 / blocked: 1
|
||||
- S3 / done: 1
|
||||
- S3 / in_progress: 1
|
||||
- S3 / open: 2
|
||||
- U / done: 2
|
||||
- U / dropped: 3
|
||||
|
||||
## Пользовательская очередь
|
||||
|
||||
- **S2-07** — Gate G2 proof:
|
||||
- **S3-05** — Gate G3:
|
||||
- **U-02** — Seerr vs Jellyseerr decision: Выбрать после evidence
|
||||
- **U-03** — RAM/GPU/disk data: Прислать/подтвердить параметры
|
||||
- **U-04** — Approve Stage1 write actions: Разрешить только после Gate G1
|
||||
@@ -18,8 +18,8 @@ Gate G2: повтор события 100 раз = один эффект; пот
|
||||
| S2-02 | Outbox schema + enqueue | done |
|
||||
| S2-03 | Inbox + effects idempotency | done |
|
||||
| S2-04 | NATS JetStream relay | done |
|
||||
| S2-05 | Adapters contract + ownership matrix | in_progress |
|
||||
| S2-06 | pgvector pilot | open |
|
||||
| S2-05 | Adapters: Audit360/Jellyfin/Seerr | done |
|
||||
| S2-06 | pgvector pilot | done (synthetic infrastructure) |
|
||||
| S2-07 | Gate G2 proof | done |
|
||||
|
||||
## Проверка
|
||||
@@ -65,6 +65,47 @@ Consumer: `buryans-worker`
|
||||
}
|
||||
```
|
||||
|
||||
## pgvector pilot
|
||||
|
||||
```json
|
||||
{"extension":"vector","pilot":"synthetic-3d","nearest":"pilot-a","top2":["pilot-a","pilot-c"]}
|
||||
```
|
||||
|
||||
Важно: это инфраструктурный пилот, не production semantic search.
|
||||
|
||||
## Durable pipeline
|
||||
|
||||
Сервис:
|
||||
|
||||
```text
|
||||
events-pipeline.service
|
||||
```
|
||||
|
||||
Делает:
|
||||
|
||||
1. Audit 360 adapter → outbox;
|
||||
2. outbox → NATS JetStream;
|
||||
3. NATS → idempotent inbox/effects;
|
||||
4. повторяет каждые 5 секунд.
|
||||
|
||||
Факт:
|
||||
|
||||
```text
|
||||
outbox published = 43
|
||||
pending = 0
|
||||
inbox = 46
|
||||
effects = 45
|
||||
```
|
||||
|
||||
## Adapters
|
||||
|
||||
- Audit 360 — real;
|
||||
- Jellyfin — real, 7 events emitted and consumed;
|
||||
- Seerr — real read-only session adapter (0 requests currently, valid empty).
|
||||
|
||||
Примечание: `rag` в SQL_ASCII, поэтому кириллица в payload передаётся
|
||||
как `title_utf8_b64`; ASCII-поле `title_ascii` остаётся для совместимости.
|
||||
|
||||
## Следующий инкремент
|
||||
|
||||
NATS JetStream:
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Stage 3 — Media Product
|
||||
|
||||
Статус: начат 2026-11-27.
|
||||
Gate G3: семья делает запрос → смотрит с RU-озвучкой; 0 дублей.
|
||||
|
||||
## Факт на старте
|
||||
|
||||
Jellyfin:
|
||||
|
||||
```text
|
||||
всего медиа 6
|
||||
RU audio 0
|
||||
RU субтитры 0
|
||||
direct-play 6
|
||||
```
|
||||
|
||||
Direct-play исправлен: сериал считается по эпизодам, BoxSet исключён из playable-медиа.
|
||||
|
||||
Это честный gap, не «всё хорошо».
|
||||
|
||||
## Задачи
|
||||
|
||||
| Код | Задача | Статус |
|
||||
|---|---|---|
|
||||
| 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 | open |
|
||||
| S3-05 | Gate G3 | open |
|
||||
|
||||
## Проверка
|
||||
|
||||
```text
|
||||
http://192.168.1.10:9161/alpha/acceptance
|
||||
```
|
||||
|
||||
Карточка «RU-озвучка» сейчас **FAIL** — специально, пока нет RU-дорожек.
|
||||
|
||||
```text
|
||||
GET /v1/media/coverage
|
||||
```
|
||||
@@ -24,6 +24,16 @@ Consumer: `buryans-worker`
|
||||
- 100 workers same event → `first_effects=1`, `effects=1`.
|
||||
- NATS e2e: 1 outbox → 1 published → 1 inbox → 1 effect.
|
||||
|
||||
## Durable service
|
||||
|
||||
```text
|
||||
events-pipeline.service
|
||||
```
|
||||
|
||||
Adapter Audit 360 → outbox → NATS → inbox/effects, tick 5s.
|
||||
|
||||
SQL_ASCII note: Cyrillic title is carried as `title_utf8_b64`.
|
||||
|
||||
## Next
|
||||
|
||||
- durable consumer/scheduler service;
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
"""Polling adapters for the Stage 2 event fabric."""
|
||||
import base64
|
||||
import http.cookiejar
|
||||
import json
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
from event_store import enqueue, event
|
||||
|
||||
|
||||
def _ascii_text(value):
|
||||
return value.encode("ascii", "ignore").decode("ascii")
|
||||
|
||||
|
||||
def _utf8_b64(value):
|
||||
return base64.b64encode(value.encode("utf-8")).decode("ascii")
|
||||
|
||||
|
||||
def _iso(dt):
|
||||
if isinstance(dt, str):
|
||||
return dt
|
||||
return dt.astimezone(timezone.utc).isoformat()
|
||||
|
||||
|
||||
def seerr_requests(conn):
|
||||
"""Read-only Seerr request adapter using the local breakglass session."""
|
||||
base = "http://192.168.1.121:5055"
|
||||
lines = Path("/root/.jellyfin-breakglass").read_text().splitlines()
|
||||
user = next(x.split("=", 1)[1] for x in lines if x.startswith("username="))
|
||||
pw = next(x.split("=", 1)[1] for x in lines if x.startswith("password="))
|
||||
cj = http.cookiejar.CookieJar()
|
||||
op = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
|
||||
login = urllib.request.Request(
|
||||
base + "/api/v1/auth/jellyfin",
|
||||
data=json.dumps({"username": user, "password": pw}).encode(),
|
||||
headers={"Content-Type": "application/json"}, method="POST")
|
||||
try:
|
||||
with op.open(login, timeout=8) as r:
|
||||
if r.status != 200:
|
||||
return 0
|
||||
req = urllib.request.Request(base + "/api/v1/request?take=50",
|
||||
headers={"Accept": "application/json"})
|
||||
with op.open(req, timeout=8) as r:
|
||||
data = json.load(r)
|
||||
except Exception:
|
||||
return 0
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("select cursor from events.adapter_state where adapter='seerr'")
|
||||
row = cur.fetchone()
|
||||
cursor = row[0] if row and row[0] else "1970-01-01T00:00:00Z"
|
||||
emitted = 0
|
||||
last = cursor
|
||||
for x in data.get("results") or []:
|
||||
stamp = x.get("updatedAt") or x.get("createdAt") or ""
|
||||
if not stamp or stamp <= cursor:
|
||||
continue
|
||||
ev = event(idempotency_key="seerr:request:%s:%s" % (x.get("id"), stamp),
|
||||
source="seerr", type_="media.request.created",
|
||||
subject=str(x.get("id")),
|
||||
data={"id": x.get("id"), "status": x.get("status"),
|
||||
"tmdbId": (x.get("media") or {}).get("tmdbId")})
|
||||
if enqueue(conn, ev):
|
||||
emitted += 1
|
||||
if stamp > last:
|
||||
last = stamp
|
||||
if emitted:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("""
|
||||
insert into events.adapter_state(adapter,cursor,updated_at)
|
||||
values ('seerr',%s,now())
|
||||
on conflict (adapter) do update
|
||||
set cursor=excluded.cursor, updated_at=now()
|
||||
""", (last,))
|
||||
conn.commit()
|
||||
return emitted
|
||||
|
||||
|
||||
def jellyfin_media(conn, limit=50):
|
||||
"""Emit media.work.added for newly created Jellyfin items."""
|
||||
key = Path("/root/.jellyfin-key").read_text().strip()
|
||||
qs = urllib.parse.urlencode({
|
||||
"SortBy": "DateCreated", "SortOrder": "Descending",
|
||||
"IncludeItemTypes": "Movie,Series", "Recursive": "true",
|
||||
"Limit": str(limit), "Fields": "DateCreated,ProductionYear,Overview",
|
||||
})
|
||||
req = urllib.request.Request(
|
||||
"http://192.168.1.103:8096/Items?" + qs,
|
||||
headers={"Authorization": 'MediaBrowser Token="%s"' % key,
|
||||
"Accept": "application/json"})
|
||||
with urllib.request.urlopen(req, timeout=10) as r:
|
||||
data = json.load(r)
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("select cursor from events.adapter_state where adapter='jellyfin'")
|
||||
row = cur.fetchone()
|
||||
cursor = row[0] if row and row[0] else "1970-01-01T00:00:00Z"
|
||||
emitted = 0
|
||||
last = cursor
|
||||
for item in data.get("Items") or []:
|
||||
created = item.get("DateCreated") or ""
|
||||
if created <= cursor:
|
||||
continue
|
||||
name = item.get("Name") or ""
|
||||
ev = event(idempotency_key="jellyfin:work:" + item.get("Id", ""),
|
||||
source="jellyfin", type_="media.work.added",
|
||||
subject=item.get("Id"),
|
||||
data={"id": item.get("Id"), "type": item.get("Type"),
|
||||
"year": item.get("ProductionYear"),
|
||||
"title_ascii": _ascii_text(name),
|
||||
"title_utf8_b64": _utf8_b64(name)})
|
||||
if enqueue(conn, ev):
|
||||
emitted += 1
|
||||
if created > last:
|
||||
last = created
|
||||
if emitted:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("""
|
||||
insert into events.adapter_state(adapter,cursor,updated_at)
|
||||
values ('jellyfin',%s,now())
|
||||
on conflict (adapter) do update
|
||||
set cursor=excluded.cursor, updated_at=now()
|
||||
""", (last,))
|
||||
conn.commit()
|
||||
return emitted
|
||||
|
||||
|
||||
def audit360(conn, limit=100):
|
||||
"""Emit one event per changed Audit 360 item."""
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("select cursor from events.adapter_state where adapter='audit360'")
|
||||
row = cur.fetchone()
|
||||
cursor = row[0] if row and row[0] else "1970-01-01T00:00:00+00:00"
|
||||
cur.execute("""
|
||||
select code,status,title,updated_at
|
||||
from audit.sprint_items
|
||||
where updated_at > %s::timestamptz
|
||||
order by updated_at, code
|
||||
limit %s
|
||||
""", (cursor, limit))
|
||||
rows = cur.fetchall()
|
||||
emitted = 0
|
||||
last = cursor
|
||||
for code, status, title, updated in rows:
|
||||
key = "audit:%s:%s" % (code, _iso(updated))
|
||||
etype = ("audit.finding.closed" if status in ("done", "dropped")
|
||||
else "audit.finding.opened" if status in ("open", "waiting_user")
|
||||
else "audit.finding.updated")
|
||||
ev = event(idempotency_key=key, source="audit360", type_=etype,
|
||||
subject=code, data={"code": code, "status": status,
|
||||
"title_ascii": _ascii_text(title),
|
||||
"title_utf8_b64": _utf8_b64(title)})
|
||||
if enqueue(conn, ev):
|
||||
emitted += 1
|
||||
last = _iso(updated)
|
||||
if rows:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("""
|
||||
insert into events.adapter_state(adapter,cursor,updated_at)
|
||||
values ('audit360',%s,now())
|
||||
on conflict (adapter) do update
|
||||
set cursor=excluded.cursor, updated_at=now()
|
||||
""", (last,))
|
||||
conn.commit()
|
||||
return emitted
|
||||
@@ -24,6 +24,7 @@ def connect():
|
||||
dbname=os.getenv("PGDATABASE", "rag"),
|
||||
user=os.getenv("PGUSER", "postgres"),
|
||||
password=pw,
|
||||
client_encoding="UTF8",
|
||||
connect_timeout=5,
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Buryans Stage 2 events pipeline
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=PYTHONPATH=/opt/events-nats
|
||||
ExecStart=/usr/bin/python3 /root/buryan-infra/ops/events/pipeline.py
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=read-only
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
"""pgvector pilot: extension, vector column, nearest-neighbor operator."""
|
||||
import json
|
||||
from event_store import connect
|
||||
|
||||
|
||||
def main():
|
||||
conn = connect()
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("create extension if not exists vector")
|
||||
cur.execute("""
|
||||
create table if not exists events.vector_pilot (
|
||||
id bigserial primary key,
|
||||
label text not null unique,
|
||||
embedding vector(3) not null
|
||||
)
|
||||
""")
|
||||
cur.execute("delete from events.vector_pilot where label like 'pilot-%'")
|
||||
cur.executemany(
|
||||
"insert into events.vector_pilot(label,embedding) values (%s,%s)",
|
||||
[("pilot-a", "[1,0,0]"), ("pilot-b", "[0,1,0]"), ("pilot-c", "[0.9,0.1,0]")],
|
||||
)
|
||||
cur.execute("""
|
||||
select label, embedding <-> '[1,0,0]'::vector as distance
|
||||
from events.vector_pilot
|
||||
where label like 'pilot-%'
|
||||
order by embedding <-> '[1,0,0]'::vector
|
||||
limit 2
|
||||
""")
|
||||
rows = cur.fetchall()
|
||||
cur.execute("delete from events.vector_pilot where label like 'pilot-%'")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
print(json.dumps({
|
||||
"extension": "vector",
|
||||
"pilot": "synthetic-3d",
|
||||
"nearest": rows[0][0],
|
||||
"distance": float(rows[0][1]),
|
||||
"top2": [r[0] for r in rows],
|
||||
"note": "infrastructure pilot, not production semantic search",
|
||||
}, ensure_ascii=False))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Durable Stage 2 pipeline: adapter → outbox → JetStream → idempotent consumer."""
|
||||
import asyncio
|
||||
import signal
|
||||
import time
|
||||
|
||||
from adapters import audit360, jellyfin_media, seerr_requests
|
||||
from event_store import connect, init
|
||||
from nats_relay import consume_once, relay_once
|
||||
|
||||
STOP = False
|
||||
|
||||
|
||||
def _stop(*_):
|
||||
global STOP
|
||||
STOP = True
|
||||
|
||||
|
||||
def main():
|
||||
signal.signal(signal.SIGTERM, _stop)
|
||||
signal.signal(signal.SIGINT, _stop)
|
||||
conn = connect()
|
||||
init(conn)
|
||||
conn.close()
|
||||
print("events-pipeline start", flush=True)
|
||||
while not STOP:
|
||||
try:
|
||||
conn = connect()
|
||||
init(conn)
|
||||
emitted = audit360(conn) + jellyfin_media(conn) + seerr_requests(conn)
|
||||
conn.close()
|
||||
relayed = asyncio.run(relay_once())
|
||||
consumed = asyncio.run(consume_once(timeout=2))
|
||||
print("tick emitted=%s relayed=%s consumed=%s" % (emitted, relayed, consumed), flush=True)
|
||||
except Exception as e:
|
||||
print("tick_error", str(e)[:300], flush=True)
|
||||
for _ in range(5):
|
||||
if STOP:
|
||||
break
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -40,6 +40,12 @@ CREATE TABLE IF NOT EXISTS events.inbox (
|
||||
CREATE INDEX IF NOT EXISTS inbox_key_idx
|
||||
ON events.inbox (idempotency_key);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS events.adapter_state (
|
||||
adapter text PRIMARY KEY,
|
||||
cursor text,
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS events.effects (
|
||||
idempotency_key text PRIMARY KEY,
|
||||
consumer text NOT NULL,
|
||||
|
||||
@@ -101,6 +101,48 @@ def fitness():
|
||||
"items": [{"id": i, "name": n, "status": s} for i, n, s in items]}
|
||||
|
||||
|
||||
def media_coverage():
|
||||
qs = urllib.parse.urlencode({
|
||||
"Recursive": "true", "IncludeItemTypes": "Movie,Series",
|
||||
"Fields": "MediaStreams,MediaSources", "Limit": "200"})
|
||||
data = jf("/Items?" + qs)
|
||||
items = data.get("Items") or []
|
||||
rus = {"ru", "rus", "russian", "русский"}
|
||||
rows = []
|
||||
for x in items:
|
||||
if x.get("Type") in ("BoxSet", "Folder", "CollectionFolder"):
|
||||
continue
|
||||
streams = x.get("MediaStreams") or []
|
||||
sources = x.get("MediaSources") or []
|
||||
if x.get("Type") == "Series" and not sources:
|
||||
try:
|
||||
ep = jf("/Shows/%s/Episodes?Fields=MediaStreams,MediaSources&Limit=200"
|
||||
% x.get("Id"))
|
||||
eps = ep.get("Items") or []
|
||||
streams = [s for e in eps for s in (e.get("MediaStreams") or [])]
|
||||
sources = [s for e in eps for s in (e.get("MediaSources") or [])]
|
||||
except Exception:
|
||||
pass
|
||||
audio = [s for s in streams if s.get("Type") == "Audio"]
|
||||
subs = [s for s in streams if s.get("Type") == "Subtitle" or s.get("IsTextSubtitleStream")]
|
||||
has_ru_audio = any((s.get("Language") or "").lower() in rus or
|
||||
any(w in (s.get("DisplayTitle") or "").lower() for w in ("russian", "русск"))
|
||||
for s in audio)
|
||||
has_ru_subs = any((s.get("Language") or "").lower() in rus or
|
||||
any(w in (s.get("DisplayTitle") or "").lower() for w in ("russian", "русск"))
|
||||
for s in subs)
|
||||
direct = bool(sources) and all(
|
||||
bool(s.get("SupportsDirectPlay") or s.get("SupportsDirectStream")) for s in sources)
|
||||
rows.append({"id": x.get("Id"), "name": x.get("Name"), "type": x.get("Type"),
|
||||
"ru_audio": has_ru_audio, "ru_subs": has_ru_subs, "direct_play": direct})
|
||||
return {"ok": True, "total": len(rows),
|
||||
"ru_audio": sum(1 for x in rows if x["ru_audio"]),
|
||||
"ru_subs": sum(1 for x in rows if x["ru_subs"]),
|
||||
"direct_play": sum(1 for x in rows if x["direct_play"]),
|
||||
"missing_ru_audio": sum(1 for x in rows if not x["ru_audio"]),
|
||||
"items": rows}
|
||||
|
||||
|
||||
def audit_status():
|
||||
try:
|
||||
import psycopg2
|
||||
@@ -134,6 +176,11 @@ def home_status():
|
||||
out["audit"] = audit_status()
|
||||
fs = fitness()
|
||||
out["fitness"] = {"pass": fs["pass"], "total": fs["total"]}
|
||||
try:
|
||||
c = media_coverage()
|
||||
out["coverage"] = {"total": c["total"], "ru_audio": c["ru_audio"], "ru_subs": c["ru_subs"]}
|
||||
except Exception:
|
||||
out["coverage"] = {"error": "unavailable"}
|
||||
return out
|
||||
|
||||
|
||||
@@ -171,6 +218,12 @@ def acceptance_status():
|
||||
{"name": "Prism", "what": "очередь LLM (не трогать)",
|
||||
"url": "/alpha/owner", "auto": "error" not in (h.get("prism") or {}),
|
||||
"detail": f"pending={(h.get('prism') or {}).get('pending_tasks','—')} errors={(h.get('prism') or {}).get('error_tasks','—')}"},
|
||||
{"name": "RU-озвучка", "what": "русская дорожка/субтитры",
|
||||
"url": "/alpha/", "auto": (h.get("coverage") or {}).get("ru_audio", 0) > 0,
|
||||
"detail": "RU audio %s/%s · subs %s" % (
|
||||
(h.get("coverage") or {}).get("ru_audio", "—"),
|
||||
(h.get("coverage") or {}).get("total", "—"),
|
||||
(h.get("coverage") or {}).get("ru_subs", "—"))},
|
||||
{"name": "Gitea", "what": "код и PR",
|
||||
"url": "http://192.168.1.140:3000/", "auto": gitea_code == 200,
|
||||
"detail": f"HTTP {gitea_code}"},
|
||||
@@ -389,6 +442,12 @@ class H(BaseHTTPRequestHandler):
|
||||
except Exception as e:
|
||||
self.out(502, {"ok": False, "error": str(e)[:300]})
|
||||
return
|
||||
if u.path == "/v1/media/coverage":
|
||||
try:
|
||||
self.out(200, media_coverage())
|
||||
except Exception as e:
|
||||
self.out(502, {"ok": False, "error": str(e)[:300]})
|
||||
return
|
||||
if u.path == "/v1/fitness":
|
||||
self.out(200, fitness())
|
||||
return
|
||||
@@ -499,6 +558,7 @@ async function boot(){try{const m=await (await fetch('v1/me')).json();document.g
|
||||
<div class=card><h3>Prism</h3><div class=tag>pending ${p.pending_tasks??'—'} · running ${p.running_tasks??'—'} · errors ${p.error_tasks??'—'}</div></div>
|
||||
<div class=card><h3>Audit 360</h3><div class=tag>done ${(s.audit||{}).done??'—'} · review ${(s.audit||{}).review_pending??'—'} · open ${(s.audit||{}).in_progress??'—'}</div><div class=tag><a href="http://192.168.1.10:9161/">открыть трекер</a></div></div>
|
||||
<div class=card><h3>Fitness</h3><div class=tag>${(s.fitness||{}).pass??'—'}/${(s.fitness||{}).total??'—'} pass</div></div>
|
||||
<div class=card><h3>RU-озвучка</h3><div class=tag>${(s.coverage||{}).ru_audio??'—'}/${(s.coverage||{}).total??'—'} · субтитры ${(s.coverage||{}).ru_subs??'—'}</div></div>
|
||||
<div class=card><h3>Режим</h3><div class=tag>read-only · без записи</div></div>`}catch(e){}
|
||||
try{const r=await (await fetch('v1/media/recent')).json();const xs=r.items||[];document.getElementById('recent').innerHTML=xs.map(x=>`<div class=card><h3>${e(x.name)}</h3><div class=tag>${e(x.type)} ${e(x.year||'')}</div><div class=mut style="margin-top:6px">${e(x.overview||'')}</div><div style="margin-top:8px"><a href="https://media.buryans.ru/web/index.html#!/details?id=${e(x.id)}" target=_blank>Открыть в Jellyfin →</a></div></div>`).join('')}catch(e){}}
|
||||
document.getElementById('q').addEventListener('keydown',e=>{if(e.key==='Enter')go()});boot();
|
||||
|
||||
Reference in new issue
Block a user