aboutsummaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-18 20:42:09 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-18 20:42:09 +0100
commit848cd3e478d77daf75076e5ee075fb4f76304baa (patch)
treeb253fb461952e85045f02a1e1be3e4d67dfe93c1 /import
parent0d2068477d474416d92557c5af5491527c50d11d (diff)
downloadjellything-848cd3e478d77daf75076e5ee075fb4f76304baa.tar
jellything-848cd3e478d77daf75076e5ee075fb4f76304baa.tar.bz2
jellything-848cd3e478d77daf75076e5ee075fb4f76304baa.tar.zst
render credits
Diffstat (limited to 'import')
-rw-r--r--import/src/plugins/trakt.rs37
1 files changed, 21 insertions, 16 deletions
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()),