diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9f43494 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# FIX CRLF always when developer has not set +# Linux/Mac: git config --global core.autocrlf input +# Windows: git config --global core.autocrlf true +# Auto detect text files and perform LF normalization +* text=auto +* eol=lf diff --git a/feeder-plugin/tribler-feeder/src/tribler/mod.rs b/feeder-plugin/tribler-feeder/src/tribler/mod.rs index 239f1c3..cff263e 100644 --- a/feeder-plugin/tribler-feeder/src/tribler/mod.rs +++ b/feeder-plugin/tribler-feeder/src/tribler/mod.rs @@ -601,10 +601,17 @@ impl TriblerPlugin { else { return vec![rec]; }; + // Stamp the per-file CID in both shapes: the `cids/` key-set member + // (what meta-share ingest and meta-watch's codec check actually read — + // legacy `cid_*` names are no longer tolerated) plus the named field, kept + // as an internal convergence key that the gateway's meta-core sink strips + // before the record is stored. let with_cid = move |mut r: DiscoveryRecord, idx: u64| -> DiscoveryRecord { + let cid = compute_bt_v1_file_cid(&ih20, idx); + r.fields.entry(format!("cids/{cid}")).or_insert_with(|| "true".to_string()); r.fields .entry("cid_btih_v1_file".to_string()) - .or_insert_with(|| compute_bt_v1_file_cid(&ih20, idx)); + .or_insert(cid); r }; if is_obvious_single_file(&title) { @@ -630,10 +637,10 @@ impl TriblerPlugin { .collect(); let per_file = |f: &TorrentFile, force_episode: bool| { let mut r = build_file_record(&rec.fields, &rec.record_id, f); - r.fields.insert( - "cid_btih_v1_file".to_string(), - compute_bt_v1_file_cid(&ih20, f.index as u64), - ); + let cid = compute_bt_v1_file_cid(&ih20, f.index as u64); + // Key-set member first — it is the shape consumers read. + r.fields.insert(format!("cids/{cid}"), "true".to_string()); + r.fields.insert("cid_btih_v1_file".to_string(), cid); if force_episode { // A multi-video pack is a TV season — force the kind so enrichment // resolves the show as TV (the show title drives the TMDB search).