From 30e13399fa9f815cd1884fe87914cdb22d1985af Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 16 Jan 2026 04:21:10 +0100 Subject: begin refactor import --- import/src/plugins/tmdb.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'import/src/plugins/tmdb.rs') diff --git a/import/src/plugins/tmdb.rs b/import/src/plugins/tmdb.rs index ce9ae59..206781b 100644 --- a/import/src/plugins/tmdb.rs +++ b/import/src/plugins/tmdb.rs @@ -4,11 +4,12 @@ Copyright (C) 2026 metamuffin */ use crate::{ - USER_AGENT, + NodeID, USER_AGENT, plugins::{ImportContext, ImportPlugin, PluginInfo}, }; use anyhow::{Context, Result, anyhow, bail}; use jellycache::{EscapeKey, HashKey, cache_memory, cache_store}; +use jellycommon::jellyobject::Object; use log::info; use reqwest::{ Client, ClientBuilder, @@ -160,14 +161,14 @@ impl ImportPlugin for Tmdb { ..Default::default() } } - fn process(&self, ct: &ImportContext, node: NodeID, data: &Node) -> Result<()> { + fn process(&self, ct: &ImportContext, node: NodeID, data: Object) -> Result<()> { self.process_primary(ct, node, data)?; self.process_episode(ct, node, data)?; Ok(()) } } impl Tmdb { - fn process_primary(&self, ct: &ImportContext, node: NodeID, data: &Node) -> Result<()> { + fn process_primary(&self, ct: &ImportContext, node: NodeID, data: Object) -> Result<()> { let (tmdb_kind, tmdb_id): (_, u64) = if let Some(id) = data.identifiers.get(&IdentifierType::TmdbSeries) { (TmdbKind::Tv, id.parse()?) @@ -199,7 +200,7 @@ impl Tmdb { .transpose()? .flatten(); - ct.db.update_node_init(node, |node| { + ct.dba.update_node_by_nodeid(node, |node| { node.title = details.title.clone().or(node.title.clone()); node.tagline = details.tagline.clone().or(node.tagline.clone()); node.description = Some(details.overview.clone()); -- cgit v1.3