{"record":{"id":"6194526ad3cb72c8","repo":"tonhowtf/omniget","slug":"a-conta-n-o-devolveu-nenhuma-linha","errorCode":null,"errorMessage":"a conta não devolveu nenhuma linha","messagePattern":"a conta não devolveu nenhuma linha","errorType":"exception","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/lists/trakt.rs","lineNumber":792,"sourceCode":"            .await?;\n        push(\n            \"watchlist\",\n            parse_items(&v, \"watchlist\"),\n            &mut by_part,\n            &mut all,\n        );\n    }\n    if want(\"lists\") {\n        let raw = api.get_all(\"/users/me/lists\", 1, &p, \"listas\").await?;\n        for (id, name) in parse_lists(&raw) {\n            let path = format!(\"/users/me/lists/{}/items\", id);\n            let items = api.get_all(&path, opts.max_pages, &p, &name).await?;\n            let label = format!(\"lista: {}\", name);\n            push(&label, parse_items(&items, &label), &mut by_part, &mut all);\n        }\n    }\n    if all.is_empty() {\n        return Err(anyhow!(\"a conta não devolveu nenhuma linha\"));\n    }\n    all.sort_by(|a, b| b.date.cmp(&a.date).then(a.title.cmp(&b.title)));\n\n    let dest = std::path::PathBuf::from(opts.dest.trim());\n    let formats = if opts.formats.is_empty() {\n        vec![\"json\".to_string(), \"csv\".to_string()]\n    } else {\n        opts.formats.clone()\n    };\n    let files = super::write_exports(&dest, \"trakt\", &all, &formats, |es| {\n        super::merge::timeline_markdown(\"Trakt\", es)\n    })?;\n    report(&p, TOOL_ID, \"done\", 1, Some(1), None);\n    Ok(ExportResult {\n        used_session: true,\n        username,\n        entries: all.len(),\n        by_part,","sourceCodeStart":774,"sourceCodeEnd":810,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/lists/trakt.rs#L774-L810","documentation":"After fetching all requested lists via get_all and merging parsed entries, run() checks whether anything was collected; an empty result is treated as an error rather than producing an empty export. It guards against silently writing empty JSON/CSV files.","triggerScenarios":"Every list path in the requested set returned zero items — e.g. the account's lists are all empty, all requested list slugs don't exist, or get_all parsed no recognizable entries (parse_items matched nothing).","commonSituations":"New Trakt account with empty watchlist/lists; requesting a custom list by a name that doesn't exist for this user; account is private/empty; API returned success but empty arrays due to a pagination edge case.","solutions":["Verify on trakt.tv that the account/lists actually contain items","Check the list names/slugs requested in opts match real lists for the user","Confirm pagination headers were honored — try increasing opts.max_pages","Log the raw get_all response per list to see which one returned empty","Handle the empty case in the caller by showing a friendly message instead of treating it as a crash"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check that the account has at least one list with items\nlet lists = trakt_get_user_lists(&config).await?;\nif lists.iter().all(|l| l.item_count == 0) {\n    return Err(\"nothing to export: all lists are empty\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = trakt_lists::run(&opts, &progress).await {\n    if e.to_string().contains(\"nenhuma linha\") {\n        // show 'nothing to export' notice instead of a failure dialog\n        return Ok(());\n    }\n    return Err(e);\n}","preventionTips":["Verify list names/slugs exist and contain items before exporting","Confirm the account is the intended one and is not empty","Cap max_pages consistently with actual list sizes"],"tags":["trakt","empty-result","export"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}