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

This commit is contained in:
Worph
2026-09-02 00:02:14 +02:00
parent aea258c803
commit 48b0e52146
4 changed files with 358 additions and 70 deletions
@@ -178,12 +178,16 @@ fn build_seed_record(
// mode marker, contentKind, and optionally anime.
fields.insert(mode.marker().to_string(), "true".to_string());
fields.insert("contentKind".to_string(), content_kind.to_string());
// The routing axis, co-written with the kind it derives from
// The routing axes, co-written with the kind they derive from
// (METADATA_KEYS.md §1): `fileType` says what the bytes are, `domain` says
// which app wants the record.
// which app wants the record, `workForm` whether the work stands alone or
// is one instalment of a run.
if let Some(d) = meta_feeder_sdk::domain::domain_for_content_kind(content_kind) {
fields.insert("domain".to_string(), d.to_string());
}
if let Some(wf) = meta_feeder_sdk::domain::work_form_for_content_kind(content_kind) {
fields.insert("workForm".to_string(), wf.to_string());
}
fields.insert("fileType".to_string(), "video".to_string());
if anime {
fields.insert("anime".to_string(), "true".to_string());
+11 -6
View File
@@ -548,7 +548,8 @@ fn build_stub_patch(f: &BTreeMap<String, String>) -> Option<EnrichOutcome> {
set.insert("fileType".to_string(), "video".to_string());
set.insert("videoType".to_string(), "movie".to_string());
set.insert("contentKind".to_string(), "movie".to_string());
set.insert("domain".to_string(), "film".to_string());
set.insert("domain".to_string(), "screen".to_string());
set.insert("workForm".to_string(), "standalone".to_string());
}
if !has_poster {
// Non-resolvable marker — the image 404s (broken tile), but the card
@@ -774,10 +775,13 @@ async fn build_enrichment_patch(
match matched_kind {
TmdbKind::Movie => {
set.insert("contentKind".to_string(), "movie".to_string());
// The routing axis moves with the kind: a TMDB movie match is
// `domain=film`, and reconciling the kind without the domain would
// leave the record routed as a series.
set.insert("domain".to_string(), "film".to_string());
// The routing axes move with the kind. `domain` is `screen` for
// films and serials alike since the merge (METADATA_KEYS.md
// §14.17), so the film-vs-serial half is `workForm` — and
// reconciling the kind without it would leave the record shaped as
// a series.
set.insert("domain".to_string(), "screen".to_string());
set.insert("workForm".to_string(), "standalone".to_string());
// Co-write the narrower `videoType` facet (METADATA_KEYS.md §14.11
// — contentKind=movie ↔ videoType=movie). Overwrites any
// category-derived videoType from `into_discovery_record` with the
@@ -789,7 +793,8 @@ async fn build_enrichment_patch(
}
TmdbKind::Tv => {
set.insert("contentKind".to_string(), "episode".to_string());
set.insert("domain".to_string(), "tv".to_string());
set.insert("domain".to_string(), "screen".to_string());
set.insert("workForm".to_string(), "serial".to_string());
// contentKind=episode ↔ videoType=tvshow (METADATA_KEYS.md §14.11).
set.insert("videoType".to_string(), "tvshow".to_string());
// Season/episode boundary validation. Only a parsed `season`
@@ -533,6 +533,9 @@ impl TriblerPlugin {
if let Some(d) = meta_feeder_sdk::domain::domain_for_content_kind(kind) {
rec.fields.insert("domain".to_string(), d.to_string());
}
if let Some(wf) = meta_feeder_sdk::domain::work_form_for_content_kind(kind) {
rec.fields.insert("workForm".to_string(), wf.to_string());
}
}
// For episode records, stamp the *parsed* season/episode so the consumer
// renders a proper series with an ordered episode list (meta-watch keys
@@ -649,7 +652,9 @@ impl TriblerPlugin {
// resolves the show as TV (the show title drives the TMDB search).
r.fields
.insert("contentKind".to_string(), "episode".to_string());
r.fields.insert("domain".to_string(), "tv".to_string());
r.fields.insert("domain".to_string(), "screen".to_string());
r.fields
.insert("workForm".to_string(), "serial".to_string());
}
r
};