diff options
Diffstat (limited to 'import/src/plugins/trakt.rs')
| -rw-r--r-- | import/src/plugins/trakt.rs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/import/src/plugins/trakt.rs b/import/src/plugins/trakt.rs index 1d01436..cc3b119 100644 --- a/import/src/plugins/trakt.rs +++ b/import/src/plugins/trakt.rs @@ -7,6 +7,7 @@ use crate::{ USER_AGENT, helpers::get_or_insert_slug, plugins::{ImportPlugin, PluginContext, PluginInfo}, + source_rank::ObjectImportSourceExt, }; use anyhow::{Context, Result, anyhow, bail}; use jellycache::{Cache, HashKey}; @@ -404,6 +405,7 @@ impl ImportPlugin for Trakt { fn info(&self) -> PluginInfo { PluginInfo { name: "trakt", + tag: MSOURCE_TRAKT, handle_instruction: true, handle_process: true, ..Default::default() @@ -470,13 +472,15 @@ impl Trakt { ct.ic.db.transaction(&mut |txn| { let mut node = txn.get(node_row)?.unwrap(); - node = node.as_object().insert(NO_KIND, trakt_kind.as_node_kind()); - node = node.as_object().insert(NO_TITLE, &details.title); + node = node + .as_object() + .insert_s(ct.is, NO_KIND, trakt_kind.as_node_kind()); + node = node.as_object().insert_s(ct.is, NO_TITLE, &details.title); if let Some(overview) = &details.overview { - node = node.as_object().insert(NO_DESCRIPTION, &overview); + node = node.as_object().insert_s(ct.is, NO_DESCRIPTION, &overview); } if let Some(tagline) = &details.tagline { - node = node.as_object().insert(NO_TAGLINE, &tagline); + node = node.as_object().insert_s(ct.is, NO_TAGLINE, &tagline); } if let Some(x) = details.ids.imdb.clone() { node = node @@ -520,9 +524,9 @@ impl Trakt { let row = get_or_insert_slug(txn, &slug)?; 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().insert_s(ct.is, NO_KIND, KIND_PERSON); + c = c.as_object().insert_s(ct.is, NO_VISIBILITY, VISI_VISIBLE); + c = c.as_object().insert_s(ct.is, NO_TITLE, &ap.person.name); c = c.as_object().update(NO_IDENTIFIERS, |ids| { let mut ids = ids.insert(IDENT_TRAKT_PERSON, &traktid.to_string()); if let Some(tmdbid) = ap.person.ids.tmdb { @@ -591,11 +595,11 @@ impl Trakt { let episodes = self.show_season_episodes(&ct.ic.cache, show_id, season, ct.rt)?; if let Some(episode) = episodes.get(episode.saturating_sub(1) as usize) { ct.ic.update_node(node, |mut node| { - node = node.as_object().insert(NO_KIND, KIND_EPISODE); - node = node.as_object().insert(NO_INDEX, episode.number); - node = node.as_object().insert(NO_TITLE, &episode.title); + node = node.as_object().insert_s(ct.is, NO_KIND, KIND_EPISODE); + node = node.as_object().insert_s(ct.is, NO_INDEX, episode.number); + node = node.as_object().insert_s(ct.is, NO_TITLE, &episode.title); if let Some(overview) = &episode.overview { - node = node.as_object().insert(NO_DESCRIPTION, &overview); + node = node.as_object().insert_s(ct.is, NO_DESCRIPTION, &overview); } if let Some(r) = episode.rating { node = node |