mirror of
https://github.com/myronblair/kino-app
synced 2026-07-27 21:18:43 -05:00
Auto-enqueue ABR transcode on Sonarr import, matching Radarr import behavior
This commit is contained in:
@@ -1237,6 +1237,7 @@ async def sonarr_import(payload: dict, user: dict = Depends(require_admin)):
|
||||
all_series = await asyncio.to_thread(sonarr_client.list_series, s["sonarr_url"], s["sonarr_api_key"])
|
||||
by_id = {x["sonarr_id"]: x for x in all_series}
|
||||
created_shows = 0; created_eps = 0
|
||||
auto = s.get("auto_transcode", "off")
|
||||
for sid in sonarr_ids:
|
||||
m = by_id.get(int(sid))
|
||||
if not m: continue
|
||||
@@ -1269,6 +1270,8 @@ async def sonarr_import(payload: dict, user: dict = Depends(require_admin)):
|
||||
sonarr_episode_id=ep["sonarr_episode_id"],
|
||||
).model_dump()
|
||||
await db.episodes.insert_one(edoc); created_eps += 1
|
||||
if auto in ("quick", "abr"):
|
||||
await _enqueue_transcode(edoc["id"], auto, triggered_by="auto", content_type="episode")
|
||||
# Auto-fetch English subtitle for this episode (needs show's tmdb_id + season/episode numbers)
|
||||
show_doc = await db.shows.find_one({"id": show_id}, {"_id": 0, "tmdb_id": 1})
|
||||
if show_doc and show_doc.get("tmdb_id"):
|
||||
|
||||
Reference in New Issue
Block a user