From 848cd3e478d77daf75076e5ee075fb4f76304baa Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 18 Feb 2026 20:42:09 +0100 Subject: render credits --- import/src/plugins/trakt.rs | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'import') diff --git a/import/src/plugins/trakt.rs b/import/src/plugins/trakt.rs index cc6810c..9b7ed99 100644 --- a/import/src/plugins/trakt.rs +++ b/import/src/plugins/trakt.rs @@ -521,23 +521,28 @@ impl Trakt { sort: Sort::None, })? { Some(r) => r, - None => txn.insert(ObjectBuffer::new(&mut [ - (NO_SLUG.0, &slug.as_str()), - (NO_VISIBILITY.0, &VISI_VISIBLE), - (NO_TITLE.0, &ap.person.name.as_str()), - (NO_IDENTIFIERS.0, &{ - let mut o = ObjectBuffer::empty(); - o = o.as_object().insert(IDENT_TRAKT_PERSON, traktid); - if let Some(tmdbid) = ap.person.ids.tmdb { - o = o.as_object().insert(IDENT_TMDB_PERSON, tmdbid); - } - if let Some(imdbid) = &ap.person.ids.imdb { - o = o.as_object().insert(IDENT_IMDB_PERSON, imdbid); - } - o - }), - ]))?, + None => { + txn.insert(ObjectBuffer::new(&mut [(NO_SLUG.0, &slug.as_str())]))? + } }; + + let mut c = txn.get(row)?.unwrap(); + c = c.as_object().insert(NO_KIND, KIND_PERSON); + c = c.as_object().insert(NO_VISIBILITY, VISI_VISIBLE); + c = c.as_object().insert(NO_TITLE, &ap.person.name); + c = c.as_object().update(NO_IDENTIFIERS, |ids| { + let mut ids = ids.insert(IDENT_TRAKT_PERSON, traktid); + if let Some(tmdbid) = ap.person.ids.tmdb { + ids = ids.as_object().insert(IDENT_TMDB_PERSON, tmdbid); + } + if let Some(imdbid) = &ap.person.ids.imdb { + ids = ids.as_object().insert(IDENT_IMDB_PERSON, imdbid); + } + ids + }); + + txn.update(row, c)?; + credits.push(ObjectBuffer::new(&mut [ (CR_KIND.0, crcat), (CR_ROLE.0, &role.as_str()), -- cgit v1.3