Skip to content

Commit bdc1d4c

Browse files
Add Skip Tunarr cross-reference option to Export step
New users frequently hit a wall where export produces 0 results because Tunarr shows their Plex source as connected but has not fully indexed the library programs yet. The cross-reference skips every Plex title, leaving them with an empty CSV and no obvious way forward. Changes: - backend: POST /api/pipeline/export now accepts an optional JSON body with {no_crossref: true}, which passes --no-crossref to export.py and skips the Tunarr title-matching step entirely. - frontend: Export step gains a Skip Tunarr cross-reference checkbox next to the Run button. When checked, a yellow hint explains when to use it. The checkbox is disabled while the export is running. - CLAUDE.md: updated /api/pipeline/export entry to document the new optional body parameter. The --no-crossref flag already existed in export.py for CLI users; this just surfaces it in the web UI so first-time users are not blocked while they sort out their Tunarr library scan. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 033a335 commit bdc1d4c

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ A title can appear on multiple channels — this is intentional and expected.
265265

266266
| Method | Path | Description |
267267
|--------|------|-------------|
268-
| POST | `/api/pipeline/export` | SSE-stream `export.py` |
268+
| POST | `/api/pipeline/export` | SSE-stream `export.py`; optional JSON body `{"no_crossref": true}` passes `--no-crossref` to skip Tunarr title matching |
269269
| GET | `/api/pipeline/csv` | Download `plex_library.csv` |
270270
| GET | `/api/pipeline/csv/info` | Stats: rows, movies, tv_shows, skipped counts, preview lines |
271271
| GET | `/api/pipeline/prompt` | Fetch `PROMPT.md` with `{TARGET}` and preferences injected |

backend/routers/pipeline_router.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ def _sse(gen: AsyncGenerator[str, None]) -> StreamingResponse:
9191
)
9292

9393

94+
class ExportOptions(BaseModel):
95+
no_crossref: bool = False
96+
9497
@router.post("/pipeline/export")
95-
async def run_export():
96-
return _sse(_stream("export.py", [], "export"))
98+
async def run_export(opts: ExportOptions = ExportOptions()):
99+
args = ["--no-crossref"] if opts.no_crossref else []
100+
return _sse(_stream("export.py", args, "export"))
97101

98102

99103
@router.get("/pipeline/csv")

frontend/src/pages/Run.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ function ExportStep({ onDone }: { onDone: () => void }) {
6868
const [done, setDone] = useState(false);
6969
const [success, setSuccess] = useState(false);
7070
const [summary, setSummary] = useState<Awaited<ReturnType<typeof api.getCsvInfo>> | null>(null);
71+
const [noCrossref, setNoCrossref] = useState(false);
7172

7273
async function run() {
7374
setLines([]); setDone(false); setSummary(null); setRunning(true);
7475
try {
7576
const code = await streamPipeline('/pipeline/export', {}, (ev: StreamEvent) => {
7677
if (ev.type === 'line') setLines(l => [...l, ev.text]);
77-
});
78+
}, noCrossref ? { no_crossref: true } : undefined);
7879
const ok = code === 0;
7980
setSuccess(ok); setDone(true);
8081
if (ok) setSummary(await api.getCsvInfo());
@@ -90,12 +91,24 @@ function ExportStep({ onDone }: { onDone: () => void }) {
9091

9192
return (
9293
<Stack gap="md">
93-
<Group>
94+
<Group align="center">
9495
<Button leftSection={<IconPlayerPlay size={15} />} color="orange" onClick={run} loading={running}>
9596
{running ? 'Exporting…' : done ? 'Re-run Export' : 'Run Export'}
9697
</Button>
9798
{done && !success && <Button variant="subtle" color="red" onClick={run}>Retry</Button>}
99+
<Checkbox
100+
label="Skip Tunarr cross-reference"
101+
checked={noCrossref}
102+
onChange={(e) => setNoCrossref(e.currentTarget.checked)}
103+
disabled={running}
104+
size="sm"
105+
/>
98106
</Group>
107+
{noCrossref && !running && (
108+
<Text size="xs" c="yellow.5">
109+
All Plex content will be exported regardless of what Tunarr has indexed. Use this if Tunarr shows your library but export is skipping everything.
110+
</Text>
111+
)}
99112

100113
{done && success && summary && (
101114
<Card withBorder p="sm" bg="dark.8">

0 commit comments

Comments
 (0)