rework domain field
Publish image / publish (push) Failing after 13s

This commit is contained in:
Worph
2026-09-02 00:02:05 +02:00
parent 1db9704990
commit 32d89e8354
3 changed files with 348 additions and 65 deletions
+7 -2
View File
@@ -200,7 +200,12 @@ pub fn file_type_for_category(category_id: i32) -> &'static str {
pub fn content_kind_for_category(category_id: i32) -> Option<&'static str> {
match category_id / 1000 {
2 => Some("movie"),
5 => Some("tv"),
// ⚠ `episode`, not `tv`. `tv` is not a `contentKind` at all — it was a
// `domain` value, and it isn't even that any more (film + tv merged
// into `screen`, METADATA_KEYS.md §14.17). A kind outside the registry
// vocabulary resolves to no domain and no workForm, so the row is
// stamped with neither and is invisible to every client wall.
5 => Some("episode"),
_ => None,
}
}
@@ -274,7 +279,7 @@ mod tests {
#[test]
fn content_kind_only_where_unambiguous() {
assert_eq!(content_kind_for_category(2040), Some("movie"));
assert_eq!(content_kind_for_category(5040), Some("tv"));
assert_eq!(content_kind_for_category(5040), Some("episode"));
assert_eq!(content_kind_for_category(3010), None);
assert_eq!(content_kind_for_category(7020), None);
}
+6 -2
View File
@@ -186,12 +186,16 @@ impl UsenetPlugin {
);
if let Some(kind) = content_kind_for_category(r.category_id) {
fields.insert("contentKind".to_string(), kind.to_string());
// The routing axis, co-written with the kind (METADATA_KEYS.md §1):
// The routing axes, co-written with the kind (METADATA_KEYS.md §1):
// `fileType` says what the bytes are, `domain` says which app wants
// the record. Without it the row never reaches a client wall.
// the record, `workForm` whether it stands alone or is one
// instalment. Without the domain the row never reaches a wall.
if let Some(d) = meta_feeder_sdk::domain::domain_for_content_kind(kind) {
fields.insert("domain".to_string(), d.to_string());
}
if let Some(wf) = meta_feeder_sdk::domain::work_form_for_content_kind(kind) {
fields.insert("workForm".to_string(), wf.to_string());
}
}
if let Some(ts) = r.post_date {
fields.insert("publishedAt".to_string(), ts.to_string());