gitattributes

This commit is contained in:
Worph
2026-07-14 16:06:19 +02:00
parent a8df97ac1c
commit 1e919d89c7
2 changed files with 18 additions and 5 deletions
+6
View File
@@ -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
@@ -601,10 +601,17 @@ impl TriblerPlugin {
else { else {
return vec![rec]; return vec![rec];
}; };
// Stamp the per-file CID in both shapes: the `cids/<cid>` 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 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 r.fields
.entry("cid_btih_v1_file".to_string()) .entry("cid_btih_v1_file".to_string())
.or_insert_with(|| compute_bt_v1_file_cid(&ih20, idx)); .or_insert(cid);
r r
}; };
if is_obvious_single_file(&title) { if is_obvious_single_file(&title) {
@@ -630,10 +637,10 @@ impl TriblerPlugin {
.collect(); .collect();
let per_file = |f: &TorrentFile, force_episode: bool| { let per_file = |f: &TorrentFile, force_episode: bool| {
let mut r = build_file_record(&rec.fields, &rec.record_id, f); let mut r = build_file_record(&rec.fields, &rec.record_id, f);
r.fields.insert( let cid = compute_bt_v1_file_cid(&ih20, f.index as u64);
"cid_btih_v1_file".to_string(), // Key-set member first — it is the shape consumers read.
compute_bt_v1_file_cid(&ih20, f.index as u64), r.fields.insert(format!("cids/{cid}"), "true".to_string());
); r.fields.insert("cid_btih_v1_file".to_string(), cid);
if force_episode { if force_episode {
// A multi-video pack is a TV season — force the kind so enrichment // 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). // resolves the show as TV (the show title drives the TMDB search).